Hi guys. I'm just curious, I don't have much experience with JavaScript, other than going through basic tutorials, but the general consensus seems to be that people hate it, why is that?
If you're wanting to do scripting in the browser, JavaScript is the best choice and the worst choice at the same time…because it's the only choice :D
The three pillars of the web platform are HTML, CSS, and JS, so when programmers who are used to other programming languages are forced to use JavaScript they get annoyed when it doesn't behave the way their preferred language works. Sometimes the design decisions of JavaScript itself seem a little confusing, and sometimes the way browsers implement support for JavaScript features can leave your head scratching.
Don't worry about people disliking JavaScript, it's easy to learn, a ton of fun, and it turns the browser into a playground full of new possibilities!
I've found that, very broadly, people from a backend or traditional compsci background are most likely to hate js; and people who are from a web background less likely to hate it.
The compsci people tend to bemoan the lack of strict typing; or the general quirkyness of JS; or various other complaints that largely boil down to the lack of a compiler; or the lack of a standard lib. Or to put it another way - JS doesn't comply with the way they were trained to write "good code" at university. It feels fundamentally wrong to them.
I think people from the web side are more willing to accept js on its own terms. After all if you want to write a script that runs in a browser, js is literally the only choice. So you can get busy crying or you can get busy coding ;) (yes WASM will eventually change that, but not for a while yet)
In reality, in 2017 you don't have to write JS if you don't want to. For a start, if you don't want to be a frontend dev don't get a job as a frontend dev..! But even if you have to produce client-side code, there are languages that transpile to JS; or addons like Flow and Typescript that can add strong types to JavaScript.
They hate JavaScript because they ain't JavaScript Developers.
I could only remember 'The Interview' movie dialog, "They hate us because they ain't us!"
It depends totally upon what you want to become, is important, but not what others say to climb up horse backend.
I'm not sure that I agree with the "general consensus" thing; I've found plenty of people who seem to love JS and many who hate other languages. Frankly, I think most languages with any age are hated by many. We all know PHP gets a lot of crap, C gets bashed for being old and "unintuitive", C++ gets bashed for being a big mess, C# gets bashed for being too "Microsofty"/corporate, JavaScript gets bashed as you said.. The list goes on...
The key thing is to pick a language that meets these three requirements for you and you only:
Don't worry about why people hate xyz language... It's not worth it.
I personally don't like JS that much for these reasons:
None of these things are really "JavaScript's fault" as a language. I just don't have enough personal drive to deal with the complexities of the "ecosystem."
Really, it's a personal choice. Again, find what you like and learn it. What I will say though is don't be one of those people who just only ever uses JS and sticks to it like it's some gospel. Try other types of programming out, be open-minded. Then you will find out how much you really like JS in the grand scheme of things.
Addendum: I want to bring up one more thing that I think may irritate some people about the "JS World" right now. There seems to be this strange notion that "everything can and should be programmed in JS!" "JS can do all omg!"
I think many software engineers frown on the JS community for this and I equally think it's silly. Lack of desire to learn other programming languages, corporate laziness, and etc is not something to brag about. Also, software engineering and computer science encompass something deeper than the language; it's the concepts that make an engineer an engineer and so when people marry their tools, I find that to be disappointing. For example, using JavaScript to write native desktop applications IMO is utterly insane.
We have languages out which have been traditionally used and offer far more control over that type of environment for the past 40-60 years now. There's absolutely no reason to force framework on top of framework on top of runtime on top of runtime to be able to write native applications in JavaScript just because you don't want to learn another language or port something over. Application performance and overall quality suffers from this mentality. Does this mean I hate React Native or Electron and think they are completely useless? No. But if you're going to be developing anything significant, there are better options which will produce better quality applications. Anyone who wants to argue this, go compare the performances and system resource usages of Notepad++ or Vim and Atom. It's like watching Michael Jordan play basketball with a dog. I've had people in the JS community argue with me about how stuff like React Native and Electron is as good for native development as C or C++ and it's just plain wrong. I hate to break it, but I think some of these "cultural" or political things affect peoples views of the actual language at times.
Now let's talk about good JS stuff. Hashnode is an example of an awesome site written with JS. In fact, I spend a ton of time in my browser and I have the utmost respect and appreciation for JS work, trust me. One of my favorite web projects is godbolt... Check it out. It's a web gcc C/C++/Rust more compiler which compiles your code instantly with whatever compiler options you want and shows you line-for-line the assembly language generated by the compiler... All in the browser... Pretty awesome JS app!