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

Sure this car get dust on the ventilation, and you can mess up if you use the 3rd gear and you can't really use the blinkers without being careful and the seat warmers are wtf.

But in the end of the day, stick to this car long enough and it works for you.

Plus the most popular road of the world only accept this car so take it or leave.




I fail to get the flak that javascript faces ! Coming from java it was a breath of fresh air. This was the car that let me drive without a seatbelt when i wanted, let the doors be open if i wanted, stepping on the gas accelerated without fail and the brakes functioned fine, i could change the gearbox orientation, choose which side the steering wheel i wanted to be in general let me do what i wanted to without getting in my way. Sure it was not foolproof and i dont want it to be. I like JS just the way it is and I am grateful to it.


>I fail to get the flak that javascript faces !

I personally don't like that Javascript has had to have a ton of work done on it to get it to the point of other languages that were better at their first release. It was just a ton of time spent on something that was weak to begin with.

If Javascript were better at the beginning, and this same effort was spent on it, it probably would be ruling the world, front and back-end, and be a really good language with great tooling around it.

There was a great amount of debate about nulls being a billion dollar mistake, but Javascript probably beats it in monetary damages by far.


Something wasn’t done right, right off the bat, thats grounds for not liking it, sure. But to dismiss it as immature despite it overcoming most (not all) of those flaws seems unfair.

I like it, some dont. I get it. All I ask is to not dismiss it.

Folks new to programming find these edge cases as a reason to not learn it. That irks me.


It has not overcome any of the flaws, we have just learned to work around them. They are still there and can bite you.

Some of us value our time and would like to improve our discipline. In other fields it's called being professional. It's a shame we care so little about it.


You've got me thinking now. Can you/anyone give me 3 solid cases where the flaw was in javascript and not the programmers understanding of the language ? I can't. (Not at the moment at least). Most of the times I got things wrong it was my understanding of how js works that was at fault.


I understand that Javascript will silently do something stupid and keep going if I accidentally call a function with an argument left off, but I'd still prefer to get an error message.

I understand that I need to use === instead of == to check if two things are actually equal, but I don't like that either.

It's not that you can't understand how the language works, it's that the language does some things that feel stupid when you're coming to it from any other programming language. Even if I can work around all of them it doesn't feel like I should have to when we have a lot of better planned programming systems, and that makes trying to get into js feel frustrating.


Of course the flaw is always in the programmer's understanding. Langauges do not manipulate or lie to you, they are what they are.

However, better tools and languages reduce your cognitive burden. The less mental context you have to work with the more you can focus on the problem at hand. If you have to constantly worry about language edge cases and odd behavior, it really detracts from being able to focus on the problem you are trying to solve.

There is a reason languages like TypeScript and Flow exist, they are helping to reduce this large burden JavaScript carries with it.

JavaScript is really great for small scripts (which is the use case it was designed for).

Anything beyond a few hundred lines starts to carry a lot more cognitive load. Not to mention that we are now building full fledged applications with tens of thousands of lines in this language.


> Anything beyond a few hundred lines starts to carry a lot more cognitive load. Not to mention that we are now building full fledged applications with tens of thousands of lines in this language.

Depends really on how much care was put into the application structure, mostly from the outset.

I've followed opinionated styleguides closely on some projects, and have also walked into other swamp projects that snowballed into something massive from a few snippets of jQuery. The difference between working on something that was intended to be maintainable from the start and something that evolved haphazardly is of course like night and day.

I still think it's more the people and approach than the tools.


> Anything beyond a few hundred lines starts to carry a lot more cognitive load. Not to mention that we are now building full fledged applications with tens of thousands of lines in this language.

Agree completely.


>Can you/anyone give me 3 solid cases where the flaw was in javascript and not the programmers understanding of the language ? I can't.

These were problems in various stages of JS's history, but not necessarily now:

Browser differences in javascript by not having a good specification or strong governing body.

Not having block-level scope despite convention in other C-like languages.

Optional semi-colons.

typeof inconsistencies.

Another problem with JS changing so much is developers picking up the language at various points in that development.


> Browser differences in javascript by not having a good specification or strong governing body.

Its the browser implementation that was at fault. The ambiguity in specs was and is minimal to negligible for the past 8 years (since I started following). But like you said, not relevant today.

> Not having block-level scope despite convention in other C-like languages. > Optional semi-colons.

Its a feature, not a bug!

> typeof inconsistencies.

Maybe. Never faced it.

> Another problem with JS changing so much is developers picking up the language at various points in that development.

What I see constantly changing is JS frameworks and preprocessors, not the language itself. Newer folks tend to learn some JS framework first before the language itself (just like I did) and the constant change can hurt and impede progress and confidence. The language itself has been well documented and forgiving in my experience.

So yeah, point taken. You do not like JS. I do. Let's make peace with that.


"it probably would be ruling the world, front and back-end"

So, what would be different about that? JavaScript does rule the world, front (definitely) and back-end (arguably, but there aren't a lot of contenders for the language that's more popular for new projects).


JS is nowhere near "ruling" the backend. That's just ridiculous.


What language(s) do you believe is more popular and with more lines of new code being written for it?


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!


That says more about Java than Script though, and I've done enough of that to feel your pain. Coming from plenty of experience with sane dynamic languages (Common Lisp/Smalltalk/Clojure/Julia), it looks exactly like the madness it is. It's a difference in perspective, that's all. It's not about foolproof, it's about having any kind of intellectual integrity at all.


Not everybody can afford a Tesla or a BMW.

For some of us, A Toyota Corolla or a Honda Accord is more than capable of getting the job done.


Hey, Toyota and Honda are good quality cars, did you mean chevrolet, ford or renault?


Hey, I own a Fiesta SE and ST and they are great. Ford quality is way up.. Actually, maybe that's a perfect analogy for javascript :)


That's because they're designed in Germany now.


I've owned two generations of the Chevy Malibu. I'm pretty sure that's what he meant.




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

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

Search: