Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

21–30 of 369 posts

Re: JavaScript is Good, Actually

#21
post #12
post #7

Earlier quoted context omitted.

Not really, Typescript is mostly a superset of ES2015 and is compatible syntax wise. It has almost no new "features" (apart from enums and namespaces, I think) and only contains a typing + visibility system and related syntax on top. The only part that is not ES2015 in the given code example is the ' as ConsignmentSetup' cast.

AFAIK async functions aren't part of ES2015 either.

async functions are es2017 async generators are es2018 but both are supported in the latest version of node v10

http://node.green/#ES2017-features-async-functions

I had to look it up because i could've sworn async functions were es2015. The lines get blurry when things are implemented out of order.

Re: JavaScript is Good, Actually

#22
A programming language where almost everything is mutable is by design not good.

JavaScript is popular because the learning curve is low and it was good enough for the web. Otherwise it is pretty mediocre even when just compared to scripting languages.

Then, the "about" page of that blog is very concerning: "I am a world-class software developer". A world-class software developer would be people like John Carmack, Linus Torvalds or Dennis Ritchie.

Re: JavaScript is Good, Actually

#23
post #9

Switching back to Java after having spent a long time in JavaScript land with modern standards made me realize how great JavaScript had become. The biggest reason for JavaScripts greatness to me is JSON. I couldn't understand how Java developers put up with such bulky ways to deal with data. After some time in Java land I've come back to appreciating its strengths again though. Code completion is nice. I'm kind of ho…

JSON is seldom JS now, as any language has had encoder/decoder built in for years.

Sure, but there is boilerplate and abstractions that are needed in a language like Java or Scala. In JavaScript, it's a first-class citizen of the language.

Re: JavaScript is Good, Actually

#24
post #14

I think javascript shines only depending on which languages you compare it to, and what you're doing with it. Also JS + Typescript is a force to be reckoned with (the added safety is great), and once a multi-threaded runtime like Chakra[0] takes shape, it'll be even better. JS's early introduction of concurrency primitives (callbacks, futures/deferreds, promises) will make javsacript developers much productive much f…

Typescript is the only reason I would consider Javascript "good." Without the type safety and the refactoring tools that type safety makes possible, applications may be easy to write initially, but unbearably difficult and time consuming (read expensive) to refactor and maintain an application of even basic to moderate complexity.

What about:

- easy accessibility of higher order functions (AKA functions as a first class object from the get go)

- graceful inclusion/addition of concurrency-handling functionality despite the language being single threaded (this might be much more to do with the context javascript was to be used in)

I agree with your sentiments on the value of type systems and compile-time type checking, but so many languages are in the same boat as JS in this regard -- it even applies to a bunch of lisp dialects (CL does have the `declare` form), and not many could consider lisp a "bad" language.

Re: JavaScript is Good, Actually

#25
post #11

This post even argues against the very idea that JavaScript is any good. {Garbage code example} "Syntax is just syntax". "Tool writers are neutral, then get to work fixing this terrible language". Really?

Yeah, arguing that language features that have caused untold pain, constant confusion, and an shameful level of strictness aren't an issue because third-party linters and typed DSLs give you warnings is... weak. Any language can address any issue in that manner. The very fact 3rd party tooling is required to address language design issues is a pretty harsh criticism of that languages design in and of itself. Javascri…

> Yeah, arguing that language features that have caused untold pain, constant confusion, and an shameful level of strictness aren't an issue because third-party linters and typed DSLs give you warnings is... weak.

The point the author is making is that the haters love to point at these quirks and claim that they cause "untold pain"; yet in actual practice I've only been bitten by == maybe twice in 15 years.

Re: JavaScript is Good, Actually

#26

A programming language where almost everything is mutable is by design not good. JavaScript is popular because the learning curve is low and it was good enough for the web. Otherwise it is pretty mediocre even when just compared to scripting languages. Then, the "about" page of that blog is very concerning: "I am a world-class software developer". A world-class software developer would be people like John Carmack, Li…

> A programming language where almost everything is mutable is not good.

That's a weird criticism. Object-oriented programmers are premised on mutation. As for JavaScript itself, mutations can be avoided. 'const' to prevent reassignment, using Object.freeze, or just applying functional programming principles and keeping functions pure.

Re: JavaScript is Good, Actually

#27
post #7

Earlier quoted context omitted.

Regarding the same code example > You may have noticed that the code above isn’t even JavaScript, it’s TypeScript, which brings me to my next point. Which kind of invalidates the entire premise of the article.

Not really, Typescript is mostly a superset of ES2015 and is compatible syntax wise. It has almost no new "features" (apart from enums and namespaces, I think) and only contains a typing + visibility system and related syntax on top. The only part that is not ES2015 in the given code example is the ' as ConsignmentSetup' cast.

By that definition C++ and C are the same languages. But everyone knows they aren't. And both C/C++ are statically typed languages! You can't just drop a static type system into a scripting language and claim it's an irrelevant difference!

I agree with the other posters - there are probably good defences of JavaScript that can be written, but writing an article about how great JavaScript is and then showing a code sample from a different language just reinforces the idea that JavaScript developers probably don't have much experience with other kinds of programming.

Re: JavaScript is Good, Actually

#28
As a long time JS dev I don't claim expertise in other languages, but every time I go back to check out new features in C++ or Java they feel more and more like JavaScript with types than "C with classes".

Re: JavaScript is Good, Actually

#29
post #7

Earlier quoted context omitted.

Regarding the same code example > You may have noticed that the code above isn’t even JavaScript, it’s TypeScript, which brings me to my next point. Which kind of invalidates the entire premise of the article.

Not really, Typescript is mostly a superset of ES2015 and is compatible syntax wise. It has almost no new "features" (apart from enums and namespaces, I think) and only contains a typing + visibility system and related syntax on top. The only part that is not ES2015 in the given code example is the ' as ConsignmentSetup' cast.

> Not really, Typescript is mostly a superset of ES2015 and is compatible syntax wise.

You could say that about C++ and C, but that's an entire different can of worms.

So why not give the example in JavaScript then? Arguing that JavaScript is "Good, Actually" and then showing examples of tools people have build to avoid using vanilla js because it lacks X or Y is actually an argument for js being "Not Good Enough".

Post reply on HN