4 ms·
I argue that the reason it's used outside browsers is primarily that a generation of programmers learned it first - IN a browser. As a language, it has more wa
by kpil 10y ago
I argue that the reason it's used outside browsers is primarily that a generation of programmers learned it first - IN a browser.
As a language, it has more warts and less features than many other languages, but it also is unimposing and does not get in your way.
It could have been much better though.
- z3t4 10y agoMicrosoft tried to make vbScript an alternative to JavaScript. vbScript is a good language, but JavaScript is better. For example, how to make a custom object in vbScript: Class foo Private barval Public Property Get bar() bar = barval End Property Public Property Let bar(b) barval = b End Property Private Sub Class_Initialize( ) barval = 1 End Sub End Class To make an object in JavaScript: foo = {bar: 1}; Before NodeJS existed, most people, including myself thought that JavaScript is a stupid language only used in browsers. I was also aware of NodeJS for at least two years before I finally tried it. I thought it was stupid why the hell would you want to code JavaScript outside the browser I thought. After maybe one year of learning, walking through the swamps, I finally saw the light. The most revolutionary I think is the module system in NodeJS, it's what makes writing huge programs in JavaScript manageable. Because of this many JavaScript programs now a days comes with thousands LOC tested and hardened in production, while the actual code you write and maintain yourself is only like one hundred LOC. I think the NodeJS module system is maybe hundred years ahead of its time, it's right in front of us, but few people seem to notice. And in the direction we are heading now it will soon be forgotten (ES6 import). People use NodeJS modules like imports and couples the code instead of decouple. Sure it works fine for a while, but sooner or later the project will grind to an halt because of code complexity.