Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

191–200 of 369 posts

Re: JavaScript is Good, Actually

#191
I don't think anyone benefits from watering down the definition of "good" to the point where it describes Javascript. Javascript – sorry, modern Javascript – sorry, surfing a compile-to-JS liferaft atop a thick and constantly shifting foam of tooling and libraries disgorged by literal person-millennia of community effort – can be surprisingly decent if you're careful.

Any meaningful definition of good has to draw a line between things that are and things that aren't. The definition here is broad enough to include basically any language that is popular. C++ is also good because it has a good syntax for the things people use C++ for, a big community that builds tools for it, and it has quirks but come on every language has quirks.

"Just because you disagree with the decisions doesn't make the language bad" is a funny way of describing absolute bald-faced mistakes like typeof null == 'object', the baggage of 20 years of browser quirks (JS tristate logic: true, false, and document.all), and "no that was totally intentional minimalism" oversights like the lack of coherent collections and iteration primitives.

When I think about good, I think about Rust's memory model, Erlang/OTP's supervisor trees, Java's standard library, Clojure's immutable data structures, Python's syntax, .NET's LINQ, Haskell's type system, Idris's type system, Go's mascot, or Elm's delightful mix of programming language and solo performance art piece.

Despite the author's attempt to head this criticism off, the reason we use Javascript really is just because it's in the web browsers. Web developers had to use it, so we made the best of it. We wrote libraries and tools to make it bearable, we built new languages on top of it so we didn't have to deal with its bullshit, and once Ballmer quit ruining the internet we built those improvements back into the language itself.

But is that good? Layers upon layers of accreted improvements, each with more legacy carve-outs than the last? "We can never throw away a bad idea" is a one-way complexity ratchet that precludes unqualified goodness unless there were no bad ideas to begin with. With Javascript, that is not the case. The best it will ever achieve is that it has good parts.

If INTERCAL was the de facto language of the web, we'd be writing Medium posts about the benefits of Automatic PLEASE Insertion and how excited we are for ASYNC COME FROM to land in INTERCAL2018. And, hey, it's not perfect, but it gets the job done, there's a good community, and at least it's not Objective Malbolge. Who are we to criticise?

Re: JavaScript is Good, Actually

#192

Earlier quoted context omitted.

Python syntax is built around indentation. Try to properly indent a function that you pass to another function. And what if you have to pass two such functions? Where do you place the comma that separates both arguments?

You can't define a function via 'def' and pass it as an argument at the same time. You can do it via 'lambda' though (which doesn't require any indentation since it's just an expression), what's the problem with it? >>> (lambda f: lambda x: f(x) * 2)(lambda x: x + 1)(100) 202

So the problem is that you can only inline expressions; you can't inline let-blocks (assignments), or multiple statements. The usefulness is very limited.

Re: JavaScript is Good, Actually

#193
This is very relative. If you compare it to Cobol, then yeah, it is good! If you compare it to Kotlin or Clojure? Not so much. See, everything depends on your viewpoint and your viewpoint depends on what you know. If you only know javascript than it may be good.

Re: JavaScript is Good, Actually

#194
JavaScript is IMHO not a bad dynamic language, especially for rapid development of typical web, UI, glue, and scripting stuff... in other words most of what you use dynamic languages for.

We are moving to Go for our backend because dynamic languages don't scale with complexity or team size, but that's another matter.

Re: JavaScript is Good, Actually

#195
post #91

Earlier quoted context omitted.

Did you ever notice that real world-class software developers don't even have to say that they are ? :)

Not really if you work as a contractor or freelancer. In those cases you have to shout to the world that you are world class developer. Recruiters or Managers love terms like world-class, ninja, rockstar etc. Its unfortunate state of our industry.

This is unfortunately true in life in general. Many people of decision making power are attracted to self promoters. So if you really want more opportunities and more upward growth, you'll get what you want faster by peacocking.

Re: JavaScript is Good, Actually

#196

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 part…

One of the richest companies in the world with very good engineers made a supercomplex engine which nobody understands and looks like they cannot make it better and we use it happily as given - something's wrong here.

Re: JavaScript is Good, Actually

#197
post #94
post #71

Earlier quoted context omitted.

What are great languages in your opinion?

If we’re talking about “dynamic CRUD over socket abstracted to death”-style tasks, and not considering minor preferences like syntax, then python, lua, most of lisp/schemes, perl. All of these allow enough meta-anything to do: ./file.src: func api_foo() for x in objs x.a = fetch(x.b) ui.btnok.enabled = yes commit() And have foo exported as api, and when called, all clients/servers, databases synced, validations passe…

Nothing is stopping you from generating JavaScript code to do what you want. You don't need reflection to do that.

I'd hate to see Python become as popular as JavaScript and to have it be used as the defacto standard in browsers because honestly, it's nowhere near as enjoyable to use as JS.

Re: JavaScript is Good, Actually

#198

Earlier quoted context omitted.

My main problem with Python: passing a temporary closure to a function is very messy. You can't do functional programming well in Python. Also, I think scoping rules in Python are terrible. I always end up with a namespace that is a mess. And you can't do something like this in a clean way: counter = 0 def add(n): counter += n add(1) add(2) add(3)

> And you can't do something like this in a clean way: That's what nonlocal is for: https://docs.python.org/3/reference/simple_stmts.html#the-no... Just stick "nonlocal counter" in your function and it works.

True. But nonlocal is relatively new.

Also nonlocal implies that other variables are local, which is not true. E.g., the following works without "nonlocal" keyword:

    counter = [0]

    def add(n):
      counter[0] += n

    add(1)
    add(2)
(This used to be my workaround.)

Re: JavaScript is Good, Actually

#199
post #171

Earlier quoted context omitted.

Oh, come on. So the guy uses some harmless exaggeration when selling himself on his own personal website & you're taking him to programmer jail over it? Do you frequently launch into personal attacks on authors whose articles you disagree with?

If a medical doctors classifies himself as world class and then posts articles about medical matters, then my expectation would be his world class-ness is evident. This guy's not writing an opinion piece about which brand ketchup tastes best. He has published an opinion piece in which he speaks authoritatively about matters related to the domain he claims he's a world expert in. As for the harmless exaggeration, it's…

What does world class mean?

That you are good enough that people would accept your work in the United States?

Re: JavaScript is Good, Actually

#200
post #93

Earlier quoted context omitted.

That's interesting because I also picked up on that: "I am a world-class software developer living in New York’s East Village" and I just thought, hmm, here's this guy with ~5 years of ~professional dev(mainly with iOS) and he self qualifies himself as world class. Looking at his bio, I see he's worked for 3 companies doing quite ordinary things. I would love to know what gave him the confidence/ignorance to describe…

Oh, come on. So the guy uses some harmless exaggeration when selling himself on his own personal website & you're taking him to programmer jail over it? Do you frequently launch into personal attacks on authors whose articles you disagree with?

Yeah, I think pretty much any ordinary asshole that goes around calling himself world class ought to be mocked for it
Post reply on HN