News for hackers. Stuff that matters.
Re:Node.js 5.0 Released by cdnsteve on Friday October 30, 2015 @09:41AM (#10477692)
I recently looked at using Node for a simple API backend. ES6 seems like it's not there yet, the stability of Node makes me wary. Constant changes seem exhausting to keep up with. For a simple microservice api you don't want to be upgrading it every 3 days. The continuous change doesn't make sense to me. Trying to get up to speed on all the Node.js ecosystem feels exhausting, only to have it change a few weeks later. Maybe someone using this daily for real APIs could comment if this is the case for them?

I ended up opting for Flask and Python 3x instead, couldn't be happier. I had my API up and running within a day with no prior knowledge of Flask and some Python on and off. I've been able to discuss and teach other team members on it who were also able to pick it up easily.

Re:Node.js 5.0 Released by matwood on Friday October 30, 2015 @09:51AM (#10477755)
JS in general moves fast and packages range from great to WTF in quality. I would suggest using Babel(or something similar) for all future JS development. That way you can use ES2015/2016 features now and have them work in most environments.

I have a built a small API using express and passport and so far these node changes have not impacted my code.

Another option for fast API development is Java 8 with SpringBoot and Jetty. People hate on Java and Spring, but the latest versions of both are very powerful and easy to get going. If you end up needing more it is there.

Re:Node.js 5.0 Released by cdnsteve on Friday October 30, 2015 @09:59AM (#10477818)
But then you have to keep up with Babel changes too... http://babeljs.io/blog/2015/10/29/6.0.0/
Re:Node.js 5.0 Released by merpnderp on Friday October 30, 2015 @10:05AM (#10477863)
Why this urge to keep up to the latest and greatest? Especially for a transpiler? If it is converting your code just fine, why update?
Re:Node.js 5.0 Released by Goronmon on Friday October 30, 2015 @10:19AM (#10477938)
Probably the concern that waiting between updates means that if you are forced to update for some reason (critical bug or must-have feature) you have a tougher upgrade path.
Re:Node.js 5.0 Released by coldtea on Friday October 30, 2015 @10:58AM (#10478177)
Because if you don't, then a year or two down the road you're left with an unsupported legacy hell.
Re:Node.js 5.0 Released by callahad on Friday October 30, 2015 @11:09AM (#10478275)
Node.js modules: from brand new to "unsupported legacy hell" in "a year or two."

There's no way this is sustainable, but I'm at a loss of how to fix it, especially when the ECMAScript language itself is evolving at such a rapid pace. Any ideas?

Re:Node.js 5.0 Released by coldtea on Friday October 30, 2015 @11:23AM (#10478364)
It's a cultural thing.

JS being relatively fashionable and easy to write, it attracts all the younger devs that can't be bothered with backwards compatibility, stability, etc, and keep changing, restructuring etc their projects as they go along.

There are exceptions of course, e.g. anything by jashkenas, but this breakage happens a lot. Also with people adopting the latest shiny new framework every year or so (e.g. it feels like ages when Backbone was the shiny new thing, but it was merely 5 years ago -- since then we've had Ember, then Angular, then React take the spotlight).

Re:Node.js 5.0 Released by bmn_ on Friday October 30, 2015 @12:54PM (#10478949)
Rapid pace is fine because the language spec is backward compatible. The module problem is rather mostly on the API level. To fix:

• On the technical side, needs the equivalent of CPAN testers to automatically show where stuff breaks.

• On the social side, needs the fostering of a culture where breakage is considered ill-mannered, and module maintainers hence go to lengths to prevent it or fix it promptly.

Re:Node.js 5.0 Released by bonif on Friday October 30, 2015 @01:25PM (#10479144)
>but I'm at a loss of how to fix it, especially when the >ECMAScript language itself is evolving at such a rapid pace. >Any ideas?

Avoid Javascript on the server, problem fixed.

Re:Node.js 5.0 Released by s_kilk on Friday October 30, 2015 @02:32PM (#10479625)
Pretty much. It's not like we're stuck for options.
Re:Node.js 5.0 Released by matwood on Friday October 30, 2015 @08:16PM (#10481298)
I would agree and why I brought up java 8 and SpringBoot above.
Re:Node.js 5.0 Released by csvan on Friday October 30, 2015 @11:19AM (#10478339)
There were 6 years between ES 5 and 6, and it will most likely be another 1-2 years before we have complete, well tested ES6 coverage across all major browsers. ES6 is fully backwards-compatible with ES5 anyway, so it's not even a Python-kind of language evolution.
Re:Node.js 5.0 Released by csvan on Friday October 30, 2015 @11:15AM (#10478307)
In the case of Babel - performance. Even with all the fantastic work that has been done on it so far, good luck avoiding massive transpile times for non-trivial ES6 code bases. I imagine TypeScripts (and other) transpilers have the same issue.
Re:Node.js 5.0 Released by 15155 on Friday October 30, 2015 @12:32PM (#10478815)
In a project with over 600 required js files, 25kloc in project, way, way more from npm: the whole compile takes around 25s.

An incremental compile takes ~1-2s.

Re:Node.js 5.0 Released by rhinoceraptor on Friday October 30, 2015 @10:03AM (#10477846)
Babel does some other magic that you might not realize, such as converting anonymous functions to named functions (and then assigning those to a variable of the same name).
Re:Node.js 5.0 Released by matwood on Friday October 30, 2015 @10:54AM (#10478155)
It has some magic, but we already have to use polyfills to support multiple browser versions. I see something like Babel as the global polyfill of the future. Use latest es features now and have them go native over time.
Re:Node.js 5.0 Released by alexwebb2 on Friday October 30, 2015 @09:45AM (#10477722)
No need to always be on the latest version. v4.2 is an LTS branch that will be supported for the next two and a half years.

And with tools like nvm, it's incredibly easy to swap out different versions and go for a test drive.

Re:Node.js 5.0 Released by breck on Friday October 30, 2015 @02:53PM (#10479764)
"n" is another good node version manager that makes switching versions painless. https://github.com/tj/n
Re:Node.js 5.0 Released by Killswitch on Friday October 30, 2015 @09:48AM (#10477737)
Node.js keeps in line pretty heavily with V8, so if you're keeping up with changes in Chrome's JavaScript engine, you're already keeping up with Node.

Plus you don't have to always upgrade to latest and greatest. If your app works fine in 4.2 and there's no crazy security issues you need to upgrade for, don't. 4.2 is LTS so it's going to get supported for a long time.

Re:Node.js 5.0 Released by malandrew on Friday October 30, 2015 @04:34PM (#10480381)
As an engineer, I assume you use a programming language and the libraries from its ecosystem to solve problems. Unless the latest features are essential to solving your problems, I would say this is unnecessary worry.

We use both ES5 and ES6 (via transpilation) where I work. I had to write a lot of the tooling to support ES6 because a lot of front-end engineers were asking for ES6. To this day, I have yet to hear one engineer justify their "need" for ES6 with one of the features that make something easy that is hard or cumbersome with ES5. Pretty much every feature engineers were wanting to use were simple sugary syntax features like the spread operator that is trivially dealt with with a library like `xtend` (the irony is seeing these same engineers continue to use _.each on arrays instead of Array.prototype.forEach)

There is a corollary to Wadler's Law in here somewhere: https://wiki.haskell.org/Wadler's_Law

    In any debate on the merits of migrating to ES6, the 
    total number of times an ES6 feature is cited as 
    justification to migrate to ES6 is proportional to two
    raised to the power of its position.
           0. Semantic features
           1. Syntax features
           2. Lexical syntax features
           3. Lexical syntax of comments features
Re:Node.js 5.0 Released by sotojuan on Friday October 30, 2015 @09:51AM (#10477754)
You could've used Node 4.2 LTS and a simple Express server (is Flask the Express of Python?) and had as much stability. That said, I do understand your skepticism and concern.
Re:Node.js 5.0 Released by rplnt on Friday October 30, 2015 @09:57AM (#10477802)
I'd say bottle if you'd want to go for simple and small. Flask has two huge dependencies, one of which is template engine which you wouldn't need for a simple API.
Re:Node.js 5.0 Released by rdtsc on Friday October 30, 2015 @10:05AM (#10477865)
> I ended up opting for Flask and Python 3x instead

Yap good choice. Python to me is more readable (so I can understand my own code and others' better) and I find the echo system to be friendlier and more mature.

Re:Node.js 5.0 Released by cglace on Friday October 30, 2015 @10:25AM (#10477973)
Funny how yesterday in the pypy thread it was all doom and gloom for python and yet in the real world people keep choosing it for new projects.
Re:Node.js 5.0 Released by oldmanjay on Friday October 30, 2015 @12:11PM (#10478667)
It's almost like there are many people doing many things in many directions all at once!
Re:Node.js 5.0 Released by untog on Friday October 30, 2015 @12:18PM (#10478723)
Why was the pypy thread "not the real world" when this thread "is the real world"?
Re:Node.js 5.0 Released by bryanlarsen on Friday October 30, 2015 @10:38AM (#10478047)
We have apps on Node v0.10, which is over 2.5 years old and will be supported for one more year.
Re:Node.js 5.0 Released by cdnsteve on Friday October 30, 2015 @12:17PM (#10478714)
3.5 years for an API, that's decently long, but dependent on industry. What does your upgrade path look like? Are you basically rewriting everything into ES6, aka starting over? Three years isn't long in a corporate environment.
Re:Node.js 5.0 Released by bryanlarsen on Friday October 30, 2015 @12:35PM (#10478830)
We've lightly tested some of our components, and they work unchanged in Node 4. Heavier testing may find a couple of issues. The only reason we haven't switched is that need for heavier testing. No big rewrite will be needed.
Re:Node.js 5.0 Released by cdnsteve on Friday October 30, 2015 @06:33PM (#10480951)
Good to know, thanks for responding back.
Re:Node.js 5.0 Released by morgante on Friday October 30, 2015 @09:49AM (#10477750)
There is continuous change, but the changes tend to be quite small. You can also safely stay on older versions for a long time (4.2 is LTS).
Re:Node.js 5.0 Released by agumonkey on Friday October 30, 2015 @10:03AM (#10477841)
javascript pace feels so overwhelming it makes me enjoy reading Java 6 specs.
Re:Node.js 5.0 Released by Joeri on Friday October 30, 2015 @03:21PM (#10479939)
You jest, but this week i've been developing my first java web app using play framework, coming from a decade of PHP and javascript, and i found the experience surprisingly nice. You can get a good edit-refresh cycle going using incremental recompilation, and the api's are elegant and flexible. My preconceived notions of the verbosity and ugliness of java web app code proved unfounded.
Re:Node.js 5.0 Released by agumonkey on Friday October 30, 2015 @04:18PM (#10480287)
Java was heavy, and still is but most of the perceived weight came from immaturity (the world wanted freeform template oriented scripts). Now all languages are moving towards types, packages/modules, conventions and structures. If a php3 dev discovers php 5.6 I'm sure he wouldn't enjoy it.