Latest news about Bitcoin and all cryptocurrencies. Your daily crypto news habit.
The biggest myth is that JavaScript is special or unique in terms of flexibility, expressiveness, and capabilities because of:
- dynamic typing
- lambdas
- object prototypes
- asynchronous programming
But guess what? Itâs not unique at all!
Python, Ruby, Perl, PHP, Clojure, and Smalltalk are all dynamically typed.
Java, Python, C++, C#, Ruby, Perl, PHP, Scala, Clojure, and Smalltalk all support lambdas.
Maple, Self, Lua, REBOL, and Io all have object prototypes. Interestingly, other than JavaScript, nobody else gives a shit about prototypes. Class-based OOP remains, far and away, the most popular and widely used technique in the object space.
Asynchronous programming has been with us since the earliest days of computing. It can done in practically any language, including Java, Python, C#, and Smalltalk. Whatâs the big deal???
Anything you can do in JavaScript, I can do in Smalltalk, for example. If flexibility and expressiveness are the main reasons youâre using JavaScript, then youâre paying a high price for it because JavaScript is also an execrable language.
The second biggest myth is that you must use JavaScript for writing web browser applications because JavaScript is the only language native to the web browser. While this is technically true, you do have alternatives if youâre willing to accept transpiled languages. This means treating JavaScript as a kind of âassembly languageâ for the web.
This is no different from using a language like C or Go to compile into x86 assembly language.
Here is a short list of transpiled alternatives:
- Cheerp (C++)
- ClojureScript (Clojure)
- CoffeeScript
- Dart
- Elm
- GopherJS (Go)
- Haxe
- JSweet (Java)
- Kotlin
- Opal (Ruby)
- PharoJS (Pharo)
- Scala.js (Scala)
- Transcrypt (Python)
You have a cornucopia of choice, an embarrassment of riches.
The third biggest myth is that JavaScript is easy to learn. Sure, if you limit yourself to a small language subset, then any programming language is easy to learn. This applies to C++, C#, Scala, and Swift, as well.
However, JavaScript is a HUGE language with numerous dark corners and weird edge cases. Donât believe me? Look at ECMAScript 2017. Its language spec is over 885 pages long! This is getting into Tolstoyâs War and Peace territory.
Expect future versions of ECMAScript to be even bigger.
If you think JavaScript is easy to learn, then you are in for a rude surprise.
The fourth biggest myth is that JavaScript is the only language you can use for both front end and back end. Not if youâre willing to accept transpiled languages.
From the above list, the only languages that canât be used for front and back ends are CoffeeScript and Elm.
The fifth biggest myth is that JavaScript is used everywhere. However, JavaScript is primarily used for front-end web development. It has some traction server-side with Node, and desktop-side with Electron, and mobile-side with React Native (as well as Cordova/PhoneGap). But everywhere else, JavaScript barely enjoys any usage.
Itâs actually a similar story for languages like Python and Ruby. Both are quite versatile, but they really are best known for data science/machine learning and Rails, respectively. Python does well in the web space, too. But Python is hardly used for desktop and mobile.
Are front end, Node, Electron, and React Native everywhere? Talk about delusions!
What are the biggest myths about JavaScript? was originally published in Hacker Noon on Medium, where people are continuing the conversation by highlighting and responding to this story.
Disclaimer
The views and opinions expressed in this article are solely those of the authors and do not reflect the views of Bitcoin Insider. Every investment and trading move involves risk - this is especially true for cryptocurrencies given their volatility. We strongly advise our readers to conduct their own research when making a decision.