V
V
Vasily Nazarov2014-01-09 14:12:03
Node.js
Vasily Nazarov, 2014-01-09 14:12:03

Is there a synchronous Node.JS (for initial training in web development on the server)?

For some time I taught web development at the university, I plan to resume this practice.
Based on previous experience, I deduced the optimal learning sequence as follows:
1. HTML / CSS
2. Programming on the client side (ie Javascript)
3. Programming on the server side.

The question is about point 3.
It looks very tempting to learn the principles of programming on the server side not to learn another PL (for example, PHP), but to apply Javascript (that is, respectively, Node.JS).

However, asynchronous server-side programming requires a fairly serious experience / qualification of the developer.

In fact, the questions can be formulated as follows:
Are there ways to use Node.JS synchronously and "behind" a separate web server (better Apache, maybe Ngnx)?
Are there any Node modules that can be used to get HTTP request data (headers, POST variables, etc.) with this scheme?

I understand that it looks like an appendectomy in the wrong way, but, again, the question is whether Javascript / Node.JS can be used to teach "classic" web programming methods on the server.

Big request - no need for answers like "Synchronous Node.JS is evil and not feng shui". A lot has already been written (and read) about it.
It also doesn't make sense to recommend Python, Ruby, Java, and other PLs - this question is not about a "correct" PL.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
kazmiruk, 2014-01-09
@vnaz

Although you asked not to give such an answer, you should not use technology for synchronous programming, the main principle of which is asynchrony, since you will teach students bad things and they will have a lot of pain after graduation and entering a cruel world (I still remember some of my teachers with a quiet swear word). And I don’t see any problems in the asynchronous approach for learning. In essence, the "classic approach" is
also asynchronous, but this is achieved by a set of threads that execute several requests at the same time.
As a matter of fact: it is possible to make the code on the node completely synchronous using a synchronizing lib (waitsync, for example).

A
Aquahawk, 2014-01-09
@Aquahawk

Learn to work asynchronously. I want to cry when you see hovering gui. Thank God I have not seen network synchronous applications, or rather there are web servers, but they launch mountains of their processes. Learn to write right away. You cannot learn how to make jam from the city. Take simple tasks but do it right. It's not that difficult. Normal programs are all asynchronous. And the use of synchronicity where true asynchrony is needed is illiteracy and incompetence.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question