Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

41–50 of 369 posts

Re: JavaScript is Good, Actually

#41
post #38
post #35

This is a lot of lines for not saying much. I was expecting much more from a "world-class software developer"(see About section) :) Saying that the community is more advanced in the JavaScript ecosystem than it is in the iOS world is a nonsense to me. Don't we have more JS developers than iOS developers ? Moreover, saying that JS syntax is really good with tools like TypeScript is another nonsense. You can also write…

Does "world-class software developer" even mean anything other than a big ego?

I hope it's just ironic, so I give him the benefit of the doubt :)

Re: JavaScript is Good, Actually

#42
post #36
post #6

Earlier quoted context omitted.

I too like JSON, however it is somewhat inefficient for arrays, where you end up repeating keys a lot. If you're gzipping, it probably doesn't matter as much...

I'm slightly puzzled. Array = [[1,2,3],[4,5,6]] seems valid json and I'm not sure what's inefficient or where the keys come in?

s/arrays/"collections of homogenous objects" and it's a fair point.

Re: JavaScript is Good, Actually

#43
Personally what I love about JavaScript is that it brought the basics of functional programming to the masses.

Obviously it's far from pure FP, but I think it's much more at the heart of JS than it is say Python. The Scheme parts of JS are the good parts.

I think some of the resurgence of FP is down to JS. The wealth of libraries available is pretty impressive [0]

[0]: https://github.com/stoeffel/awesome-fp-js

Re: JavaScript is Good, Actually

#45
My developer friends do have opinions on JavaScript that are in my view outdated, modern JavaScript is my favorite peogramming language due to the ease of expressivenesss and joy to write it. I started out with C, C++, Java, Objective-C and C# before ever seriously using JavaScript (other than tiny snippets of front end browser dom manipulation) and may be I’m just getting old but... I’d love to use JavaScript for everything if I could.

Re: JavaScript is Good, Actually

#46
The syntax example didn't look any different to what I'd see in modern Java, C#, Go, Rust, LISP, etc. The syntax can make or break the language for some (Rust for me) but in the end, if you sit down and look at it, most languages in use today will be similarly easy to read (except Haskell).

It's not better that the example isn't even JS itself but rather the only JS dialect I don't refuse to work with since it has a type system that is more solid than wet tissue paper.

As the author themself admit, syntax is not important, so why bring it up? That genuinely seems like a way to A) bring up the argument and B) in case anyone refutes the argument being able to simply say "well it didn't matter anyway".

---

Toolchains are another bad point. VSCode doesn't only exist for JS, it has support for other languages as well and I very rarely make use of it as JS IDE.

If I need a third-party toolchain to fix up the most basic mistakes of the language's design I don't think the language under that mess will be terribly good.

Other languages don't require an entire toolchain to provide a minimum of coding safety.

People agree that writing in C is something hard and dangerous, it also needs an entire toolchain to achieve a minimum of "not segfaulting on startup".

I should be able to simply take the first party language tools and use those to get to a point where my application starts and the correctness of my code not being coerced to false.

---

While it is indeed commendable that JS has such a big community, I think the community still has lessons to learn. The churn in the ecosystem is beyond fantastical levels, not in a good way.

When I pull in sqlite3 for my project I can be reasonably sure that this project will be maintained for the next 20 decades and I will be able to use sqlite3 in 20 decades without much problem.

With JS dependencies I will always ask myself subconsciously if they're going to be maintained next week.

I don't write software that runs for next week, software I write is intended to function for the next 20 decades. Of course it'll get patched and maintained but I don't want to switch out my underlying framework because Google decided that their JS code has become too boring after 4 months of work.

The GraphQL examples is just an example of this. The tech is barely 5 years old, the tooling in all languages other than JS was extremely immature last I checked. Why should I bet on something like that to work and be maintained in 20 years?

---

I'm getting a bit rant-y but I'll take this last paragraph to disagree with the conclusion too. Most languages have some bad design. Usually that is fixed in the language or by first party tooling. That's not my problem with JS.

My problem with JS is that the moment I write JS I have to involve myself with the community of JS, a community that has laughed (!) and scoffed (!) at me for suggesting that I want to maintain software for a long time beyond $CURRENT_YEAR.

The ecosystem and community of JS are rotten and flawed, that's why I don't use JS where I possibly can and if I do it's vanilla browser JS pushed through the minimum installation of typescript I can get away with.

Re: JavaScript is Good, Actually

#47

Earlier quoted context omitted.

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

> Object-oriented programmers are premised on mutation I'm a Java OOP developer, and I make everything I can immutable. It's a design decision adopted by most of my colleagues.

Good point. The same practices are common in JS. Arguably, point free style, currying, functional composition, etc... are easier to achieve in JS (esp. with types). I do enjoy writing java in somewhat functional way, and have seen badly written OOP Scala (mostly by developers, who just started experimenting with FP), and I think it’s difficult to discuss a language without the broader context of its common practices/developer culture/discourse around it.

Re: JavaScript is Good, Actually

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

async await are ES2017 though

Re: JavaScript is Good, Actually

#49
post #35

This is a lot of lines for not saying much. I was expecting much more from a "world-class software developer"(see About section) :) Saying that the community is more advanced in the JavaScript ecosystem than it is in the iOS world is a nonsense to me. Don't we have more JS developers than iOS developers ? Moreover, saying that JS syntax is really good with tools like TypeScript is another nonsense. You can also write…

> You can also write Swift code and use another transpiler to get JavaScript code from it and you would say that JS is great.

I haven't read the article yet, but what you're saying is something completely different, in my opinion. If you write Swift you're writing a completely different language, with all the hassles usually introduced when transpiling. TypeScript, however, is just Javascript with some of the assumptions made explicit and a transpiler that actually checks whether you're violating those assumptions. In that sense, it's not much different from a linter - another tool that makes Javascript more pleasant to write.

Re: JavaScript is Good, Actually

#50
I'm an outsider to the JS world but find it absolutely fascinating the direction the language has taken. It's clear that a lot of the new language features enable more concise functional programming. I see this as a good thing.

I'm really surprised that whilst the language on the one hand gives nice tools like the object spread syntax, the last time I checked it didn't make it easy to make the interpreter enforce immutability.

It seems strange to me that the language evolves in this way to recognise foot-guns but doesn't give you the tools to turn them off. Object.freeze looked like it would do the trick, but it's shallow. Freezing doesn't survive the spread syntax, which makes perfect sense because it freezes the original object, and of course the whole point of immutable objects is to create a new object.

It feels like you're able to program in this style, but the language designers didn't really consider it very much and were just introducing the syntax to be consistent with the other spread syntax.

Post reply on HN