JavaScript - It’s a Real Language
clubajax.org
clubajax.org
Later I picked up an O'Reilly book about "the good bits" of Javascript and enjoyed it immensely, but the amount of parseable cruft out there doesn't help up-and-coming JS coders in the slightest.
It's also very short. A total breath of fresh air in an industry where so many publishers have a "bigger is better" mentality.
I wish there was a single curriculum that most JS developers were exposed to and can point to.
Every JS developer I meet has a different way of doing encapsulation and abstraction. This makes it terribly confusing for developers new to the environment who just want to know "the typical way" you do XYZ.
The second major problem with Javascript is that it was prematurely standardized due to excessive pressure to ship during development, and thus has a lot of little mis-features and defects in the core language that haven't been fixed due to concerns about breaking backward compatibility. Luckily it's generally possible to avoid these areas of the language without having to compromise your code so it's just a matter of keeping to good practices and of knowing what to avoid.
The third problem is that Javascript is primarily a web technology where it is married to the DOM, and historically browser DOMs have been a mess: non-standardized, buggy, sometimes slow.
Overall the result is a language with a few landmines that need to be tiptoed around but that is still very solid in its fundamentals. Compare that with many other languages that are more polished and yet fundamentally limited in significant ways (such as Java's lack of closures, for example).
The wonderful thing about JS is that because of its expressiveness, power, and advanced featureset, using the language properly becomes a potent self-reinforcing feedback loop, jQuery is one of the better examples of this.
http://openjsan.org/doc/s/sa/samuraijack/Joose/3.011/lib/Joo...
It's like a tasteful mix of Python and Javascript, but without any of the fat. It's very dynamic, has a small, extremely portable, and high-performance implementation (in a ~200k C library), has prototype-based objects, a JSON-like native datatype, and a better JIT (http://luajit.org/) than any JS implementation thus far.
Recommended introduction: Ierusalimschy's _Programming in Lua, 2nd ed._ (http://www.inf.puc-rio.br/~roberto/pil2/).
I always commit both files (.coffee and .js) together, so I know for sure that the compiled version is up to date.
(With the disclaimer that the CoffeeScript syntax is still unstable, so it probably shouldn't be used for anything mission critical.)
16:30:33 spade@ruta-corsica:~$ passgen
jygugiy5
16:30:35 spade@ruta-corsica:~$ file `which passgen`
/home/spade/bin/passgen: a /home/spade/bin/js -ws script text executable
16:30:40 spade@ruta-corsica:~$ head -n 3 `which passgen`
#!/home/spade/bin/js -ws
/* passgen - configurable password generator
* Copyright 2005 Colby RussellI think JavaScript embedded in websites is one of the most important abilities in the web today. It's critical to the way nearly all modern applications are written and it allows for extremely fast and rapid development of scalable powerful applications.
Awesome, no?
If my site would best be served by Lisp, or Haskell, or Java, or Javascript, or C#, or Python... let me decide. It just feels like we've entered this world that everything has to be Javascript, if its appropriate or not.
For example, the fact that you say there'd be plugin-hell with 30 plugins is crazy. A good management system should be able to efficiently handle hundreds or even millions of components.
And what if we standardized support for the scripting languages? So, for example, the DOM calls looked like RESTFUL services returning JSON. And maybe there was a low-level, but efficient virtual machine that everyone could target (someone mentioned LLVM -- although I really don't care what it is all that much).
It just feels like the web is in this weird cycle where we continue to make suboptimal choices... largely because that's how it was done the first time.
The thought that developers should wait for browsers to catch up with their needs is what leads to such situation. But, if the JVM finally decided to host other languages, after they got a lot of attention, maybe so will browsers. But we need to justify it first. Not wait.
Anyway, malwares would have spread through downloaded executables (e-mail attachments, etc). Is Javascript even helpful to most malwares?
Yes, very much so. Adobe PDF reader's JavaScript ability is the reason it's dangerous to open PDF files anymore. They issue a new patch once a month it seems and are working on a sandbox as the problem cannot be contained. Without JavaScript embedded in the PDF files, this would be a much more manageable issue.