Hacker News new | past | comments | ask | show | jobs | submit login

Nope, sarcastic.

If JavaScript devs don't know if a function is async or sync it just gives more evidence that JS is a monkey-language. LOL!




Not a "JavaScript dev", but I think JS is a fine language. Perhaps I'm biased, because I like Scheme. The browser environment is the shitshow.

A function can call a third party service, or some subsystem running on the same computer, whatever. Regardless of the programming language, that service may or may not do stuff asynchronously after your call. There's no way to tell. I regard the console.log to be a third party service. Who the heck knows what it does, except it has access to your memory!


I don't think you can compare JS to Scheme, I've heard of that meme though. Also, JS suffers from a lot of fragmentation in tooling and frameworks, so the problem is not just the language.

As for a third party service argument, you're just stretching the goal posts there to fit your argument.


It's not just a meme, JS was literally inspired by Scheme (garbage collection, lexical scoping, type system) and Java (some superficial syntax) and Self (object orientation).

I agree that the core language is not the worst problem with JS; that's what I was trying to say.

Regarding the other point about knowing whether something is async or not. Few languages will tell you if a function does side effects. They might spawn threads or processes, mutate the data you sent them, all after the call has returned. Languages where you can easily see that this will happen are few and far between, and they have strong static type systems.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: