Hacker News new | ask | show | jobs
by lolive 325 days ago
As a senior Java developper, I would say the most important things you will learn from Java (beyond types) are:

stream on collections (the local functional implementation of map/reduce/…),

interfaces everywhere,

and more importantly safe function extraction by your favorite IDE.

Let me elaborate the last one: you write an horribly long spaghetti code (because you are a junior, or you are in a hurry). That’s ok because the “Extract method” instant feature of your IDE will help you safely extract each piece of code AFTERWARDS into its own small function (that can be tested in isolation, where local variables stays internal to the function, where the interface contract in term of input/output/sideEffect is clear, where the function naming is meaningful).

The IDE can even tell you that this code you are extracting as a function appears at several other locations that should also be replaced with a call to that new function.

I don’t know if Typescript support in IDEs reaches the same level of simplicity/safety in term of function extraction.

But that feature is absolutely critical to go from spaghetti code to clean modular code, when you are a junior/work with juniors.