4

I want to lean JavaScript node js what’s your best advise

Comments
  • 5
    Use dots when needed
  • 9
    to learn something else instead.
  • 6
    1) Spell check your posts or you won't get many serious replies

    2) Build a few simple projects. Start out just serving a html file and a favicon. Next you might add some client to server communication like being able to POST a form. Then maybe you wanna get into serverside html templating like nunjucks or some variant of serverside react.

    You can host node projects for free on something like onrender.com (now that heroku is no longer free)
  • 4
    I'd say get yourself familiar with the different kinds of modules (CommonJS, UMD, ESM, etc.), how they look like, and how they are used (require, module.exports, import, export, ...).
    If possible, use TypeScript instead of JavaScript.
  • 5
    @bigmonsterlover i like that your lack of punctuation makes your post good advice.
  • 0
  • 3
    Don't
  • 0
    @bigmonsterlover I'd advocate learning JS first. Having that fundamental understanding is very helpful when working with a superset language like that 🙃
  • 0
    @ScriptCoded
    By that logic he should learn asm, c, then cpp, then js, only then typscript....
  • 2
    @magicMirror every coder should at least know a _tiny bit_ of ASM, just to have an understanding of how computers _work_
  • 0
    @tosensei

    Maybe.

    But first... lets invent the Universe.
    Or the JVM. And another JS engine.
  • 0
    @magicMirror is js a superset of cpp?
  • 1
  • 0
    seems like ur into pain
  • 2
    Learn C first. We don't need anymore casuals.
  • 0
  • 3
    Learn Assembler, C, C++ or Rust first.
  • 1
    In itself Node (plus Express, which is the de facto default for anyone getting into Node) is not that hard to grasp if you're used to JS and have experience with serverside code.

    I moved from asp.net to nodeJS and found stuff like routing quite simple. It's more straight forward in Node by comparison, as asp.net projects often have various complicated layers and alternative approaches.

    The difficulties with Node are
    A) picking a html templating language. I often spend more time on templates than the node code
    B) choosing between built in solutions like fetch or npm packages like axios
    C) Minor details like when serving files you gotta use "__dirname" - that stuff is normally handled in tutorials but it's easy to forget when you get used to Node and try to set up a new project from scratch and ask "Why is my favicon 404?"

    Some tutorials start diving deep into the event loop but you really don't need to learn about that stuff that early
  • 1
    now that I start thinking I remember other stuff that can turn chore in most Node projects: package management, build steps etc.

    You could try Deno if you want a) typescript support or b) some more features out of the box. Deno was written by the same author as Node, with the goal of having more built-in tooling, a standard lib more similar to browser JS (fetch was included right away) and a "simpler" alternative to packages.

    But hope that doesn't give you analysis paralysis.
    If you wanna learn to get a job: go with Node. Very few use Deno. If you just wanna build hobby projects quick: try Deno.
Add Comment