from Hacker News

Node input function is broken

by brlebtag on 6/13/19, 6:03 PM with 1 comments

It has been 10 years since Node.js first release (according to wikipedia, at least). And it has been a long journey since then. We went from everything asynchronous world to everything async/await world.

but seriously, it time for us to reflect about the basics...

Every normal computer programming language in this planet has a input/output function.

When you're learning every normal computer programming language in this planet, the first thing you do is to create is a 'hello world' to test the output function and some sort of simple calculator to test the input function.

it's really the basics of every normal computer programming language in this planet!

but why node.js is different?

why do I have to do something like this:

var readline = require('readline'); var resp = "";

var reader = readline.createInterface({ input: process.stdin, output: process.stdout });

reader.question("Some question here:", function(answer) { var resp = answer; console.log("you typed " +answer); leitor.close(); });

instead of something like this:

var resp = prompt("Some question here: ")

WHY?

I'm sorry if I'm not been polite and a bit rude. but seriously, if, every time I want to receive a input from the console, I have to google to figure out how to do that, then the problem is not mine, it's the language itself.

I'm really disappointed with node.js. I really love it. but I can't create a simple console app without googling it or importing other library.

  • by wdiamond on 6/14/19, 1:35 AM

    you are saying that everything was from async to sync. not everybody agree. btw you can write a sync if you want. and node is not a language, neither javascript, the language name is ecmascript. the problem is yours, save your own utils, if lowcode is what you want you don't have to code.