DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Fulton Browne
Fulton Browne

Posted on

I am java developer trying to learn node.JS, where should I start.

Hey, I am starting to learn some node.js, any advice.

Top comments (7)

Collapse
scott_yeatts profile image
Scott Yeatts • Edited on

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!

Collapse
harittweets profile image
Harit Himanshu

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!

Collapse
gochev profile image
Nayden Gochev

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:

  • Learned ES 6
  • Learned TypeScript
  • Started playing with NestJS (it is basically Spring MVC or JAX-RS and TypeScript is very like Java)

done, you don't need JS and nodeJS nonsense but when you do.. you know even more then the rest.

Collapse
lffg profile image
Luiz Felipe Gonçalves

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.

Collapse
codenutt profile image
Jared

@wesbos helps πŸ‘πŸΌ

Collapse
vasilevskialeks profile image
Aleksandar Vasilevsk

Here you can check how to build rest API with nodejs, it is great for beginners
codespot.org/how-to-build-rest-api...

Collapse
shaghab profile image
Asim Ghaffar • Edited on

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..

πŸ—£ Want to join the conversation?

Β 
It's easy! Become a DEV member to follow this post, comment, and more.