DEV Community

Discussion on: Tell me an unpopular software opinion

Collapse
 
daniel13rady profile image
Daniel Brady

JavaScript is well-designed: most of us simply don't use it effectively and too frequently blame the tool for our problems.

Collapse
 
somedood profile image
Basti Ortiz

It honestly irks me a lot how people cite the infamous 0.1 + 0.2 floating point arithmetic error as a justification to ostracize JavaScript (even though most programming languages suffer from this issue as well by virtue of floating point limitations).

Like, seriously? Are tiny nuances really that evil so as to dismiss the programming language altogether? No, right? Python suffers from the same error, but is nonetheless one of the most loved languages out there.

You are definitely correct about people not using it effectively. When people write arguments against the languages, it's always because they don't use it right, as in non-"Pythonic" code for Python.

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt

No, I would cite -- github.com/aemkei/jsfuck

Most importantly, [1, 2] + [3, 4] that I learnt from Python. I know that there is .concat() and spread operator, but still...

Another thing is var hoisting, but it can be made understand, really.

Thread Thread
 
ashoutinthevoid profile image
Full Name • Edited

I hope I'm misunderstanding, but this style of example "learnt from Python" always puzzles me. Specifically, why do devs expect things to work the way they do in some other language, rather than learning the constructs in the language theyre presently working in?

Thread Thread
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

I do suppose that the language should be failsafe. Even TypeScript doesn't warn., nor throws an error. Even Python is safer. TypeScript is partly safer, and some part more dangerous than Python, due to JavaScript-based.

RTFM, partly, is OK. But reading the whole EMCA specification is crazy.

Also, I cannot expect tutorials to teach everything.

I also expect the language to be "guessable" rather than being told to do so. Otherwise, throw an error early.

Productivity doesn't wait for you to finish learning...

But knowing additional paradigms might be helpful. Knowledge should add-on rather than replace.

Still, end-in-end, I love JavaScript (not even saying TS), more than Python.

Collapse
 
_hs_ profile image
HS

Although it was designed in 10 days (in a way) it is quite simple and good enough I would agree. I just would never use it for backend as I prefer type safety and having some thread control. Dynamic typing and such things could be "shoot yourself in the foot" for some devs and then they blame the tool.

Collapse
 
antonmelnyk profile image
Anton Melnyk

Agree, JS is a simple, productive and elegant language with a great ecosystem.

Collapse
 
jsbeaulieu profile image
Jean-Sébastien Beaulieu

I was following you until "great ecosystem". The whole node_modules thing is mostly a house of cards waiting for the right gust of wind to make everything fall apart, and most of the tooling is mostly over-engineered reinventions of existing tools.

But I really like using the language. It's fun to write in.

Collapse
 
aumayeung profile image
John Au-Yeung

I think this is true after ES6 when JavaScript has all the syntactic sugar that other languages like Ruby has.

Also whoever designed it actually thought about what they're changing before actually making the changes.

Collapse
 
lukewestby profile image
Luke Westby • Edited

IMO the premise that most users don't use it effectively disproves the assertion that it is well-designed. To me, a language that is well-designed is easy to use effectively by default, and so most people would. I like JavaScript because the platform runs in so many places and there are so many different things I can do with it. This is ultimately not a consequence of good language design, though.

Collapse
 
daniel13rady profile image
Daniel Brady

I like JavaScript because the platform runs in so many places and there are so many different things I can do with it. This is ultimately not a consequence of good language design, though.

I would amend that it to "popularity and versatility are not necessarily a consequence of good language design." 👍

To me, a language that is well-designed is easy to use effectively by default, and so most people would.

I suppose we should come up with a definition of "effective use" for this discussion before we dive too far and realize we're not talking about the same things. 🤓

When it comes to effective use, programming languages are quite similar to natural languages: it's all about communication. How well can you say the right thing?

One of the key differences between natural language and programming language, though, involves the audience: natural languages meant to be read by humans, but programming languages are are meant to be read by humans and computers.

So effective use of JavaScript is a question of how well you can balance what you say, such that it is right (for some, and possibly different, definitions of 'right') for both the readers of your code and the machine that eventually executes it.

To be able to find this balance, and communicate effectively with JavaScript, you need to understand the impact saying certain things in certain ways has on both humans and machines.

Language design definitely influences how challenging this process is, and there are some features of JavaScript (some present in the original design, some recent additions of ES6) that make this process harder than it needs to be, but not enough to make me feel it deserves the amount of flak it receives from our community.