Hey, I am starting to learn some node.js, any advice.
For further actions, you may consider blocking this person and/or reporting abuse
Hey, I am starting to learn some node.js, any advice.
For further actions, you may consider blocking this person and/or reporting abuse
Valeria -
Valeria -
Chaoming Li -
Bilal Haidar -
Top comments (7)
Remember to simplify!
Taking the time to work with simple JavaScript for a while is a good idea that others have suggested, but it scales too.
Many things that you might use multiple files to express in Java can be expressed in one file in node.
For example, when I ported a Java service to node, it had separate files for each class, and a class for each 200 return value, a class for each error, 2 commandhandlers/controllers etc etc.
In node it was the express server in one file. The router in a separate file and then a controller file that was essentially an Enum (using Java-ese) that defined all the functions for each route on the API and any helper functions.
Java-brain will make you want to over-complicate a bit. That complication is good in very large teams that might need to have one person working on one class and another person working on the controller, and another person working on the Spring implementation all in parallel. It forces you to slow it down and think it through to avoid side-effects on your teammates!
You CAN split out a node application in a similar way, but really as you are learning, KISS is your friend when trying to translate Java knowledge into JavaScript.
Hope that helps!
If you have never programmed in JavaScript, start there!
I have been a Java developer for more than a decade, and had to unlearn a lot of things before I truly embraced JavaScript.
Learning JavaScript can be tricky and YMMV! Start from developer.mozilla.org/en-US/docs/W... and check the left sidebar. Always prefer MDN over blogs (lesson learnt hard way!)
Happy Learning!
Coming from a Java background as well I used Spring MVC a lot , so I am not sure is the case the same but what I did was:
done, you don't need JS and nodeJS nonsense but when you do.. you know even more then the rest.
The Node.js API docs can be a little overwhelming to beginners. I suggest that you visit nodejs.dev to take a look of a little of what Node.js is capable of doing.
@wesbos helps 👍🏼
Here you can check how to build rest API with nodejs, it is great for beginners
codespot.org/how-to-build-rest-api...
this is quite useful.. having understanding of java can let you skip many sessions..
freecodecamp.org/learn
you do some basic javascript first and then move to node..