Linked by Kroc Camen on Sat 20th Dec 2008 17:54 UTC
General Development IBM delves into what's new in PHP 5.3: Part-1 shows you the changes to the object-orientated capabilities, and Part-2 shows you the exciting new possibilities with real closures and lambda functions. ["Read more" for Kroc's personal commentary]
E-mail Print r 4   · Read More · 41 Comment(s)
Thread beginning with comment 341054
To read all comments associated with this story, please click here.
Javascript's terrible lack of rigour??
by rycamor on Mon 22nd Dec 2008 16:06 UTC
rycamor
Member since:
2005-07-18

Kroc,

While I concur with most of your analysis of (and love/hate relationship with) PHP, I am a little surprised that you would compare PHP to "Javascript's terrible lack of rigour and overal hackish nature".

I don't see a Javascript as being hacked together in that way at all. Rather, the progress of Javascript seems much more formalized and thoughtful than in most other scripting languages out there (there is actually a formal specification). Yes, Javascript is very simple, and doesn't attempt the sorts of things you find in big systems languages, but it is an elegant simplicity, with only a few truly ugly design choices that I can think of.

And the work going on to develop the next-generation Javascript looks *very* promising.

Reply Score: 1

sbergman27 Member since:
2005-07-24

I don't see a Javascript as being hacked together in that way at all. Rather, the progress of Javascript seems much more formalized and thoughtful than in most other scripting languages out there (there is actually a formal specification). Yes, Javascript is very simple, and doesn't attempt the sorts of things you find in big systems languages, but it is an elegant simplicity,

Javascript suffers a bit from premature standardization. Netscape had a browser war to fight. But you are correct. It was not just hacked together as a quick and dirty scripting language. Javascript is a widely misunderstood language. And one of the things that is most widely misunderstood is that it is most definitely *not* very simple. The reference I use is O'Reilly's "Javascript: The Definitive Guide" which weighs in at a thousand pages.

It has its bad points, like weak typing. (I should be very clear that I far prefer dynamic typing over static typing. But weak typing is just *too* error prone.) Rather bizarrely implemented weak typing, at that. 1 + "1" = "11"?

Javascript has also suffered from a combination of being given a name that makes it *sound* flimsy, and the fact that implementations up until the currently emerging crop of them has *actually been* flimsy. In addition, the way "web developers" pass around Javascript snippets in cookbook fashion hasn't helped its image, either.

But the language standard itself is solid. And that's good. Because we're all going to be using a lot more of it in the coming years.

Edited 2008-12-22 16:43 UTC

Reply Parent Score: 2

Kroc Member since:
2005-11-10

Javascript was invented almost in an evening by one Netscape engineer. It was a hack from the word go.

Not that it's a bad language - but don’t be fooled by the standardisation being done with ECMA Script.

The future of Javascript might look good, but it still has fundamental security flaws by design that will take eons to iron out.

Reply Parent Score: 1

Bill Shooter of Bul Member since:
2006-07-14

What are the fundamental security flaws?

Reply Parent Score: 1

rycamor Member since:
2005-07-18

Javascript was invented almost in an evening by one Netscape engineer. It was a hack from the word go.


I think you mean 'conceived of', and I suspect every actually usable programming language out there was conceived of by a single person on a particular evening. What Brendan Eich *wanted* to do was more along the lines of Lisp, but that wasn't politically acceptable, so yes it was a compromise of C-style syntax with functional/prototype capabilities. I think it was an inspired choice, compared to the meandering mess of most scripting languages.

Of course Javascript has security problems, but they will not take eons to iron out. Mainly, what's required is the ability to freeze the function/prototype relationship, (or classes, as will probably happen in Javascript 2). (It would also perhaps be appropriate to think about the fact that Javascript has had a completely different security problem to solve than most other languages)

It's not that I think Javascript is the best thing in the world, but it is a far cry from the slapped-together nature of PHP, and I think it has a more promising future.

Reply Parent Score: 1