Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JavaScript's design is clearly much more coherent than PHP's. Whereas PHP's developers have added features haphazardly over several years, the JavaScript language hasn't changed much since its initial design in 1995. Warts aside, having a (barely) complete initial design that was done by one person over a short time and has since been mostly left alone is an advantage. And JavaScript is flexible enough that library and framework developers have been able to explore several different approaches while the language remains frozen. Therefore, it's quite misguided to lump JavaScript in with PHP in terms of language design.

It's certainly not accurate to categorize JS as a functional language, but it is flexible enough that one can program in a more or less functional style; and unlike PHP, it always has been.

Also, I've read several of your anti-JS diatribes, and I feel compelled to ask this: What drives you to denigrate JavaScript, and programmers who willingly choose to use it, wherever you can? Do you feel the need to show your superiority by bashing the languages that many programmers use to produce useful applications despite their lack of expertise? Can we not accept that all mainstream languages have warts, and that in many cases, practicality may dictate that we use a language that doesn't please us aesthetically but is nevertheless useful?



A bad programming language that remains bad for nearly two decades isn't really any better, in my opinion, than a bad language that undergoes some change that may have mixed results in the end.

JavaScript is bad. PHP is bad. They're both bad in many of the same ways, and they're bad in different ways. None of this changes the inherent fact that they're both bad programming languages.

Of course all programming languages have "warts". Very few, however, have as many horrible and inexcusable "warts" as JavaScript and PHP do.

As an industry and as a community, we can do better than JavaScript and PHP. In fact, we have already done better in the past (sometimes many years ago), many times over.

So, yes, I will speak out against programming languages that are inherently broken and inferior, and even extremely harmful, whenever I get the chance. It's the right thing to do.

This is not about my ego, or about my "superiority", or about me at all. This is about doing things properly, as an industry and as an entire community of programmers and software developers. JavaScript and PHP are very clearly not acceptable programming languages to use, even if a lot of people make the mistake of doing so.


I take issue with your recurring assertion that JavaScript is bad. Not just that it isn't to your liking, but that it's objectively bad, something that the software development community ought to avoid. JavaScript's bad parts have been discussed to death, so I won't rehash them; it's enough to point out that programmers can easily get used to avoiding or working around them. What's more important is that there are good things about JS which make it very desirable as a cross-platform, general-purpose programming language. Specifically:

1. JS is the native language of the Web platform. Because of its ubiquity, the likes of which Java, Flash, and Silverlight never achieved, the Web platform is an attractive deployment target for many apps.

2. Because of JS's role in the Web platform, it has the support of every major player in personal computing, specifically, Apple, Google, and Microsoft. Languages like Python, Ruby, and Lua have nowhere near that level of corporate backing.

3. Yet no single company owns JavaScript, so there is no patent trap as with Java or .NET. Nor is there any threat of vendor lock-in.

4. Because of the strong corporate backing and the fact that most Web browsers are now based on open-source engines, there are mature, open-source, non-copyleft implementations of JavaScript for all major desktop and mobile platforms. (The "non-copyleft" bit is in contrast with, say, Mono, whose license enables Xamarin to charge a premium for use in iOS, Android, and Mac apps.)

5. Because JavaScript is the native language of the Web platform, full-stack Web application developers basically know it to some extent, regardless of what language they prefer on the back-end. So many programmers know JavaScript, making it an attractive choice for a software company wanting to hire more programmers, or an open-source project looking for contributors.

6. Because of the competition among browser developers in recent years, all of the major JS implementations are now very fast.

7. Unlike C and C++, which are AFAIK the only languages that match or exceed JS's ubiquity, JS guarantees memory safety. This eliminate a whole class of bugs that many programmers are not equipped to deal with or prevent. These bugs often turn into security holes.

So these qualities, largely political and business-related but important nonetheless, make JS very attractive to anyone wanting to choose a mainstream, high-level, general-purpose programming language for cross-platform application development. In light of this, how can you say that JS is objectively bad?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: