3 ms·
Exactly my sentiments. The module system is definitely needed. For better or worse, npm's already become the defacto JavaScript package manager. It works auto
by akamaozu 11y ago
Exactly my sentiments.
The module system is definitely needed.
For better or worse, npm's already become the defacto JavaScript package manager. It works automatically with every environment outside the browser and we're fine using whatever module system that is compatible with it in the browser. (I use Browserify)
These tricks aren't really new. We had them in ES5. The syntax may be easier to parse for experts .. people with multiple languages under their belts ... but these changes aren't really newbie friendly.
Is the new syntax worth it?
- tracker1 11y agoWhat languages do you use that have not added features to the language for 20 years that you happen to use regularly?
- akamaozu 11y agoIt's not about refusing to use new language features. It's that these aren't new features; they're old features with new syntax. That's why Babel can transpile it. It's a case of old feature new syntax.
- iliaznk 11y agoExactly why I'm not taking any efforts to use Babel. I got no problems with .bind(this) and webpack. I don't need another task running just for some syntactic sugar.
- hoodoof 11y agoI'm a JavaScript newbie - the precise reason I choose ES2015 is because I am a newbie. A modern language has features that make things easier for newbies. Modern should equal sensible, not incomprehensible. Consider for example the module and import system - this dramatically reduces the complexity of the overall application and allows it to be structured in a modular and well organised manner. That makes things easier, not harder and more complex.
- akamaozu 11y agoYou're new to JavaScript, but you're not new to programming. That makes all the difference in the world. Would you recommend Haskell, Erlang or arguably Go to a newbie programmer? JavaScript has the benefit of being one of the most accessible languages these days, thanks to it being available in browsers. Some people's first glimpse of production code will be from view source. The myriad of "things a real language needs" is confusing and module systems neatly package up these crucial bits of technology. Module systems are accessible to experts. Why not put enhancements there, rather than bake them into the language with no way to retract them?
- angersock 11y agoAgain, I'll fall back on C here: C is a pretty simple and easy language, and before newbies were told that they were newbies and that C was hard a lot of useful program code got written by newbies. Javascript, let's pick ES5 because it's convenient, is a generally accessible language. Like, we've built the entire modern web with it and without more fancy things, and it's been great. Modern languages don't have things that make things easier for newbies--they have things that advanced users "think" they would've found useful earlier, they have things that advanced users who need speaking and conference gigs would prefer to have to present on, they have things that runtime writers would prefer to have for their microbenchmarks, and so forth. Don't think for a second that any language features added are done for the benefit of new users. Taking your module example: look, it's braindead simple (because it's a braindead implementation, honestly) to make an ordered list of modules and includes in JS. You learn the IIFE pattern, you order your script tags, and you're done. Once you have a little more genuine size in your app, you move to preprocessing your scripts, maybe just with make and cat--I've done this, it works fine. Only later do things get really complicated. The nutziness of the current environment is that the developers are truly so fucking lazy and shinyphilic that they can't take the damned time to learn the old ways--the simple, obvious ways!--and then use them. Slow is smooth, smooth is fast.