Should JavaScript Get More Respect?
An anonymous reader points out an article in IBM's Crossing Borders series about the language features of JavaScript, surely the Rodney Dangerfield of scripting languages. But with increasing use in such technologies as Ajax, Apache Cocoon, ActionScript, and Rhino, some industry leaders are taking a fresh look at the language. From the article: "Nearly every Web developer has cursed JavaScript at one time or another. Until recently, many developers had all but written off JavaScript as a necessary evil at best or a toy at worst... But JavaScript is becoming increasingly important, and it remains the most broadly available scripting language for Web development."
According to the article
"My friend and colleague Stuart Halloway, one of the foremost experts on Ajax, begins a JavaScript class with a provocative statement: "By 2011, we will recognize JavaScript as a language with a better set of features for developing modern applications." He then says that JavaScript programs are often 10 times as dense as similar Java programs and goes on to show the language features that make it so."
The author seems to equate dense with good, not an association I make
And yet you don't seem to know the difference between an embedded Java applet and integrated JavaScript code.
http://outcampaign.org/
Lately it is like as if some circles are almost pressuring the developer community to pay more attention to java, javascript and affiliated stuff. Every now and then someone pops up and says something to that effect and chaos ensues.
I just dont get why ?
Theres something called freedom. If something is useful for developers, they like it and they use it, and they think good of it, they pay it respect. If something does not catch their attention, or they think its not to their liking, they just ignore it.
I just dont get why are we being pressured to look into matters java, javascript. If they are respect-worthy, they will earn the respect by themselves good enough. If not, noone can make developers to respect something by propaganda or by coercion.
Read radical news here
JavaScript/ECMAScript really is an interesting language; the way objects work takes some getting used to, but it's powerful, and definitely definitely not a toy language. It's when you bring the HTML DOM and browser inconsistencies into the equation that things start to get painful.
JavaScript is an absolutely great language marred by the fact that people can't distinguish a language from its library. When most people say "JavaScript sucks!" they are really saying "DHTML/the DOM object model/HTML/CSS sucks!".
What I don't get is why developers use PHP, which looks like it was thrown up after a frat party. JavaScript would fill the bill as a decent language with a C-based syntax much better.
... it's not because you have to use it, that it makes it a good language.
Only reason people are using it, is because it's the only thing that let you manipulate a web page and will work more or less for 99% of the people out on the internet. Would all browsers ship with only COBOL people would be using it. Would I have the coice between JS and let's say Python or Ruby, I wouldn't even have a look at it.
javascript is too hard to unittest but most of that has to do with the web browser container . javascript is a victim of its environment.
My wish for web 3.0 is that Javascript is replaced entirely. The ONLY thing that Javascript has going for it is ubiquity (which I guess is down to its ease of implementation). Its not all Javascripts fault, in general, as in most things webby I blame Microsoft, but hte language itself seems to make everything you write look lke a dogs dinner.
... end
Wouldn't the web be a nicer place if you could script the browser using Ruby or Python? Can you imagine the fun you could have working with constructs like:
@page.findById( "myID" ).each do |ajaxReturn|
The web could be beautiful. Next on my hit list is an improved HTML / CSS. Should rounding corners, or drawing shapes / shadows really be done with gif/pngs?
Scared of flying, pointy things snce 1979!
Oh, bullshit.
No obfuscation will make it very different from what it is. A code indenter, a variable name replacement, and it'll be already understandable to pretty much any programmer.
Respect is earned, not given. As far as I'm concerned, AJAX has given JavaScript a new lease of life. Without it, there would be no Gmail, no Google Maps, or at least not in the way we've come to admire them. When you see the fantastic stuff Google (and Windows Live for that matter) produce, XMLHTTP was the catalyst that made that possible, but all the donkey work is done by JavaScript.
Thus I have a lot of respect for it as a client scripting language, in most cases it's the only way of getting something done in a browser.
I used to hang out on the , and questions about encrypting Java bytecode came up with surprising regularity. The number of people who simply didn't understand that what they wanted - to make it impossible to decompile the bytecode back to Java source - was impossible was quite staggering. All sorts of plausible-sounding solutions were mooted, but they are all ultimately worthless. As long as I control the hardware, there's nothing you can do to prevent me from seeing data processed by it, all you can do is try to make it difficult.
It's official. Most of you are morons.
In this case it was easy enough to do, which meant we were providing the reports that senior management needed right away, giving us time to relax and build a proper & full scale SQL replacement.
It strains credibility to claim that, after producing something functional, management would give you the time to replace it with something such that, "the recipients never knew when we migrated from the stop-gap to the final".
And I don't mean that as a typical geek management-slam - If they can't tell the difference, why should they approve the team spending twice as long on the cleanup as on the prototype? Yeah, the engineers might know the difference, but the aesthetics of the underlying code rarely counts as making for a better a business case.
Cut the guy some slack.
Only because Sun trademarked "Applet" it doesn't mean they invented it, or that they own it.
An applet is a small app. More often, it's a web, client side app. Much more often, it's a "Sun Java Applet".
In the context of this discussion, the second meaning was obvious. All of your responses were too pedant. There _are_ applets that are not "Sun Java Applets". In the context of _this_ discussion, it was clear what he was talking about.
It helps to actually preview your posts. Here's the fixed version: Javascript has some amazingly powerful functional features that make it rival some of the great languages. That said, it is hampered by a lack of true object orientation. There are syntactic hacks that allow you to *fake* private methods/properties and inheritance, but they are not really features of the language.
It strikes me, however, that one of the best scripting languages out there, python, took a similar path. Once python had no object orientation, and people faked it with syntactic hacks. Then the syntax changed slightly and it was slowly added over the years, even as compatibility was kept with previous versions.
Javascript could take such a route. It's not a bad languages; it could get better.
"Times have not become more violent. They have just become more televised."
-Marilyn Manson
I said, "As a language". Javascript's standard library is small, but the functionality the language itself supports is quite advanced. Closures, prototyping, mutable objects, and consistent OO (i.e. everything is an object), make Javascript rather flexible; just look at the additions Prototype has added in.
Javascript has no threads, the lack of thread control structure therefore doesn't matter much.Ah, you're quite correct; Javascript is singled threaded. However, considering the amount of asynchronous callbacks from setTimeout, setInterval and XMLHttpRequest, one has to wonder whether the very lack of threading could not be construed as a disadvantage on its own. Since each Javascript function is axiomic, one would have to split up complex functionality to run across several functions.
I strongly disagree: Javascript has no standard library.What do you mean by "Javascript"? Are you referring to the ECMAScript dialect (which, so far as I'm aware, does have a standard library), or are you using "Javascript" to mean "Any ECMAScript browser implementation" (in which case you are technically correct)?
Regardless, the standard libraries of JScript and Javascript overlap considerably, so although you can point out, quite correctly, that ECMAScript does not define a standard library per se (so far as I am aware), from a practical standpoint the major browsers have a number of EMCAScript objects in common, which mounts to the same thing as a standard library in practise.
I have a hard time understanding why I hear so many people complaining about JS as a language. I think a lot of Java programmers don't like it because it's not Java (not strongly typed, ...), and a lot of C++ programmers don't like it because it's not C++.
The truth is that you can do some pretty amazing stuff with JavaScript. My favorite demo is here. It's a web-based calculator, and if your browser has MathML set up correctly, it'll display your equation on the fly, as you type it, in standard math notation. For instance, if you type 1/(2+pi), it displays a fraction bar, with 1 on top, and 2+pi on the bottom (pi rendered as a Greek letter). (I think recent versions of Firefox have MathML and its fonts set up correctly by default, but if not, you can download the necessary fonts (instructions). For IE, you need to install MathPlayer.) What I think this calculator app demonstrates pretty dramatically is how powerful a development platform the web browser can be, without messing with the ugliness of AJAX at all. WYSIWYG mathematics typesetting is the kind of application that people used to pay $100 for ca. 1995, and now it's not only free, it's open-source, and it's an app that you can just run in your browser, without having to install anything.
Find free books.
From what I've seen, 25, 000 lines of javascript has only one linefeed :-)
Apocalypse Cancelled, Sorry, No Ticket Refunds
I have one word for all of you: "prototype.js" ( http://prototype.conio.net/ ). The day I discovered prototype.js I stopped hating javascript. It also made me appretiate the really cool ways javascript lets you do inheritance etc + reading the prototype.js code really gets you learning.
If you also use Firebug (make sure you get the latest beta) for debugging then programming web and javascript becomes fun!
With prototype.js the javascript code becomes probably 30-70% smaller. No self respecting javascript programmer should be without prototype.js. It rocks!
In C++, string + int doesn't concatenate the int onto the string. If you're lucky it's an error. If you're not lucky, it converts the int into a character and appends that character. If it's a string literal rather than a std::string, even worse. Reusing << would have been a better choice than + in C++.
Which doesn't solve the grandparent's problem, because it doesn't remove the functionality from +