5 ms·
I'm curious, what is your development background, and what do you enjoy most about Node.js? I come from a Java background, but have been working exclusively wi
by jestar_jokin 11y ago
I'm curious, what is your development background, and what do you enjoy most about Node.js?
I come from a Java background, but have been working exclusively with Node.js for the last eight months. Everything I write, I can't help thinking things like "this problem has already been solved in Java many times over", and "this would be safer in a statically typed language", and "this would be faster to write in anything else" (though this is more a reflection on my choice of libs).
- netcraft 11y agoMostly dynamic languages. I really like statically typed languages for certain tasks, but many times a dynamic language that gets out of your way can be quite liberating. It takes a lot of trust compared to a language where your compiler is what you trust - and occasionally you spend a bit of extra time tracking down why things are in a state other than what you expect, but on the whole it takes the time from this is what I need to this is what I have down considerably.
- dmarg 11y agoYes, statically typed languages can help. However, if you have good test coverage then you can test for that stuff and get a similar experience. For example, if a test break then you know your variable is not a number anymore when you need it to be.
- te_chris 11y agoManually writing tests for things which the compiler automatically picks up is not my idea of 'a similar experience'. Background: ruby and is dev who is now learning Scala and loving having type safety
- spion 11y agoWith TypeScript [1] you can get the best of both worlds: statically checked code with tool-assisted refactoring plus the ability to drop down to JS when the type system doesn't support what you want to do. (Of course, you'll now need to be careful about it and try to isolate the dynamic code from the rest of the system and present a static facade to it) [1]: http://www.typescriptlang.org/ http://www.typescriptlang.org/
- jestar_jokin 11y agoI've thought that if you're going to go the route of compiling to JS, you might as well go to a higher level of abstraction and use something like PureScript, Haxe, or any of the 100 other languages that compile to JS. Of course, interop then becomes a problem.
- spion 11y agoThats precisely why I suggest TypeScript or Facebook's flow, as interop is a non-issue. They're both just ES6 + optional types. The trouble with PureScript is that its different enough to have a different cost model (in terms of performance) thanks to the pervasive closure allocations resulting from currying as well as the typeclass dictionaries. Though I'm sure that once the compiler matures and those costs are eliminated, it would be the best choice. There is also TypeScript's tooling - while the language is less safe, the language service tools are a lot more advanced than PureScript's (I can't say if the same applies for Haxe though)