3 ms·
And then, the page shows, as a supposed example of the reason for not using javascript: > And here’s how you’d do it in Javascript. I count three separate call
by flavio81 9y ago
And then, the page shows, as a supposed example of the reason for not using javascript:
> And here’s how you’d do it in Javascript. I count three separate callbacks here. I’m not exaggerating - this is an example straight from the documentation of the postgres library!
Yet this JS code is done on a mediocre way (for today, 2017). This code would be far shorter and easier if done in JS using async/await, which is what everybody should be using now.
So, besides that, there is the premise that using the same language in the browser AND in the server is a good thing; but how true is tat premise when the "alternate" language is pretty much similar in features? I mean, there's not such a huge benefit of going from JS to Python; perhaps i can concede that Python is mostly strongly typed (a good thing), but it's not like there were huge advantages.
And then, how hard is to go from Python to JS to C# to Java when these four languages are very similar in syntax, as well? Hard stuff, for a programmer, would be to jump from JS to Forth or to Prolog; radically different languages.
- bryanrasmussen 9y agomaybe it's easier to jump between wildly dissimilar languages because you wouldn't be prone to mapping the wrong mental model on to what you're doing or mixing up the behavior of similar syntax as often?
- flavio81 9y agoYes, but jumping between Python and Javascript is really easy. I do it myself, even in the same day, without problems. In the same way as people who can talk English, Spanish, French, and Italian, can easily jump between those languages in the very same meeting/social event. I do agree with your point, for example it is easy for me to mix words as belonging to Portuguese versus Italian; but that's because i don't really speak those languages. The bottom line is -- once you learn them, there is hardly any trouble.