Hacker News new | past | comments | ask | show | jobs | submit login

It gets flak for the same reason php gets flak.

They both more or less accidentally became popular. None of them were very well designed. They both lacked type safety.

Unlike php though javascript became not only popular but it actually ended up being the only alternative.




It's jealousy.

Most languages had major design flaws. Rubyists will gladly complain about how OO is bolted on in Python, Python users will gladly talk about how slow Ruby's interpreter was and how god awfully complex the syntax is. Both of them have limitations in their runtimes and are actually catching up to JS in some areas (see Python's adoption of async).

We can talk about how baroque CL is or how much Java sucked in 1995, how massively complex C++ is, etc, etc. Those arguments have been made for decades, though. JS is no worse than most languages in various ways, but people are pissed off because their chosen language isn't as popular.

Maybe that's a cynical point of view, but these criticisms never get past the most superficial concerns, so it's not obvious why people really care so much.


JavaScript and PHP are badly/barely designed languages, period; no amount of excuses and comparisons is going to change the fact. Anyone with a bit of experience in either Ruby or Python will tear their hair out when doing JS, because they know it doesn't have to be that difficult. These days it's looking more and more like C++ every day...


This is of course my personal opinion, but I think you're suffering from exactly what OP mentions. I'm not trying to be conflictive or anything, but this is in my experience the same argument that every language evangelist uses.

I started with C in my early teens (first book I found, lucky me) and I've gone through the VB, PHP, Java, Python, Ruby, and Javascript phases. Honestly I've seen great engineering in all those languages (maybe not VB) and those projects have all been easy and pleasurable to work with (maybe not Java). I've also seen hideous stuff that's a total sanity destroyer. At least for me the main contributing factor to language dislike is dealing with shitty code. Except Classic ASP... That stuff is poison.


I code in Ruby everyday and I think JS is a far superior language. Javascript has closures, modules and hoisting that complies and stores functions and variables before executing.

In Ruby code starts executing before everything is initialized making it unpredictable. Also JS is just so much smoother is composable. It's far superior to RUBY IMO


I don't think they accidentally became popular.

The features which make a language rise rapidly might just be different to the features that make a language "good".

PHP in particular is amazing for getting started at speed. I remember taking a HTML file and popping in a couple of lines of PHP in the middle. I still haven't found anything anywhere near that easy for making a server backed website.


You aren't the first person to think of this. It is otherwise known as Worse is Better[1]. Stuff that doesn't have all of that nice formalism but lets you get simple applications working without a lot of up-front training and boilerplate tends to be what people gravitate towards instead of "properly designed" languages.

[1] https://en.wikipedia.org/wiki/Worse_is_better


For very limited tasks that PHP is still oddly popular for: NGINX's Server Side Includes module. ;)

If that's already your web server, anyway.


I want my programming language to be predictable and easy to use. I'll "well design" my code, thats what I get paid to do. Type safety, yeah, never bothered me much anyway.

I agree, it sucks that js the only alternative in some cases. But hey, imagine if Java was the only alternative!




Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: