[aklug] JavaScript... weird stuff

From: Christopher Howard <choward@indicium.us>
Date: Thu Dec 03 2009 - 17:48:27 AKST

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Is it just me, or is JavaScript one of the oddest languages to ever make
the top ten list of most popular programming languages?

- From wikipedia:

"dynamic typing
    As in most scripting languages, types are associated with values,
not variables. For example, a variable x could be bound to a number,
then later rebound to a string. JavaScript supports various ways to test
the type of an object, including duck typing. . . .

"object based
    JavaScript is almost entirely object-based. JavaScript objects are
associative arrays, augmented with prototypes . . .

"run-time evaluation
    JavaScript includes an eval function that can execute statements
provided as strings at run-time. . .

"first-class functions
    Functions are first-class; they are objects themselves. As such,
they have properties and can be passed around and interacted with like
any other object. . . .

"inner functions and closures
    Inner functions (functions defined within other functions) are
created each time the outer function is invoked, and variables of the
outer functions for that invocation continue to exist as long as the
inner functions still exist, even after that invocation is finished
(e.g. if the inner function was returned, it still has access to the
outer function's variables) . . .

"prototypes
    JavaScript uses prototypes instead of classes for inheritance. It is
possible to simulate many class-based features with prototypes in
JavaScript. . . .

"functions as methods
    Unlike many object-oriented languages, there is no distinction
between a function definition and a method definition. Rather, the
distinction occurs during function calling; a function can be called as
a method. When a function is called as a method of an object, the
function's local this keyword is bound to that object for that
invocation.. . . ."

And let's not get started on event handling! It is interesting that
JavaScript was originally supposed to be aimed at non-programmer
types... but JavaScript programming is probably the only programming
I've ever done where I had almost no idea what was going on in my code
the entire time!

- --
Christopher Howard
http://indicium.us
http://theologia.indicium.us
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAksYeHsACgkQQ5FLNdi0BcXVrACdGsR+cpRnQg+I967OznNtsntI
OFIAn3zMXXkxWiQ4ize/tHdGEHUa2jUY
=mDMv
-----END PGP SIGNATURE-----
---------
To unsubscribe, send email to <aklug-request@aklug.org>
with 'unsubscribe' in the message body.
Received on Thu Dec 3 17:50:11 2009

This archive was generated by hypermail 2.1.8 : Thu Dec 03 2009 - 17:50:11 AKST