The most important programming language today
antoniocangiano.com
antoniocangiano.com
If you really wanted to determine 'most important', think about what software you'd be left with if all software and dependencies written in a language was taken away.
Take away JS and a bunch of webapps don't run. Take away C and you have no OS, no web servers, no languages whose leading implementations don't bootstrap themselves, no TomToms telling you how to get to JSconf, and so on.
I do understand the renewed hype behind Javascript, but to enshrine it as most important -- talk about hyperbole and a lack of perspective.
PS: That V8 engine you'd be relying on for your JS -- it's not written in Javascript either.
It's not written in C either :-)
Except Brainfuck.
Maybe Brainfuck is the most important programming language today.
C rocks, though. :)
That's one definition of "important". However, now that we have the OS's and webservers -- and are building _on_ them, what's the most important? Your point is like saying nuts and bolts are most important, for if you take them away the car will fall apart ;-)
I think Steve Yegge said this kind of thing a few years ago - namely that javascript is one of the most important programming languages today. I'm not saying that this invalidates the point, just that it was probably fairly apparent when he said it and, in my opinion, pretty obvious today.
Also, he mentions "And while we’re at it, maybe use it for desktop applications too?" which I think is interesting because Mozilla already has built a framework to do this kind of thing, with xulrunner. It's not based on V8 but newer builds do incorporate Mozilla's version of a javascript JIT, tracemonkey.
However, I'm still not persuaded that it's a compelling server-side programming language. Javascript wins in the browser because it has no competition, but there are already several mature, well-established server-side programming stacks in langauges with fewer warts.
With the V8 engine it really is pretty speedy, and you have the advantage of using the same language for your UI and your server-side processing.
It's too bad that Javascript has become the assembly of the web. I've found GWT to be a terribly leaky abstraction. I've watched as projects like HotRuby stalled and faded. And I've seen projects like the scala version of j2js grapple with performance issues such as inefficient method call overhead in current javascript implementations. I really believe that javascript at this point is holding back progress on the web.
I really hope something like google's NACL succeeds where all the other RIA frameworks have failed. To do so, it is going to have to integrate with the browser much better than applets, flash, etc, but if it succeeds it could allow for a multi-language renaissance on the client that would benefit everyone and force javascript to actually compete with the rest of the PL world.
It might or might not be, but this is far overstated. In terms of rich graphical GUI apps, there is much much more that has been done with either AS3 or Objective C at this point.
I think Javascript optimists vastly underestimate the distance it would need to go to replace either or both of the above.
The magic 'this' parameter is a complete mess. Global scope by default for variables and no block scope is terrible, as is changing scope of variables from global to local if I later add a "var" version later on in the function. (Sure we should avoid global variables but they shouldn't be so easy and encouraged, without a real namespace system.)
Newlines acting like semicolons bites people a lot that I've seen as well. I hate the inconsistency in the object literal syntax. I need to quote the left side of them anyway, e.g. {"interface":"my-interface"} will break otherwise, so why not make it consistent and allow a variable, so I can pass {key: value} into a function requiring a dictionary? I also hate the inconsistency of keywords. Why can I redefine "undefined" and "NaN", but not "interface" or "super"?
Some of these are warts but not having an agreed on object system is a show stopper for general use, imo. Who rolls their own prototype system in Java? Nobody. Who rolls their own imitation of classical objects in JS? Most people.
It has one, as long as you don't need to inherit from other people's objects. But inheritance is a pretty poor way to compose code in most OO languages, especially single-inheritance ones like JavaScript and Java.
> Who rolls their own prototype system in Java? Nobody. Who rolls their own imitation of classical objects in JS? Most people.
Well, a few people. Mostly people familiar with class-based programming languages, which you are surely aware is a minority of the JS-programming population. One of the first things I did in Python was roll my own prototype system, actually.
I really think you should organize your points better. There are some really serious flaws in there (the need for hasOwnProperty() and global-by-default) but you've mixed them indiscriminately with minor annoyances (keyword inconsistency, the absence of classes, no block scope).
- Get data from SQL backends, easy.
- Templates, easy.
- MVC, easy.
- Curl, Ajax, easy.
- JSON, XML, easy.
- Files, sockets, easy.
You name it, I assure you it is easier than any other language you've used before.I say, it is just a matter of ONE year to finally mature the most interesting projects out there, Node.JS and V8CGI
If you want to get your feet wet, go grab V8CGI and play with it, really easy. If you need to play with the geekiest stuff, get Node.JS then.
I guarantee you, you'll never look back. But please, give it a try before judging it.
http://code.google.com/p/v8cgi/
I don't recommend rhino, ringo, or narwhal, just because I don't like to run on top of java. You may try spidermonkey or flusspferd if you like C++ more.
Whatever your flavor, give it a try, then come back and share your experiences.
Yes, I am a JS advocate.
- Global variables by default, which means you will have "var" sprinkled everywhere.
- Brain-dead binding.
function Constructor() {
this.foo = 'bar';
var that = this;
window.setTimeout(function() {
alert(that.foo);
}, 1);
}
- You can call a function with less arguments than specified, meaning you potentially have to make sure each argument is not "undefined" .- Somehow JS isn't weakly typed when it comes to switch statements.
a = 5;
b = '5';
if( a == b )
alert("Equal");
switch (a) {
case b:
alert("This never shows");
}
I am fairly certain that JS popularity is mostly in part due to its monopoly on the web. I'm sure there are more experienced JS users who can point out more flaws.So no, I've never encountered such problems.
Nowhere did I complain about needing to declare things before using it. Having variables be global by default is really poor design.
And about silly equalities, it will inevitably happen once your programs get bigger, and you become frustrated with a bug that has been suppressed through multiple function calls because Brendon Eich thought weak typing was a good idea.
Agreed. Once you've built your site in X language, you still have to deploy it, scale it, and do database migrations.
- JavaScript in client and server. I haven't done, My guess is that with JavaScript the talent of the developer to organize a big code base becomes critical.
- Java and GWT. I've tried this. It works nicely. Strong typing and a great IDE with Eclipse. Same language in the server and in the client.
- Scala and (Scala compiled into JavaScript? This could be nice. We just need somebody really smart to make it happen.
What if you use Scala to create a DSL to create JavaScript RIAs? The DSL can be the framework that will give structure to the RIA. Then you use JavaScript to fill in the blanks.
But recently, i've been very keen to get involved in helping developers on my team improve the user experience of our apps, which is why i started looking into cappuccino.
Atlas and Cappuccino, I have to say are great as frameworks, but only for people with Macs.
So, since then i've been heavily looking into jQuery and found it to be great for helping me create good user experiences, and with the addition of AJAX things tend to get very interesting.
I'm in no position to comment on what i think to future is since im so new to development, but from where im standing and certainly for someone that is just entering the fore, i'm someone that has been through these exact set of questions in the last few weeks, and came to a very similar conclusion through my own trial and error.
jQuery is shallow enough that you can get a ton of work done with it, but still understandable enough that you can dive into it's source and fidget your way through it.
Every year we get a batch of interns from high schools and colleges with no real programming experience, but can start writing full applications without any training whatsoever.
As part of the application process we require they write a TicTacToe application in our free hosted sandboxes and 9/10 times the applicant has no issue and replies with a link to their app. We don't guide them, train them, or instruct them in any way beforehand.
Watch our recent presentation from Confoo and see for yourself, http://vimeo.com/10106797. It really is that easy.
I'm not affiliated with NOLOH,but I am a fan, I know its founder through my work with his technology, and I'm always happy to chat about it with interested people.
Really, what more can we do? Do you not use a tool because there's a company behind it providing support, up to date documentation, and other resources? We even have a clause that says if anything should happen to us, all the source is opened.
It's unsettling that many developers who charge for their own services and products let out a sigh when other developers decide to charge for their services and products.
JavaScript is here to stay because Netscape threw it in the browser and somehow the browser wars didn't screw it up enough to make it problematic as cross-browser html & css. So its the only game in town for web browsers and once you get used to its warts, it does the job.
what would be interesting is a back of the envelop calculation on # lines of js vs c executed globally per minute. id guss c probably wins due to frequency of execution.
That said, I bet JavaScript use will increase and C will shrink, relatively speaking.
I don't know, I think Excel formulas might still have it beat.