User: Password:
|
|
Subscribe / Log in / New account

Reitter: Answering the question: "How do I develop an app for GNOME?"

Reitter: Answering the question: "How do I develop an app for GNOME?"

Posted Feb 6, 2013 13:49 UTC (Wed) by sorpigal (subscriber, #36106)
In reply to: Reitter: Answering the question: "How do I develop an app for GNOME?" by khim
Parent article: Reitter: Answering the question: "How do I develop an app for GNOME?"

You may not like JavaScript, and it certainly has some issues, but comparing it to PHP is totally uncalled for. JS has a spec, well defined behavior, fairly consistent behavior and a fairly small set of gotchas. PHP is far, FAR worse

# php
function foo(){
return array('a', 'b');
}

print foo()[0]; // SYNTAX ERROR. Intermediate variable required.

// JS:
function foo(){
return ['a', 'b'];
}
alert(foo()[0]); // Of course this works!

The difference in levels of crazy is impossible to under-emphasize!

There are a lot worse languages than JS. PHP is inescapably broken and thoroughly unsalvageable without creating what is effectively a brand new language. All JS needs is typing, a package or module system, and maybe some improvements to its standard library. Its other flaws are no more serious than those of pick-your-favorite-language.

The main issue with JS is that for a long time serious programmers ignored it and as a result it was only used by the ignorant and the short sighted. The second worst problem with JS is the DOM, which really has nothing to do with it. The third is that a lack of packages has made large and inter-connected JS code pointlessly painful. I fail to see what of any of this is as intractable as PHP's broken type system, broken object system, broken parser, etc., etc..

So, please, bash JS all you like, but don't be vulgar and bring PHP in to it.


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds