r/webdev • • Jul 23 '20

Microsoft Launches Build JavaScript applications with Node.js Learning Tutorials

https://docs.microsoft.com/en-gb/learn/paths/build-javascript-applications-nodejs/?WT.mc_id=mslearn-reddit-abartolo
811 Upvotes

105 comments sorted by

101

u/Wireless_Life Jul 23 '20

This is a set of tutorials that was just released on the topic of Node.js. It takes you from the very beginning of your developer journey with Node.js to tell you the what and whys of Node.js to teaching you debugging, file management, dependency management, and even web development.

63

u/trisul-108 Jul 23 '20

And the cool part is that you learn everything there is to know in an easy 20 minutes /s

23

u/geneorama Jul 23 '20 edited Jul 23 '20

My favorite book like that: 24 hour course to master C++

Edit: to be fair the book doesn’t say “master”, but it is on the sixth edition.

2

u/Skhmt Jul 23 '20

I think I have that book.

To be fair, it's 24 man hours, not one day.

1

u/geneorama Jul 23 '20

I like to imagine Data from Star Trek furiously scanning the whole book at once.

0

u/[deleted] Jul 23 '20

[deleted]

38

u/[deleted] Jul 23 '20

YouTube taught me how to code and I can now console.log and print() in 10 different programming languages. Can you do that? I the best programmer ever.

5

u/massiveboner911 Jul 23 '20

Honestly that’s pretty accurate. Ive started and stopped like 7 times with 7 different languages and markup. Html, java, javascript, c#, python, php, and c++.

7

u/hedronist Jul 23 '20

Doing what? Assembling spacecraft?

3

u/notionovus Jul 23 '20

Any poser that would use a high-level language like Assembler to embed machine code into an eprom or ASIC, should be restricted to applications in Kid's Club, Space Camp or simulations at the Kennedy Visitor Center.

Man up, and enter the hexcodes through the keypad, son. For crying out loud, you've got all night and some time tomorrow morning, even.

I am currently screening applicants for jobs at JPL. /s

2

u/01binary Jul 24 '20

Keypad? Sheer luxury.

1

u/notionovus Jul 24 '20

IKR? We had to buy the kids keypads because they couldn't do hex-to-binary conversion in their heads. Hex-to-Binary ffs! They were useless on the UYK-20 front panel.

1

u/CantaloupeCamper Jul 23 '20

AND MAKE A 6 FIGURE SALARY

(i keep getting that ad on reddit...)

24

u/[deleted] Jul 23 '20

Just wondering - for someone who is just getting the hang of Javascript when should they start learning about Node.js?

18

u/_Invictuz Jul 23 '20

node.js is just JavaScript my blonely mate, but dealing with the Operating System instead of the browser. Same JavaScript fundamentals that you can learn or practice to get good at Javascript. You do need to note key differences between the Browser API and node. For example, the global object in node is not window.

5

u/el_diego Jul 23 '20

This is the right answer. It’s the concepts of server management and design patterns that will be different.

38

u/Sethasaur Jul 23 '20

In my opinion the earlier the better. You can learn both in tandem, and the web concepts you learn developing with Node.js are pretty invaluable.

Syntactically, Node JS apps are going to look pretty different than the Javascript I imagine you're writing (DOM manipulation/Client Side JS is where most people start). If it's too much, there's no shame in dropping it, continuing on your current track, and then picking up Node.js later :)

21

u/kilopeter Jul 23 '20

Syntactically, Node JS apps are going to look pretty different than the Javascript I imagine you're writing (DOM manipulation/Client Side JS is where most people start)

Possibly dumb question: NodeJS is a JavaScript runtime, right? Then wouldn't NodeJS be syntactically identical to frontend Javascript? The semantics/stuff-you-do-with-the-same-syntax will be different, of course. Disclaimer: I barely know enough frontend JS to be dangerous.

31

u/Sethasaur Jul 23 '20

Definitely not a dumb question.

The syntax is different in the sense when you're writing traditional javascript, your offten using syntax like document.('#class').val(); This is what I mean by DOM manipulation. The page has already loaded, and now you're using Javascript to get and set values from HTML.

Node JS runs on the server, so it doesn't access the DOM in the same way. You are going to be running into more promises and more functional JS opposed to DOM manipulation.

16

u/Amygdala_MD Jul 23 '20

Not so much syntax, but context is what is different. Syntactically speaking after all, this is very little different when compared to e.g. res.status(400).json({foo:bar}). It's just basic dot annotation.

Context is where the difference lies, and also part of why in my view too it hardly matters with what you start in javascript. Whether that is frontend or backend, dom manipulation or not. The only thing you need to familarize yourself with up front is tge actual syntax, that is the pure fundamentals in which javascript is written.

Think variable declarations, functions, classes, the various datatypes, their callback functions, promises, etc. If you're comfortable with those building blocks you will know how to read the language "grammaticaly" speaking, you will know its words.

Does it mean you'll comfortably read a complicated node application? No. But it's similar to the difference between reading e.g. Harry Potter versus a NASA publication. Same language, same syntax but different context.

5

u/el_diego Jul 23 '20

To be fair, technically that’s not JavaScript, but the browser api. Node.js is syntactically the same if the same engine is being used. E.g v8

1

u/Sethasaur Jul 23 '20

Yeah true. I just know when first learning JavaScript, your pretty much learning HTML manipulation and Jquery.

Then I’m comparing that to using Node JS frameworks like React or Express which look quite different than what I described above.

In hindsight I could have came up with a better answer, but it was early and I was just starting work lol

4

u/unc4l1n Jul 23 '20

I think that's a bit of an odd distinction given that you can and do have fluent interfaces in both node and browser coding. Which is more, the syntax you provided for the browser stuff is not at all to do with browser work, except for the fact that it's jQuery.

3

u/[deleted] Jul 23 '20

Very good explanation, thank you.

2

u/kilopeter Jul 23 '20

Awesome, thanks for the helpful reply!

5

u/Such_Code_Much_C_Wow Jul 23 '20

Async code finally made sense to me when I started learning Node.js, so I'd say try to learn about it as soon as possible.

1

u/takishan Jul 23 '20

I say practice problems on codewars. Getting good at the language means you will get good at Node and front-end browser stuff.

The syntax is identical. You'll do some different things in each, but you'll also do a lot of the same in both.

4

u/[deleted] Jul 23 '20

Genuinely excited for this

5

u/bartturner Jul 23 '20

Does it use V8 or the Microsoft JS engine? Forgot the MS JS engine name.

17

u/wllmsaccnt Jul 23 '20

Node.js uses V8. This is just a set of generic Node.js tutorials published by Microsoft.

1

u/bartturner Jul 23 '20

Did a quick Google search and found the MS JS engine is called Chakra.

Node.js can use or V8. I am curious though if Microsoft is just using Google V8 instead of their own?

"Node.js welcomes Microsoft’s Chakra JavaScript engine"

https://www.infoworld.com/article/3024271/nodejs-welcomes-microsoft-chakra-javascript-engine.html

Never looked into if they are using V8 or Chakra with their new Chrome Edge browser?

11

u/wllmsaccnt Jul 23 '20

> "Node.js welcomes Microsoft’s Chakra JavaScript engine"

This information is out of date.

The new Edge uses V8. The node-chakra project was archived in March after Microsoft said they planned to stop contributing to the project (it was made obsolete when Edge moved to Chromium / V8).

-1

u/bartturner Jul 23 '20

Well that sucks. Hoped Microsoft would still be in there trying to compete with their own JS engine.

Sucks to see Microsoft giving up on so many things that are really important. Microsoft really should have the resources to have their own mobile and browser.

9

u/[deleted] Jul 23 '20

As somebody still supporting IE, this comment triggers me.

3

u/[deleted] Jul 23 '20

While I completely agree with you (IE is pain to support) I feel that MS could create a good modern browser if they really wanted to. It would just be another browser with small quirks. But that's what Firefox is and I haven't seen any complaints about supporting Firefox for example.

But again, let's not forget that IE should be eradicated.

1

u/el_diego Jul 23 '20

They tried that already, it was the original Edge.

1

u/bartturner Jul 23 '20

Why could Microsoft not invest and make the original Edge decent? Really the same with mobile? Why cant Microsoft make a decent mobile OS?

2

u/el_diego Jul 23 '20

Who knows. Poor leadership? Too many cooks in the kitchen? It’s amazing how such a large company with so many resources seems to cock this stuff up constantly. So much so that they threw in the towel and used Googles tech 🤦‍♂️

1

u/trashlikeyou Jul 24 '20

The mobile OS *was" decent - they just messed up everything else with it.

1

u/zibola_vaccine Jul 23 '20

Why though, give me less things to have to support, not more. In my view the negatives of diverging practices across runtimes and browsers outweigh the positives of healthy competition here.

1

u/longebane Jul 25 '20

Because the less competition there is, the more likely a company can control practices. That's how we ended up with IE

1

u/zibola_vaccine Jul 25 '20

We didn't end up with IE. We are in a much better place that's almost entirely chromium.

1

u/longebane Jul 25 '20

You just say that because it gives you less work as a developer. But it's awful for web standards, jesus

1

u/zibola_vaccine Jul 25 '20

It's awful how exactly?

0

u/notionovus Jul 23 '20

It's called throwing good money after bad, and it rarely works as a strategy.

2

u/soniiic Jul 23 '20

1

u/bartturner Jul 23 '20

Thanks! Pretty weird how Microsoft is more and more just using Google technology. We really need more competition not less.

Saw the new Microsoft phone is going to use Google Android including Google Play Services and Play store.

1

u/RotationSurgeon 10yr Lead FED turned Product Manager Jul 23 '20

Forgot the MS JS engine name

Chakra: https://github.com/microsoft/ChakraCore

17

u/sojohnnysaid Jul 23 '20

Warning i'm a burnt out node dev so this is a rant

After building apps with node using express, strapi, hapi, fastify, gatsby, adonis then react, redux on the front end because 'muh API' This is how I recommend learning Node:

I have the quickest Node tutorial:

  1. Delete node and/or node_modules from /usr/local/lib.

  2. Delete node and/or node_modules from /usr/local/include.

  3. Delete node , node-debug , and node-gyp from /usr/local/bin.

  4. Delete .npmrc from your home directory

Just use python and especially Django. Build the damn app, then go outside and enjoy your life.

Node has promise but the node community leaders need to step up and create a real batteries included way of doing things (no not express, no not hapi because the dude is closing it down because he built it almost entirely solo, no not adonis only one guy driving the bus, no fastify they are just like express, no not x framework because seriously why are there so many frameworks??)

NPM is like going down an alleyway to a guy with a trench coat and when he pulls it open to show you the package you want it's riddled with 9001 other dependencies that make your terminal vomit with warnings and please donate messages.

The other biggest problem with node is that there is a direct gateway into the frontend JS community...and if you want to talk about HOT GARBAGE....jesus guys you think react, or redux is the way???? I'm sorry but I don't need to have a degree in fkn astrophysics to update state in my apps. Javascript could of been like python, making things productive for programmers, so they could MAKE THINGS AND FINISH THEM. Now it's a circle jerk of tooling and i've spent way too much time wasted with it.

7

u/dougie-io Jul 23 '20

I too love Python and Django but it is pretty hard to completely escape the Node/NPM ecosystem if you want to do front-end stuff unless you're content with vanilla Javascript.

1

u/[deleted] Jul 24 '20

I deal with Node/NPM since I use Angular on one of the FEs I manage, but it's Python/Django/Postgres as soon as we're talking about the backend. It's just my hangup, but I don't think I'll ever be okay with running JS as a server-side language. Makes my skin crawl just thinking about it.

-8

u/sojohnnysaid Jul 23 '20

is it though? Facebook is pretty big isn't it? Amazon doing pretty well right? Did those companies start out using the Node/NPM ecosystem? A lot of startups are getting bogged down trying to create apps for scale that have no user base to begin with that even warrants the use a front end framework. They could easily render on the server side and pretty it up with a css framework. It's this mentally that you NEED a js framework that is toxic to the development community as a whole.

10

u/NorthAstronaut Jul 23 '20

Facebook created react, and then moved facebook onto it for simplifying development.

Amazon uses react too for things. Like prime video.

-4

u/sojohnnysaid Jul 23 '20

With scale and money anything is possible. What rich companies are doing won't exactly translate to the 99%

2

u/dougie-io Jul 23 '20

unless you're content with vanilla Javascript

I think you forgot to read my above line.

Sure, if you create your own startup you can use whatever you want. Not everyone is going to have that freedom depending on where they work.

And there are advantages of frameworks. Generally you can build your app much faster with them and you have a lot less wheels to reinvent.

2

u/sojohnnysaid Jul 23 '20

TBH some of these frameworks have created so many problems for myself and other dev's I know i've been more and more into vanilla. And i'm not alone on this.

1

u/smallDataNerd Jul 23 '20

For majority of websites out there vanilla Javascript would be better, faster, easier.

1

u/dougie-io Jul 23 '20

For blogs and news sites, totally. I'd actually see as far as you can go without using any JS!

1

u/el_diego Jul 23 '20

But they’d still want all their ads, analytics, and pop up modals which are pretty much the sole reason these sites are so bogged down.

3

u/tabris_code Jul 23 '20

i love python but the package management solution is not great. you're not installing 1000 dependencies like Node but managing dependencies and dev-dependencies is not fun.

node: npm or yarn with one package.json

php: composer with one composer.json

rust: cargowith one Cargo.toml

python: venv + requirements.txt but you have to create each individual requirements text file if you want to split dev dependencies and regular dependencies. or use pipenv. or poetry. or conda.

1

u/sojohnnysaid Jul 23 '20

True I like how rust does it especially

5

u/CantaloupeCamper Jul 23 '20

python and especially Django.

Fuck python and getting it to run from one environment to another....

2

u/sojohnnysaid Jul 23 '20

Yeah venv ain’t the greatest but I’ll deal with it for the benefits. If you’re building entire enterprise apps for NPOs like me Django is the only decent option if I actually want to live away from my desk and have a life. And for you laravel fans I get it but the $ syntax just isn’t for me.

3

u/CantaloupeCamper Jul 23 '20

It's just weird that Python is such a friendly language... but the runtime world is just a big FU to users with conflicts version to version and etc.

1

u/LewisTheScot Jul 24 '20

virtualenv is nowhere near as good and intuitive as yarn/npm, but is there really that many issues with it?

Having a README.md and a requirements.txt is what gets me up and running in no time.

3

u/lil_doobie Jul 23 '20

Bro just use deno now (/s don't hurt me)

1

u/sojohnnysaid Jul 23 '20

LOL bro love it! I mean hey if we can start using decorators maybe we have a chance.

2

u/[deleted] Jul 23 '20

Virtual hugs man.

1

u/YourMatt Jul 23 '20

you think react, or redux is the way

I know this comment is outside the scope of this thread, but to you React Devs that are seeing this, is Redux still a preferred way of handling state? I don't use React in my day job, and the one app I built with it, Redux ended up being a pain in the ass. It was satisfying to have it all set up well in the end, but there were too many pains along the way.

Are you guys just using the Context API now, or some other alternative?

4

u/Peechez Jul 23 '20

redux toolkit makes it trivial and your useReducer and context lasagna won't outperform it

2

u/Sethasaur Jul 23 '20

lmao at context lasagna

1

u/sojohnnysaid Jul 23 '20

To be fair context API, functional components, hooks etc have made things much easier. But the issue is that is when you look at the development of these frameworks over time, you are re-implementing code over and over and over. Nothing is getting better it's just changing again and again.

1

u/YourMatt Jul 23 '20

I get it. Lately I've been going back to pure JS with no build tools at all. Those are for simpler things that I want to be able to sit for years on end without touching and still expect to be able to pick up for a quick adjustment.

I've really enjoyed React though. I wish I could use it more.

1

u/sojohnnysaid Jul 23 '20

I mean trust me I get the attraction to it. But as things get more complicated I feel like it doesn't deliver on it's promises. Unless you got the big bucks for teams, managers etc anyways.

1

u/CantaloupeCamper Jul 23 '20 edited Jul 23 '20

I don't know if folks are pulling out redux automatically as much as they once were, but of course it is still out there.

For small apps... context is fine (well it always was) and for larger apps ... you can do well without a dedicated state manager library too.

1

u/[deleted] Jul 24 '20

Yes forget node and only use JS when it's needed like for animations or for small front-end things it's trash and still major security concern. Try use PHP productivity with it is unbelievable. Complex back-end solutions in minutes(if you learn) and no real dependencies.

1

u/sojohnnysaid Jul 24 '20

Ok let’s not go that far lol. Jk PHP is fine just not my preference.

1

u/no_ledge Jul 23 '20

I feel you. People choosing the tool before analyzing the problem they want to solve is a big issue in the web development community. We depend too much on buzzwords.

0

u/[deleted] Jul 23 '20

[deleted]

-6

u/sojohnnysaid Jul 23 '20 edited Jul 23 '20

Node isn't a hammer it's a framework for making hammers. If you're into making hammers you do you.

edit: "batteries included front end." Wow talk about big warnings.

0

u/[deleted] Jul 23 '20

[deleted]

1

u/sojohnnysaid Jul 24 '20

I’ve made pull requests which were added to npm packages you probably use. I’m one of the documentation writers for fastify js. If I want to rant about it I’m gonna rant. You read the warning at the top of my comment no?

2

u/jehk32 Jul 23 '20

Node.js makes it possible to share logic like form validation rules between the browser and the server.

This reason to use node.js (or any other frameworks that make such a claim; I'm looking at you Blazor) has always left me feeling kinda tepid. I've written and maintained numerous web apps over the years. The logic to submit data from the client to the server is often very different from the logic to submit data from the server to the database. One set of code has validation rules intended for the user of the app while the other has validation rules intended for persistence. While there is some overlap its often trivial. This is even truer if your api layer isn't intended to be domain specific.

Using the same language and frameworks on client and server side? Great! For validation? Meh.

2

u/guitarromantic Jul 23 '20

Check out Joi. I'm using it for a complex web form to validate input on both client and server. It's great expressing your validation rules as basically a giant object with all the properties and types you expect, it's like writing a test.

2

u/[deleted] Jul 23 '20

They own NPM (Github aquired it).

0

u/[deleted] Jul 23 '20

Does this means that is better avoid dotnet for nodejs? I'm confused.

2

u/Roci89 Jul 23 '20

Definitely not. You can stand up a dotnet core web api really quickly. But try both, use what you prefer. Or more importantly, use whichever one is the right tool for the job

-9

u/tetryur Jul 23 '20

I am not a big fan of Node, but I am always looking for a convincing argument, so I looked at the What is Node.js? section.

If you've never used JavaScript as a primary programming language before, you might be thinking, "is this really a good idea?"

Right, that's exactly what I have wondered a hundred times.

Node.js makes it possible to share logic like form validation rules between the browser and the server.

gasp Holy shit, how could I have doubted Node!? Forgive my insolence! Please, let me join the club, please!

2

u/malokevi Jul 23 '20

For sure. Hell, you can render your entire app on the server before the page even loads. Node's strength is in the unified nature of building a pure Javascript app.

-1

u/tetryur Jul 23 '20

Well, if a SPA doesn't need SSR, and has a decoupled API built in whatever, Node is unnecessary.

-2

u/Advanced_Path Jul 23 '20

This is great. Teaching youngster how to develop resource-hogging and completely unoptimised applications. /s

1

u/[deleted] Jul 24 '20

Truth ... laughs in php.

1

u/Advanced_Path Jul 24 '20

And Python.

0

u/[deleted] Jul 23 '20

[deleted]

2

u/el_diego Jul 23 '20

If you prefer working on the FE with UIs then no, probably better to move towards popular frameworks like React/Angular/Vue but if you prefer working with data processing then yeah go for it.

0

u/[deleted] Jul 23 '20

[deleted]

5

u/PandaOfDoom Jul 23 '20

Please do enlighten me with the alternatives, if you’d be so kind.

1

u/[deleted] Jul 23 '20

[removed] — view removed comment

1

u/el_diego Jul 23 '20

Learn what interests you. The rest will follow

3

u/[deleted] Jul 23 '20

[removed] — view removed comment

4

u/kewli Jul 23 '20

Pick one. Learn it well. It will take way less time to learn the 2nd one. Pick the one that interest you.

1

u/kewli Jul 23 '20

Also, you could potentially build with both in tandem to figure out what you like best (between .Net Core and Nodejs)

0

u/[deleted] Jul 24 '20

No learn php.

2

u/[deleted] Jul 24 '20

[removed] — view removed comment

1

u/[deleted] Jul 24 '20

Yeah all the noobs here don't recommend it for some reason even though it powers most of the websites on the internet. It's not dying that's just the js fanboys speculating.

PHP is eternal meaning it will never die so it's a great investment especially for personal projects when you need CRUD. Wordpress is also set to continue dominating and that runs php you need to know it to make themes / plugins ect.

You can do anything you want on the back-end you don't even need a framework although vanilla php jobs are rare so to get employed as php dev you'll need to know 1 or more of the major frameworks.