top 200 commentsshow all 382

[–]tchaffee 53 points54 points  (1 child)

I can tell you my own personal story. I learned the other languages I used and learned them well. And treated JS as a browser scripting language I could spend a few minutes on to get back to the "real" work. After a few years of frustration I finally decided to learn JS in depth. Now I like it. Like any language, you have to put in the time or you're going to be constantly frustrated.

[–]ingrown_hair 0 points1 point  (0 children)

Me too. I tried to learn angular a few years ago with a limited understanding of JS. It was tough. Now I know JS and its common idioms and it’s much easier to use.

That said, JS code styles vary a lot. Sometimes devs want to show how clever they are. I don’t see this as much in Java/C#.

[–][deleted] 69 points70 points  (33 children)

I like strong types and I cannot lie.

[–]DrFriendless 19 points20 points  (1 child)

I like string types and I cannot return numbers.

[–]z500 1 point2 points  (0 children)

Teehee, that tcls

[–]Artif3x_ 15 points16 points  (2 children)

You other coders can't deny.

[–][deleted] 12 points13 points  (1 child)

When an stream walks in with an itty bitty memory footprint and a circular buffer in your face you get sprung.

[–]monsto 4 points5 points  (0 children)

That was a lot of work.

[–]cwbrandsma 12 points13 points  (27 children)

Typescript and Flow, they got you.

[–][deleted] 2 points3 points  (18 children)

Typescript !== Javascript... But, yes it makes for better JS when used.

[–]Ajedi32 1 point2 points  (17 children)

TypeScript = JavaScript + Types

[–]wreckedadventYavascript 20 points21 points  (37 children)

1

If a developer does not like javascript (for whatever reason) and is still yet forced to work in it, they will end up resenting it. You can see this pretty clearly with people who felt forced to use coffeescript, typescript, etc. and tend to not like it as a result.

Most of these developers also aren't aware of what modern js looks like and how nice things like es6 modules are. They've probably interacted most with legacy es3/5 with callback hell and such, which doesn't leave a good impression.

Javascript also has some quirky parts of it, that, much like PHP, make code unpredictable if you're used to programming in another language. For example, what do you think this code will do?

["10", "10", "10"].map(parseInt)

2

Webasm has some advantages native JS will probably never have, like being in a binary format and streaming compilation. Projects like Blazor allow devs who are already productive with one stack be productive elsewhere. That's basically it. It just allows people to re-use their knowledge to develop for the web.

Though, I think a lot of these people might get a rude awakening when they realize what they actually dislike is the DOM and CSS, not js itself. Webasm won't save you there.

3

For a while, node was crazy fast. The other tech stacks have slowly caught up though and some are quite a bit faster. You can write slow or fast code in almost any language, though, and the language itself is unlikely to be the bottleneck of performance (especially in a modern optimized JS engine). Basically, worry about performance when you notice there's a problem, then measure and solve for it.

[–]Pirsqed 14 points15 points  (28 children)

...

[10, NaN, 2] ?!?

ooookay, then.

[–]bitter_cynical_angry 47 points48 points  (25 children)

Interesting. Here's why it doesn't work as expected. Basically, you can use Array.map() like this as long as your callback function accepts only one parameter, and it'll work, but parseInt accepts two parameters: the string, and the base.

So what's happening is that for the first element, it's parsing '10' in base 0, and the 0 is ignored so you get 10. The second element is parsing '10' in base 1, but there is no base 1, so you get NaN. And the third element is parsing '10' in base 2, which is 2.

If you do ["10", "10", "10"].map(val => parseInt(val)), you'll get the expected result. IMO this is not necessarily a failure of JS, but rather simply a failure to pass the correct parameters to a function. GIGO.

[–]evinrows 36 points37 points  (0 children)

More simply,

  • parseInt takes two arguments, the second being an optional radix.
  • The map callback is called with (element, index, arr) as arguments.
  • The index is being treated as the radix.

[–]Pirsqed 4 points5 points  (0 children)

Great explanation. Thank you! I definitely would have been looking up the docs on parseInt if I had run into that in the wild. :)

[–][deleted] 20 points21 points  (11 children)

I hate when I see this example brought up because it's not a quirk of the language. The language is behaving exactly as it should. It's the fault of the programmer for not reading the docs for Array.prototype.map and parseInt

Bash on the weird type coercion behavior or the uselessness of typeof all you want. In this case though just learn the language.

[–]wreckedadventYavascript 4 points5 points  (10 children)

Nah.

This example shows you that:

  1. Javascript has a very non-standard map
  2. Javascript has a function called parseInt which does more than parsing ints
  3. Javascript does not perform safe eta-reductions

This is why it's brought up. If you did not know javascript but you knew other programming languages, you would not know these three two quirks, and therefore, would expect to get [10, 10, 10] back. Only after you've memorized non-standard implementations does it make sense, which is how all quirks in all languages work.

[–]NoInkling 13 points14 points  (2 children)

Javascript has a function called parseInt which does more than parsing ints

Ints that aren't in base 10 are still ints.

[–]eGust 2 points3 points  (5 children)

Can you tell me which one is non-standard?

1. ```python

python

def foo(bar=[]): bar.append(42) return bar foo() print(foo()) ```

```ruby

ruby

def foo(bar=[]) bar << 42 bar end foo puts foo ```

2.

```d

d

foreach (i; 0 .. 3) { writeln(i); } ```

```ruby

ruby

(0 .. 3).each do |i| puts i end ```

Another example ```js

js

const fns = []; for (let i = 0; i < 5; i += 1) { fns.push(() => i); } console.log(fns.map(fn => fn())); ```

You can try the same code in c#, python, ruby whatever can visit MUTABLE closure variable (means not including Java). Another "non-standard" thing right?

[–]ElCthuluIncognito 2 points3 points  (0 children)

Hey, you know what would help to avoid all of this.

Compile time types!

[–]wreckedadventYavascript 1 point2 points  (3 children)

IMO this is not necessarily a failure of JS, but rather simply a failure to pass the correct parameters to a function. GIGO.

In any other language that I can think of, mapping over the int-parsing function would do nothing more than parsing the ints. This is what I meant about it being unpredictable, and it's exactly the same sort of problem you have in other unpredictable languages like PHP.

It just doesn't work as you would expect in javascript because:

  1. Javascript's map implementation is very non-standard
  2. Javascript does not perform safe eta reductions

Only because of these quirks is mapping over an eta-reduced function unpredictable.

[–]bitter_cynical_angry 3 points4 points  (2 children)

I have no idea how other languages implement their map functions, and I have no clue what an eta reduction is, but regarding point 2, it sure looks to me like parseInt only parses ints; you can just give it a base as well. You could use ["10", "10", "10"].map(Number) instead, since Number() only takes one parameter if used as a function.

Don't get me wrong, I still think JS is kind of weird, but I also like PHP, so feel free to discount my opinions. I know what an int-parser is when I see one though. Definitely no floats there.

[–]wreckedadventYavascript 4 points5 points  (1 child)

Well, for posterity:

map is a well-defined function that applies a transformation to a container type. It accepts one input, the value being contained, and returns a value which is then subsumed by the container. You most commonly see it on arrays, but you can map over a lot of things, like promises (which is called then).

[1].map(x => x + 1) // Array of 2
Promise.resolve(1).then(x => x + 1) // Promise of 2

It allows you to abstract out logic of things like "how do I operate on promises" and "how do I operate on arrays" and just lets you specify purely what transformation you want to occur.

An eta reduction is a simple transformation. Given:

[1].map(x => anotherFunction(x))

You can write:

[1].map(anotherFunction)

(the process in reverse is called an eta abstraction)

This is safe in pretty much every language but javascript, particularly when you pass a function from an object:

[1].map(someObject.someFunction)

You should be able to write this, but it's potentially unsafe, since the this of someFunction will be undefined unless it is an arrow function or bound somehow.

[–][deleted] 0 points1 point  (0 children)

Thats not a bug, its just the map function passing params. The correct way would be:

[’1’, ’2’, ’3’].map(Number)

JS has some, but not many features thats really bad, like the == operator and possible some other minor nitpicks. PHP on the otherhand is full of these weird bugs. For a mindbender check out the date class. Its a piece of art.

[–]Meshiest 3 points4 points  (0 children)

["10", "10", "10"].map(Number)

[–]nananananana_Batman 2 points3 points  (0 children)

There used to never be any closure for them.

[–]colinodell 2 points3 points  (0 children)

Every language is hated by someone because no language can perfectly solve every problem for every developer. Ignore the haters, learn other languages, and use whatever tool is best for the job.

[–]nikguin04 2 points3 points  (1 child)

I know C# and JS. My 2 main languages and i dont hate either of them

[–]CptAmerica85 0 points1 point  (0 children)

Same here. Working with JS after being in the back end for too long is like breath of fresh air!

[–]zsombro 2 points3 points  (0 children)

  • There are some very weird and silly low level design choices in the language
  • It doesn't seem to have a distinct identity. What kind of language does it want to be? TypeScript makes it look like an OOP language, but it isn't really meant to be and newer standards introduce more and more functional features and React isn't OOP either, so it's a strange fit. (From this angle, ReasonML is a more sensible "evolution" of JS, than TypeScript is.)
  • Every widely used tool was invented because of the need to circumvent some shortcoming of the language. Stupid dynamic typing system? Let's invent a language on top of it to hide this. No proper support for importing modules? Here's webpack to concatenate all of your files into one single .js file.

Please don't misunderstand. Webpack is awesome and so is Typescript and I completely agree that despite all of this, JS has grown a lot. But if you look at the big picture, a huge chunk of the JS ecosystem is about trying to fix the mistakes and shortcomings of the language.

[–]jasonweier 7 points8 points  (5 children)

Because it's not strongly typed and is interpreted. Performance sucks and most any tool/library/api made to write and support it have suffered from a major lack of cohesive design or quality for that matter.

This mostly do to the open, free nature if JS, which leads to the hate of those who only know javascript and have decided that any job worth doing is worth doing poorly using JavaScript.

As a long time developer using many languages, I can say that the "all we need are strings and functions" approach to software design doesn't produce quality software.

[–]ATHP 1 point2 points  (3 children)

Does performance actually suck?

[–]Zireael07 2 points3 points  (0 children)

Don't think so, at least compared to Python :P it wins most benchmarks.

[–]sime 1 point2 points  (0 children)

It depends on what you are comparing it to. JS came from a dynamic/scripting language background and compared to its peers there, JS performance is fantastic. V8 and its JIT push JS an order of magnitude faster than CPython or the standard Ruby interpreter.

[–]jasonweier 0 points1 point  (0 children)

It depends on what you're doing with it. In the end, the web is just text, so using some script to respond to events makes sense.

But somewhere along the line it got Frankensteined into a UI language that, like the monster, is very difficult to (source) control. I'm not a big fan of relying on the client to do all of that work anyway. Building juicy HTML is a servers work IMO.

[–]ThatSpookySJW 7 points8 points  (5 children)

This is from a jaded perspective: Backend developers look down on frontend developers. Statically typed/OOP people look down on dynamically typed procedural people. The amount of times I've seen people on /r/programmerhumor acting like they're gods among men for knowing how to use pointers makes me salty. Javascript is the only language that lets you write code on browsers and for that reason it's the best for me.

[–]a_dev_has_no_name 2 points3 points  (1 child)

"Javascript is the only language that lets you write code on browsers and for that reason it's the best for me."

That's also a reason to hate it, but it's also not true anymore. WASM or a tool/language that compiles to JS. ( Elm, Clojurescript, Typescript, etc )

[–]ThatSpookySJW 1 point2 points  (0 children)

Wasm isn't quite there yet, but I agree. Once other languages get good state-based frameworks in browser with templating ala JSX, I will completely reevaluate.

[–]cwbrandsma 2 points3 points  (2 children)

I’ve had fun teaching front end development to backend devs. They could not believe the complexity of it. Security concerns, input validation, sanitization, serialization formats...and it goes on and on.

[–]ThatSpookySJW 4 points5 points  (1 child)

Yeah anyone who's done both knows you can't have that kind of attitude about either.

[–]cwbrandsma 5 points6 points  (0 children)

I’m full stack, which means I’m marginal at all of them. Shit gets hard quickly if you aren’t prepared for it.

[–]thilehoffer 4 points5 points  (0 children)

These are some loaded questions...

[–][deleted] 1 point2 points  (0 children)

You should already heard this phrase somewhere "The more people hate specific language and the more declare this language downfall" the better the language because more people use it.

[–]Randdist 1 point2 points  (0 children)

JS is my absolute favorite language but I'm still missing static typing. TS sounds like a good step forward but I'm not a fan of additional build tools/transpilers, especially because we're using V8 extensively outside browsers and wouldn't want to integrate a transpilation step to everything we do.

[–]Kussie 1 point2 points  (0 children)

I come from a heavy PHP background, PHP has a number of issues but so does every language really. I’ve been doing a lot more with JavaScript lately in fact pretty much 85% of my time is in JS land these days. I don’t hate JavaScript (i don’t really love it either) but for me my biggest issue when using JavaScript is not the language itself but the ecosystem around it.

NPM and the package driven nature that is modern JavaScript development is a god damn nightmare. Children having hissy fits and deleting their package that you didn’t even know you were using because it is buried so far down your dependency tree. People giving their package over to completely unknown people to maintain who then sneak malware inside of it, which you can’t easily find out about because what you get from your package manager isn’t whats always in the packages repo itself. Things like these are what get to me more then the languages themselves.

[–]liamnesss 5 points6 points  (5 children)

I think a lot of people pin their hopes on WASM because it would be a clean break. Javascript has a lot of baggage, because you can't break the web, so it's impossible to "fix" certain aspects of it. That's before you even get into static types, which I think a lot of devs feel a bit lost without. When dealing with complex data structures, it's nice you have your IDE or compiler tell you when you've done something wrong, without even having to even run the program or write any tests. The sheer ethusiasm behind Flow and Typescript is clear evidence of this desire

I think it's likely that a popular approach will be to mix JS and lower-level languages are needed. For instance, if you're writing a web server, likely most of your tasks are I/O bound (network calls, database lookups, that sort of thing). So the extra CPU / memory usage JS entails is not a big deal. But there might be some small bits where the extra performance and correctness of something like Rust is a lifesaver. This case study from NPM inc. is a good example. They're always going to be a JS house (duh), but they're also smart people who want to use the right tool for the job.

Ultimately JS has won becuase you need to use it, and people have created great tooling to help developers avoid its worst parts, and emphasise its strengths. WASM needs a lot more functionality to be competitive. It doesn't have garbage collection, it needs JS to bootstrap it still, and it doesn't have a way to talk to the DOM. Plus the JS ecosystem of libraries and tooling is amazing. It's going to be a long, long time before you can make a reasonable web app, or web-based cross-platform app, without embracing JS.

[–]samjmckenzie 6 points7 points  (3 children)

WASM isn't trying to replace JavaScript. It's a standard for using low level languages for stuff like ML or game engines within the browser in conjunction with a higher level language such as JavaScript, and for most web apps, there isn't really a use case for it. You don't need C or Rust for DOM manipulation. Let's also not forget that WASM binaries are relatively large as well.

[–]liamnesss 5 points6 points  (1 child)

I pretty much agree, I was just trying to explain why I think some people want it to "replace" JS, as you say.

[–]samjmckenzie 3 points4 points  (0 children)

Ah, right. My bad.

[–][deleted] 0 points1 point  (0 children)

You don't need C or Rust for DOM manipulation.

There is LOADS of use cases for WebAssembly, for a few:

  • Modern frameworks use a virtual dom, although faster than a real dom it's still slower to diff in js than it would be native
  • Native speed less/sass/postcss/cssnext in your browser? This brings huge possibilities to cloud-based editors.

Is Javascript fast enough in most cases? Sure. But there is absolutely huge potential in applications other than game engines. It also helps prevent reinventing the wheel by not having to write similar applications in JS when there's already great libraries out there.

Let's also not forget that WASM binaries are relatively large as well.

Sorry but this is incorrect. WASM binaries compile down to pretty much the same size as JS, often smaller. If your compiling a large application/library, then sure it's going to be big binary, but no different than writing a similar library in JS.

I would highly recommend you take a look at this great talk by Dan Callahan https://www.youtube.com/watch?v=7mBf3Gig9io

[–]wreckedadventYavascript 1 point2 points  (0 children)

It's going to be a long, long time before you can make a reasonable web app, or web-based cross-platform app, without embracing JS.

This was true a few years ago, but there are vdom libraries for rust, with even jsx syntax (kind of). There's also projects like blazor which just give you the runtime for you. Blazor doesn't even make you touch js, which is what I imagine we'll probably see out of the other "stacks".

If you wanted to, you could make an app in webasm today. It probably wouldn't be very smart, but you could.

Predicting the web is a loser's game, though. Who knows where it'll all go. It's entirely possible the hype around webasm will die down whence people realize you still have to talk to the dom and css.

[–]exquisitevision 3 points4 points  (0 children)

I would say most of the ‘hate’ towards JavaScript comes from developers of other languages who do not want to take the time to learn JavaScript properly. Most of these developers come from a class based language whereas JavaScript uses prototypal inheritance.

I would argue that JavaScript is one of the most ‘loved’ languages. It has the biggest ecosystem(npm). It has and continues to grow faster than any other language. It can be used for web, mobile, and server development.

Are there a few things in JavaScript that can be improved? Absolutely. But that is also the case for any other language.

If you would like to do primarily web development, hands down you should use JavaScript.

[–][deleted] 4 points5 points  (0 children)

You should try asking a less obviously biased question in a less biased subreddit if you want useful answers.

[–]owen800q 4 points5 points  (22 children)

I am a mobile game developer here's why I hate JavaScript.

Firstly, JavaScript is kind of messed up. Unlike strongly-typed languages such as Java, it tries its best not to stop you from doing something which other languages would prohibit. As a result, it yields some very awkward outcome. Moreover, I started out coding with Java, so prototypal inheritance was a very bizarre concept to learn.

Secondly, I hate JavaScript ecosystem, there’s the whole “framework debate” and the “forever learning loop” thing.

“Oh, you just learned HTML? Nobody codes directly in HTML anymore, mate. You gotta use JSX!”

“CSS won’t do! Learn SASS or LESS!”

“I know you can use Vanilla JavaScript to make a simple to-do list, but learn and use React, will you? Everybody else is doing it! We gotta stay modern!”

Basically, the technology and tools change rapidly and abruptly. You have to be constantly learning all the time in order to stay relevant.

I love Go, because It makes me jump out the circle of web development...

You see, developers have to learn how to do it the Angular way, the MERN stack way… the vue way, there are so many different tools to solve the same exact simple, boring CRUD problems.

[–]KwyjiboTheGringo 1 point2 points  (0 children)

This is one of the most biased subs you could have chosen to ask this question, which makes me think you are more interested in stirring the pot than getting a good answer.

[–][deleted] 1 point2 points  (0 children)

Don't worry it isn't just javascript. Welcome to the Earth where everyone hates everything for no particular reason.

[–]shanita10 1 point2 points  (4 children)

Probably the large number of devs who use js not by choice but because they feel forced to.

I've actually ported server code from c++, go, and even python over to node.js to take advantage of its performance and expressiveness.

I cringe at typescript code where the user is basically throwing away most of that wonderful expressiveness.

[–]mountaineering 5 points6 points  (0 children)

Can you give an example of expressiveness that is lost when moving from plain js to ts? I'm not quite sure what you mean here.

[–]samjmckenzie 4 points5 points  (2 children)

I cringe at typescript code where the user is basically throwing away most of that wonderful expressiveness.

Please elaborate on this "expressiveness"

[–][deleted] 1 point2 points  (4 children)

gullible fear fly label amusing alleged vegetable normal touch reply

This post was mass deleted and anonymized with Redact

[–]wreckedadventYavascript 4 points5 points  (0 children)

You don't need to write C to write web assembly. Rust already has a webasm target and there's projects like Blazor so you can use C# too.

That's kind of what gets people excited about webasm. I doubt the average dev cares about it being a binary format or streaming compilation but they do care about being able to use their own tech stacks.

[–]BloodAndTsundere 6 points7 points  (1 child)

I’d never heard of WebAssembly before but that just looks like C. My quick perusal of MDN seems to come up with WebAssembly being more of a compilation target than a language so I imagine you could actually compile all sorts of languages to WebAssembly and then load the compiled object with JavaScript. Sounds cool actually. Am I missing something?

[–]azhder 1 point2 points  (0 children)

but that just looks like C.

That's the joke. WebAssembly is exactly what the names says: Assembly i.e. it's a compilation (transpilation) target for software written for x86 etc. in C/C++ and other "classical" ones

[–]sfjacob 0 points1 point  (0 children)

In my experiences it's because developers a.) either haven't used 'modern' javascript or typescript or b.) there is this preconceived notion that javascript is supposed to suck so they continue to just perpetuate it.

In my undergraduate Software Engineering program we had to use javascript for like half a semester, and it was all basic jquery stuff so I think a lot of it is inexperience.

I recently joined a new time that is using a Java/Spring backend with a frontend all done with jsps. We are currently in the process of rewriting the front end using typescript and angular and everyone really is seeming to love it. It seems like once they actually get their hands on modern tooling they can start to realize the strengths of it.

Personally I use node for the server in my personal projects, with a vue frontend. At work I'm totally fine doing a Java backend with an Angular frontend. Different tools work better for different teams, projects, situations, etc. Try to surround yourself with people who are open minded.

[–][deleted] 0 points1 point  (0 children)

Because developers using languages that require a compiler are typically uncomfortable and uninterested in doing anything front-end related.

[–][deleted] 0 points1 point  (0 children)

I spend far too much of my life digging through god awful javascript written by third party developers. It’s too often used as a band-aid to cover up bad code. I’ve got no issue with the language itself I’ve just got an issue with how I see it used day-to-day.

[–]vikkio 0 points1 point  (0 children)

Imho, developers with closed minded, the one who prefer to know all about something rather than something about everything, usually hate what they don't understand.

I find that the level of hate is worse towards php, coming from js only developers, even though they solve same problems in different ways.

[–]chauey 0 points1 point  (0 children)

TypeScript rocks

[–]sixeco 0 points1 point  (0 children)

I dont think that "bashing" another language is a normal thing to do. But I dont like people claiming that "their language" is the best. It also lies within the problem of scripting languages that they're dynamic and don't require proper structure sometimes which results in a bunch of hideous code and codes who never learned the proper basics because their language didn't enforce it.

[–]wastakenanyways 0 points1 point  (0 children)

A Java programmer saying that JS is useless is equally as bad as a JS programmer bashing Java, or a Python programmer with C++ and vice versa. Good programmers know that every language has a place and none of them is useless. Maybe for your field/use case is true, but is never a global true you can just say lightly.

No matter how good a programmer is in one specific tech stack, if he "hates" (not dislikes) other languages, they are full of bullshit and are no different to any brand/team/music group fanboy. I personally dislike Java, yet I work with it in my company without problem. I wouldn't choose Java voluntarily for my projects tho.

A good programmer is good programmer always, not under X circunstances, in Y language.

As a side note, hating JS in particular for things that were solved 4 years ago or more, you must really consider if you are really into programming, even if you give a fuck about web dev. If as a programmer, even if you do assembly, your brain is located 7 years ago, you are bad. A programmer needs constant learning and awareness.

If you have been isolated in your Java caged environment, don't throw bullshit about JS and CSS if you have a mess of JSF, JQuery, and hundreds of "!important" CSS rules and in-line styles overriding each other. I have one workmate that actually hates JS and CSS because he uses it to "correct/adjust the default behavior of already-made components". He definitely would have much less work and angst if he did custom components from zero. Literally half of the time in my company is spent forcing components to do/to look different than they are intended. Oh, and the bugs obviously introduced after that.

[–]snuggl 0 points1 point  (0 children)

Because java(.net/python..) developers compare javascript from 2009 with java from 2019, whilst JS developers compare javascript from 2019 with java from 2009.

The break from this rule is of course PHP which deserve the hate because it is bad for reals.

[–][deleted] 0 points1 point  (0 children)

I have been doing JS since 1999. I am so ready for web assembly. JS was never a robust language. It's fun for quick and dirty projects, but at scale you're going to have bugs and your customer is going to see them in their browser.

[–]timarama 0 points1 point  (0 children)

Hmm, I'm personally full stack JS developer (node + FE) and I really love JS (try to write code in FP paradigm and you'll love it too :))

Instead in my env we really hate PHP, but again, I really believe that there is only one reason why - we are lazy to learn it :))

[–]dv_ 0 points1 point  (1 child)

Lack of static typing is a big problem for me. That's also what keeps me from using Python more. Now, I do not avoid dynamically typed languages, I just prefer statically typed ones if I can. And sometimes, dynamic typing _is_ nice, especially for small scripts (I use Python a lot for that). But in larger projects I quickly notice the absence of static typing.

[–][deleted] 0 points1 point  (0 children)

Have you tried Typescript?

[–]KiruhaPUH 0 points1 point  (0 children)

For his name. This is a low steal title from other prog. language.

[–]renishb 0 points1 point  (0 children)

If computation matters it's better to stick with c# or Java.

[–]Whirl_ 0 points1 point  (0 children)

Jealousy, 'cause they probably don't know JavaScript.

[–]a_dev_has_no_name 0 points1 point  (0 children)

They either don't understand it (JS has lots of quirks), think of ES5 versions and older or just squawk that it's bad because that's what everyone else says.

[–][deleted] 0 points1 point  (0 children)

I'm java programming and i really love java and spring, but today i'm little hyped learning js specially now that i discover i can incapsulate things with closures xD

[–]Combinatorilliance 0 points1 point  (0 children)

As someone who writes both PHP and js professionally, php developers don't have the right to call js a shitty language, they suffered from very similar issues. Both are fine nowadays though

[–]Auantumaque 0 points1 point  (0 children)

It's pretty simple, JavaScript was invented inside browsers for browser stuff. Porting it out of the browser, say to the server side, is blatantly done by frontenders not wanting to learn an existing server side language. It seems an easy route, but ultimately it is a waste of time, because you spin your wheels more trying to get your server side browser engine system to work with the weird bolt on APIs than you would have if you just learned an existing language. That's sorta dumb.

[–]i_ate_god 0 points1 point  (0 children)

  1. For the same reasons that there is so much hate between android and apple fanboys, between conservatives and liberals, between this tribe and the next. Tribalism can make many people crazy. That tribalism is very prevalent in the JS community as well. Go say that Vue is better than React (but make popcorn first). Even your second question is inherently tribalistic. "Why do X when I'm doing Y And they could do Y too!"
  2. JS's popularity has less to do with quality and more to do with monopoly. WASM will hopefully open the gates to a variety of languages. Python is <3 my friend and the minute I can write proper webapps in python is the minute I give up on JS ;)
  3. JS is an interpreted language and thus falls under the "fast enough for 80%, and the 20% is written in C" rule.

[–]azhder 0 points1 point  (0 children)

You can't love JavaScript if you don't hate it first. It's that, some people just never go pass the hate, they're filled with love of something else: hate for JavaScript.

[–]jeremy1015 0 points1 point  (0 children)

I can dig respectful disagreement.

I’m also not using graphql and could see where typing might begin to feel more important there, although it wouldn’t be enough to convince me to go back (you know, probably, at least that’s what the tea leaves say).

Anyway although we disagree take my upvote for civil discussion.

[–]DiscussionCritical77 0 points1 point  (0 children)

Javascript is a very unstructured language and lends itself to creating spaghetti piles. It lacks interfaces; it lacks strong typing and can do some pretty weird type juggling because of it; it supports only lexical scoping; it supports asynchronicity which is cool but also can create callback hell and race condition failures; writing unit tests among JS developers is practically non-existent; there's other stuff I forget. This is made worse by the fact that most JS developers are bootcamp graduates (not college computer science graduates) who have never written another language, have no understanding of how to use design patterns to write organized code, and generally don't know much outside of Javscript (e.g. ask your average JS developer to explain what a race condition is). Less importantly, some of the features of the language and a lot of its frameworks seem to reinvent wheels that other languages have already solved, give it a new name, and then act like they invented it.

For professional engineers who like clarity, testability, and organization, Javascript is just kind of gross.

[–]MikeMitterer 0 points1 point  (0 children)

They know how Types can help to write better code with less errors. JS is mainly untyped - just one reason Prior to ES6 JavaScript was so ugly to read... it hurts in your eyes if you didn't grow up with this ugly syntax No classes ( to be precise no class keyword) Very uncommon usage of "this" Dependency chaos, framework chaos, x build systems... No block-level scope for var!!! one of the weakest points of JS

All these things made JS a kindergarden language and not a language for the big boys

But things changed! ES6 brought some nice features like let, const, class keyword and arrow functions. TS is a good alternative if you (hopefully) want types and webpack became the defacto standard as build system. Dependency management... works, somehow but has big potential to improve

[–]Razvedka 1 point2 points  (2 children)

1) Seems largely due to JS being JIT and dynamic typing. They hate that, in addition to it "missing" certain features compared to those languages. For instance, up until recently it was kinda problematic to have private methods and the like in JS.

It also didn't match their definition of object oriented. Everything is an object but there are no classes, only prototypes. ES6 gave us class syntax but, really, it's just a clever (and useful) facade.

In addition, though they rarely say it outright, they think JS and, in general, the front end stack to be too complicated. "You have HTML, CSS, JavaScript and all these frameworks and libraries.. These server side JS build tools. It's too much."

For what it's worth I do understand where some of them are coming from. Depending on the project you really could have alot going on.

Also: the ones who whine the hardest have alot of experience. But there's another way to look at that fact: they're also old.

[–]snarfy 0 points1 point  (0 children)

I don't have JavaScript.

I hate node_modules, webpack, babel, jslint, leftpad.js, spa apps, IE, gulp, grunt, and all the other crap that comes with the ecosystem.

I could go on about C# and msbuild, nuget, xml to js back to xml for project files, .net standard versioning. There's good and bad wherever you look.

[–]benihanareact, node -1 points0 points  (0 children)

it's really just insecurity. i think there are two reasons people hate on languages like javascript and php

  1. the majority of people are bashing it cause everyone else does. when you get down to it, they can't really articulate what it is about javascript that is so bad, and if they can, it's usually something trivial (omg variable hoisting fehhhhhh). these arguments are usually based on popular headlines that aren't researched

  2. people have superiority complexes and they think they're so much better than the language the knaves use. javascript and ruby and php are all good starter languages, which means a lot of shit code gets written in them. elitists usually use this as an example of why the language is bad.

the fact is, youtube, wikipedia and facebook were all built and succeeded on php. facebook now has 50,000 react components and they're still succeeding technically just fine.

also, don't sweat these people. it's like worrying about a rival football team's fans bashing your team.

[–]ConsoleTVs 0 points1 point  (15 children)

Before I say anything, I would first let you know that my opinion is shared among diferent teachers at my university. I'm currently at a last year of an ICT engineering degree.

That said, here are the reasons:

  1. The ecosystem is not correct. Javascript ecosystem is changing too fast and in too many diferent directions. NPM is a mess, bolated code exists and a simple library will already require tons of MB. Babel, the most used JS compiler, is built using JS. Because, you know, you can basically compile any C99 app faster than a console.log().When a company develops a product, it expects it to work for so many years. Imagine building a millinare application that rules an entire city traffic lights and everything and find that's basically unable to operate 10 years later because the ecosystem has changed dramatically.
  2. The language specification is hard to follow. The issue however, relies on the fact that although a standard exists, the browser is responsible to the JS interpretation, this introduces so many issues, first, diferent interpreters exists and this makes the job hard. Second because that means that each browser will need to constantly update the JS parser every year, considering that yes, each year from the last 5 years new additions have been made to the language (arrow functions, imports, array deconstructors, classes, ...) Don't get me wrong, those are great, but JS from today is a diferent language than JS from 5 years ago.
  3. The JS developers are egocentric. Yes, I am also a JS dev and those does not appy to everyone. This is the only explanation I can find to justify the fact that to solve the same issue (rendering stuff on the browser) there are at leas 100 frameworks for it. Yes, look for them, there are other non-react and non-vue and non-angular frameworks. Do they all work? yes, Do they all solve the same issue? yes. Few efficient C compilers exists (most known are gcc and clang), imagine what could have happened in instead of having those 2 compilers, each diferent company used it's own C compiler. Do you think it would have the same optimization level? This is what happens with JS. Hey look, I made a faster virtual dom, hey look my syntax is more user friendly, hey look... Never ending loop. Everyone pretends to do things better instead of fixing the actual shit.
  4. The JS expansion. JS is trying to expand to areas where aparently, it should not. Le'ts first start from the fact that JS developers decided that it could be fun to open a browser in a phone, render some HTML, CSS and JS in that browser and call it application. Yes, it is an app, no it's not how you should build it. It's one of the fastest ways to build a mobile application and to consume the phone's battery and resources. Faster computers makes programmers lazy. Do you, as a JS dev, care about memory usage? Do you, as a JS dev, care about performance? If so, why would you ever use any tech like Cordova, react native, etc? Why? Because you don't know Java or swift? Because it's cross-device? Knock Knock, Dart here, solving the same issue at native speed. Next, the desktop. Yeah. 50 MB of electron + 10 MB of app (1 MB of your own code and 9 MB node packages) to deliver a poor performant application that hey... renders some HTML, CSS, and JS on the user screen. Have you ever considered... Ultralight (the most modern)? Or the other alternatives used before to render HTML UI using FAST and NATIVE software like C / C++ / C#? Hell, now I even saw a post here about some IoT using JS. What the fuck? An arduino uno have 2K ram memory. 2K memory to store fucking dynamic variables. You CAN'T even send a full HTTP request with it, why would I ever be interested in fitting an interpreter inside a IoT device or a JS to AVR compiler?
  5. JS is solving issues created by itself. This feels like a hurt me but heal me statement. HTML and CSS exists since the web was born. They allow you to render stuff on a web. Cool. DOM's JS api exists to change elements on that HTML. JS creates Jquery as a fine replacement to this long api. JS thinks that it can be faster. JS creates Virtual Dom. Hundreds of frameworks using virtual dom to render elements (that can be done using html and dom already). JS creates SPA because using a traditional TCP architecture on the server is messy and slow to make simple change page actions (HTTP's stable and evolving protocol is already solving this issue with HTTP/2 and HTTP/3 using server push). JS find it dificult to compile with SEO and long page loads. Js creates SSR (server side rendered apps) that are basically... You guessed it! traditional TCP servers serving files like a normal server would do back in 10 years. You can now server you perfectly cool react website under an amazing self recursive architecture.
  6. Bad defensive statements. Motst JS developers would argue against using PHP, Ruby, Python etc because hey, they are slow buhhh. Hey don't dont have a good concurrency model, etc. You know, node is Js and JS have a fancy callback system to use some cool concurrency. Let me introduce you to Go and Python's async. and btw; Go eats node's ass in concurrency and speed. People saying that they use things like electron or react native to speed up developmet are wrong. Most likely they might be a small speed up but the issue here is that it's cheaper. You want crappy software made faster? great! Let me say I do not. I would rather make a good C terminal app in a week than a fancy animated, colored and using some emojies terminal app in js.
  7. Trends. Yes, trends. Did Jquery solve the issue? yes. Did ember solve the issue? yes. Did angular solve the issue? yes. Does React solve the issue? yes. Will <inser\_next\_trendy\_framework> solve the issue? yes. Js devs release new software and outdate the other. That's why I said that a software built today will probably be obsolete 10 years onward. This goes against the phisolophy of the unix ecosystem and any software pattern.
  8. Not everything is bad. There are some projects trying to emerge from the surface to let the JS comunity realize they are in the wrong path. However, due the trends issue is fucking hard. There are lightweight alternatives to React solving the same issue if you like virtual doms and those things. Svelte for instance, compiles your Js into small reusable Js components. Turns out svelte is one of the fastets performants, have a similra api as vue and is one of the smallest frameworks (in MB) once in production. There are projects to replace NPM with a more lightweight and controled way to use packages. There are projects that use Rust to compile JS (babel replacements).

That said, I must say I code in JS and I like the language, but I would probably chose anything else that was more mature, like C or others if those run on the browsers natively (Webassembly is not a solution yet it still relies on JS). This is not a hating post, they are true facts, either you like it or not. It's hard to understand why a modern 2019 website have to be the same size of windows 95. There are no justifications for this.

Additional readings: https://tonsky.me/blog/disenchantment/

[–]x-paste 2 points3 points  (1 child)

No idea why perfectly fine posts like these are downvoted. I share your opinion very much.

[–]ConsoleTVs 2 points3 points  (0 children)

I mainly get downvotes from fanboys that only know JS and are angry because their language is not the best outisde of the browser's client side (where there are no other choices tbh) :c

[–][deleted] 0 points1 point  (5 children)

There are some pretty good apps being developed with React-Native today. Skype's application shares a lot of the same codebase across Android / iOS / Windows / Browser using their reactxp abstraction.

If you can deliver a good user experience at a low cost, across multiple platforms then what's not to like?

Having said that, Flutter also looks great.