Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 12, 2019 03:34 pm GMT

The Dark Side Of The Magic

DISCLAIMER: I know have a reputation for my strong dislike of Javascript, but I assure you, this post has nothing to do with that opinion. If you can code responsibly in JS, and it seems to you the best tool for the job, by all means use it. This post should not be taken to imply that "real programmers use X". Real programmers can use any language well, including JS.

I've been either an observer or participator in many conversations regarding Javascript, and I've noticed a common theme among the talking points of many of the language's fans: Javascript is malleable.

They often go on to point out all the "magical" things you can do in the language; how JS shape-shifts to fit whatever you're doing. For example, its (in)famously weak typing system is a favorite feature of its followers, while being a chief bone of contention among some of its detractors.

In pondering the praises sung of JS by bright-eyed young developers, many of the same who decry many other languages as "clunky," "too hard," and "sharp-edged," I've come to formulate an alarming theory:

Javascript's popularity may be, in large part, a function of endemic mental laziness, rather than of the language's efficacy and suitability.

Look at the other trends that have emerged in our global culture in the last five years:

  • Shortened attention-spans have given rise to TL;DR (too lazy; didn't read) whenever it takes more than five minutes to read an article.

  • Frameworks fall in and out of favor at a historic rate, at the same pace as teen fashion trends.

  • Basic human language skills, like spelling and grammar, have been eschewed by many who scoff at the necessity to communicate clearly to others (and then who often get angry when people don't understand them.)

  • An alarming number of young developers dismiss the relevance of learning algorithms altogether, as "the older generation of math nerds did that for us, so we don't have to." (I wish I weren't quoting an actual person.)

I've known college students (some of them my own classmates at the time) who would whine about having to spend 30 minutes on their homework. I knew one student who argued he should be allowed to copy answers out of the back of his algebra book because, and I quote, "the professor shouldn't expect me to take the time to learn this stuff."

I've interviewed candidates who bragged about their code only just being good enough to pass a college assignment, or who laughed off their failure to read the specification for a coding challenge as unimportant and irrelevant.

Understand, I'm only documenting the trends I've observed; I have no intent on sticking labels on any individuals. Whether these statements apply to you personally, you'll have to decide for yourself.

In short, there is a growing cultural trend towards a wholesale avoidance of anything that requires concerted, prolonged thought.

When viewing some of Javascript's purported chief selling points through this lens, it is easy to see that its popularity may in fact be because it spares the developer from feeling the immediate consequences of not thinking things through.

Mind you, those consequences still manifest themselves as logic bugs and performance problems, and no one can deny that modern apps and websites are rife with both problems. One might even argue that the quality of shipped software is at an all-time low.

I've noticed that a number of these developers who use JS in this manner rarely have more than a passing familiarity with other languages. They dismiss C++ as "too hard" and "legacy". They often have to seek out regular help debugging Python code they wrote with the same slipshod "anything goes" mentality, while dismissing the admonishments of experts to change their approach.

Far from the wild stories novices claim about the language, C++'s developers often produce code that is stable and performant, as the language's own touchy nature requires the programmer to exercise care and concerted thought. Yet we seldom feel like we're wasting our time because we know that the extra effort to produce working code also minimizes our debugging efforts later. We're probably not often going to be awake at 2 AM because "prod crashed".
you're not going to thrive in this field

P.S. This doesn't mean that C++ isn't without its flaws, and many languages exist that effectively resolve some these issues (such as D and Rust).

And while Python appears to be "magical" in its own right, experienced Python developers are among the strictest sticklers for pedantic technical accuracy alive, always pursuing the best possible solution, rather than the quickest.

Once again, none of this should be taken to imply that Real Programmers Use Butterflies. The problem isn't Javascript. It's the trend towards apathy that has bled into the world of programming, brought in largely by individuals who embraced cultural laziness, and now wish to use it to shortcut their way to a high-paying job.

These same individuals, I would argue, often wind up embracing Javascript not because it is suitable or well-designed, but because it panders to their resistance to putting forth meaningful mental effort.

Denizens of this crowd exist among the users of every language. They're usually the ones to avoid -Werror in C/C++, because "they can't get their code to compile." They're the ones who complain about linters and other static analyzers, because they "just fill the code with a bunch of red sqiggly lines." They're the ones who use double any time their value has a decimal point, instead of considering float, because they don't want to think of the actual needs of their data and calculations. I could go on.

If you're reading this and seeing a reflection of yourself in my warnings, I hope all this comes as a cold splash of reality for you. You can become a good programmer, but the road to get there is not by any means easy or level.

  • Bad code is bad code, whether it compiles or not.

  • You must learn algorithms, paradigms, and design patterns, no matter how "magical" your favorite language seems.

  • Just because high-level languages and tools abstract away the underlying computer logic, that does not excuse you from understanding said underlying logic.

A good programmer can write excellent code in any language, including Javascript, because he or she puts in the time, effort, and careful thought necessary. There is no shortcut.

If you're using Javascript (or even Python) just because of how easy the "magic" makes everything, maybe it's time you studied under a harsher master, like C, Haskell, or Rust. If that sounds like a waste of your time, then this field is not a good fit for you.

Original Link:

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To