Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

11–20 of 369 posts

Re: JavaScript is Good, Actually

#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.

Javascript the language is getting much better, and is quite nice in many dimensions. Javascript the ecosystem has a lot of strengths, while also having embarrassingly poor base libraries that require stupid levels of duplicated effort and a platform that is still painfully inconsistent. The fragmentation around Coffescript/Typescript and linters hints at a much stronger need for a language that does more than JS does at its core... As traditional languages encroach into the browser space I see a lot of the "SPA" and cutting edge fat-client-in-html moving away from JS because of those warts.

Re: JavaScript is Good, Actually

#12
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.

AFAIK async functions aren't part of ES2015 either.

Re: JavaScript is Good, Actually

#13
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 faster than the equivalent ruby/python 2 developer with not as much early exposure to managing concurrency.

Re: JavaScript is Good, Actually

#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.

Re: JavaScript is Good, Actually

#15

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…

> Switching back to Java (...)

I miss the "and a project which doesn't use modern standards"-part in your post. It's not as if JSON or other modern things are not used in many Java projects. Your project seems to be stuck in the past, as are many JS projects. Legacy code is no fun most of the time.

Re: JavaScript is Good, Actually

#16
I don't mind ES6+ syntax. I'd even say that the syntax alone makes for a pretty great developer experience, but I still wouldn't say it's a great language altogether.

I think a fundamental problem with the language is that it's not particularly memory-efficient, and it's hard to make it memory-efficient. The V8 team has done a lot to make it better but they are still limited by the design of the language.

That's particularly painful in mobile where memory is constrained, and on the desktop it's making the typical 4 - 8GB of RAM less and less sufficient. That's important when discussing why Javascript is still an issue when using stuff like Electron and React Native.

Re: JavaScript is Good, Actually

#17

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.

I agree that the writer shouldn't have used TypeScript to demonstrate JavaScript; but to be fair, the only thing you have to do to turn it into JS is remove the `as ConsignmentSetup` on the 4th line.

> the only thing you have to do to turn it into JS is remove the `as ConsignmentSetup`

Removing the cast means removing static typing. It might be a small change for this snippet, but at the project level, you'd need considerably more changes, and you'd lose type safety.

Re: JavaScript is Good, Actually

#18
post #15

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…

> Switching back to Java (...) I miss the "and a project which doesn't use modern standards"-part in your post. It's not as if JSON or other modern things are not used in many Java projects. Your project seems to be stuck in the past, as are many JS projects. Legacy code is no fun most of the time.

I didn't read this as a json vs xml comment, although I suppose it could have been. Rather, I think it's a comment about how there is no convenient, lightweight syntax in Java for dealing with records/maps/trees/dictionaries.

Re: JavaScript is Good, Actually

#19
I think it's useful to differentiate between JavaScript the classic language for adding limited interactive behaviours to otherwise static Web pages and JavaScript the language for full-blown MVw web apps and JavaScript the ubiquitous portable script language.

For the first and third use case, really not much has changed since ES3/ES5: if you want portable JavaScript and appreciate simple "press reload button" workflows without babel or other complex transpilation steps, then ES6+ features don't add any essential capability, and I tend to avoid them.

If OTOH you really need to develop SPAs with massive code bases and third-party libs, then ES6 and in particular ES7 with async/await is a big win.

But I can't help wondering if the tension between these language profiles is going to work well for JavaScript in the long run. IMHO for full-blown apps there are much better alternative back-end languages available, and in any massive ES6 code base I've come across the desire to introduce types and type metadata is very much noticable (Angular and Typescript come to mind).

Post reply on HN