5 ms·
Is it just me or has JS programming in pure Node become too complex? And, frustratingly, the line where Node ends and frameworks begin are too blurry. This is
by kumarvvr 6y ago
Is it just me or has JS programming in pure Node become too complex?
And, frustratingly, the line where Node ends and frameworks begin are too blurry. This is made worse by the fact that thousands of bloggers have a node server tutorial, essentially drowning out the good ones.
- BillinghamJ 6y agoNo? Can you provide examples? On a fundamental level, Node is effectively exactly the same as it was in the v4 days etc. I also don't see how it could be possible to find the line between Node itself and frameworks ambiguous - unless the framework itself is invoking your JS files, in which case I would recommend moving to something lighter (i.e. something more designed for composition - where you call it, rather than it calling you)
- bstar77 6y agoMaybe he means that frameworks like Express have become more modular over time, which might confuse people where that line between node and framework functionality is.
- BillinghamJ 6y agoExpress really exemplifies the "composition over heavy framework" concept though - you never really hand over any control to it
- bstar77 6y agoAgreed. I've really come to love Express and the direction its gone after years of using Rails- which eventually left feeling like a prisoner to its opinionated nature.
- throw51319 6y agoI don't get Node JS. It seems like you just need to somehow know the function for a specific version of it, and stuff changes all the time. And there's not really a good auto-suggestion. You need to know the args, and it just seems "hacky". Like it's good to write something small when you know what functions you use etc... but just not stable for big stuff.
- enoughalready 6y agoThat's more of a JS issue than Node issue. The problem you are describing is one of 10 years ago, but not so much today, so long as you have a decent IDE. Intellij is the best IDE out there for autocompletion/intellisense of JS.
- g5becks 6y agoI can’t really agree with this, especially not since the advent of typescript. There’s not a dynamic language in existence with better tooling than JavaScript. You open up a js file in vscode or webstorm or whatever, and the typescript language server kicks in so you get type hints for all your code. If you switch to typescript it’s a whole other level of type safety. Also, it seems like your comment could be generalized to include all dynamic language runtimes, not just Nodejs.
- throw51319 6y agoYeah i guess. I don't really know that much about it anyway. I like Java, the IDE is so rich for it. Just makes writing so easy.
- BillinghamJ 6y agoThat's not even remotely true. Node's core library stability is exemplary - it is near-impossible to make breaking changes to it, even across many major versions. You can set up most IDEs to get excellent auto completion - VS Code does a good job of that kind of thing.
- tannhaeuser 6y agoNode.js still implements CommonJS callback-style APIs (for web, file i/o etc) and module loading, specified in 2009 or so. "Stuff changing all the time" really isn't doing justice to Node.js. IMO, the Node.js API turned out to be very much on the stable side of things, yet also sports eg upcoming QUIC support
- gosukiwi 6y ago> And there's not really a good auto-suggestion. You need to know the args IDEs do spoil people.
- austincheney 6y agoI don't use frameworks so there is no such blur for me. I also don't find Node any more complex now than it used to be even though there are more features and APIs. I just stick to the original callback style of writing code, stay true to Node's APIs, and use TypeScript. The most challenging thing for me in Node right now it upgrading an application with my HTTP services to use HTTP 2 with binary streams.
- mpfundstein 6y agowhy would one stick with callbacks? i understand why people might skip promises... but async/await????
- austincheney 6y agoLogically its all the same at execution time, but with callbacks the control flow is more clear to read for me.
- Scarbutt 6y agoFor another perspective, I skip async/await and prefer promises ;)
- mpfundstein 6y agoi like promises too and was one of the most vocal supporters. but they are alien to a lot of people. at least that's what I experienced so far :( async/await just feels right at home for everyone
- city41 6y agoThe trouble with async/await is to use it properly you really need to understand promises. For example, many people are stumped why you can't await inside of Array#map. I've always felt it's a leaky abstraction and I personally prefer to just use promises most of the time. I do find async/await a great fit for say puppeteer tests where the entire test is a long run of blocking async calls.
- deleted 6y ago[deleted]
- specialist 6y agoI will always cherish the 2 years I spent doing nodejs work. I gleaned a new appreciation for stuff I've hated for a long time. npm helped me realize that maven is merely bad, no unforgivable. For instance. I still can't believe the nodejs universe doesn't have back pressure (eg caolan/async) baked into the stack. Those were some pretty difficult conversations. My teammates had no idea what I was talking about or why my fixes worked. Absolute paths for importing modules (requires) still makes me laugh. But criticizing nodejs, js, etc is rather pointless. Like PHP, it's fractally wrong.