Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

221–230 of 369 posts

Re: JavaScript is Good, Actually

#221

Earlier quoted context omitted.

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.

It seems you're not talking about JSON (the serialization format) but rather about Javascript's object literal syntax that inspired JSON. They're really different things.

[deleted]

Re: JavaScript is Good, Actually

#222
This article’s reasoning seems really confused to me.

He seems to be saying, “Hey, this ting that everyone calls a shit sandwich isn’t really a shit sandwich. Let me tell you why.

I go to this nice restaurant and eat things that are not shit sandwiches. And they are fantastic. But they all end up as shit eventually, so it does t matter. Therefore JavaScript is not a shit sandwich.”

Re: JavaScript is Good, Actually

#223
Code spends most of its time being in production and not in development. During that time in production, developers will leave the team, bugs will show up, major enhancements will be made. So it is important that the codebase is easy to reason about, easy to refactor and easy to debug.

If you take a language like Java and an IDE like Eclipse or Intellij IDEA, it is trivial to find from where a particular piece of code is called from. Whereas in JavaScript, particularly in huge codebases, you can't easily tell how a piece of code ends up getting called. You will need to run the code, make some educated guesses and put breakpoints or console.log statements to verify that yes, this particular line does end up getting called on this particular action.

Refactoring is also a joy in a language like Java. You can easily modify a method signature and the IDE will take care of updating all the places this method is called from. Now imagine you add a new argument to your JavaScript function and want to update all the places where the function is called from.

So judging JavaScript on these factors, it isn't such a good language.

Re: JavaScript is Good, Actually

#224
post #39

Semantics and configurability is what what makes a language great. JS doesn’t have function environments, i.e. every unlexical lookup goes to global/window and that cannot be redirected. It doesn’t have green threads (at least). There are generators, but one cannot just yield without marking all the functions generators too (async/await in modern terms). Stack traces are lost when generators throw(). JS has no good i…

> Stack traces are lost when generators throw().

V8 (and probably others) now has some special cases for async functions (and generators, I think, but those are much more rare) to show useful stack traces with the lineage of async calls. For example, this code shows the stack trace you'd expect when run in latest Chrome or Node.js.

  async function c() { throw new Error('Some error'); }
  async function b() { await c(); }
  async function a() { await b(); }
  a();

Re: JavaScript is Good, Actually

#225

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.

I don't understand what's wrong? People use software without knowing how it's coded under the hood all the time? The V8 code is here if you want: https://github.com/v8/v8

Re: JavaScript is Good, Actually

#226
post #177

Earlier quoted context omitted.

Haskell was the first thing that came to mind. I can show with one hand, by joining my pointer-finger and thumb, the number of people I know that use it. It looks lovely, and it's something I'd very much like to learn some day but I can't for the life of me think of what I would use it for. Are there any killer apps out there for it? At least with lisp, I can configure emacs ...

Pandoc and Xmonad are written in Haskell.

Interesting but again, short of contributing to these projects what am I going to do with Haskell?

Re: JavaScript is Good, Actually

#227
post #38

Earlier quoted context omitted.

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

Given his github profile, I think we can give him credibility that he is pretty good. https://github.com/ashfurrow

    s/good/busy/

Re: JavaScript is Good, Actually

#229
post #202

Earlier quoted context omitted.

My response to this is usually that Ruby is a great language because it's easy to get useful work done with a large, meaningful subset of the language. You can ignore the warts just by not using them. You can't do that in JS, because the warts are so fundamental. (yes, you can be tripped up by library authors in Ruby, but there's community backpressure against providing footguns).

I don't agree. The ruby community had a recent love affair with dsl. Taking a peak at rspec library source made my eyes bleed. There's also a huge preference for "magic" even outside of rails, so much that when you want to augment or add functionality you're supposed to monkey patch. There's also a huge preference for "clean" syntax when it doesn't necessarily improve maintainability--it just makes the number of odd…

FYI, there is a significant contingent of the Ruby community that doesn’t use rspec (for exactly the reasons you mention). Heck, the test suites for Rails and Ruby itself use minitest, not rspec. It’s hard to notice this, though, because the rspec people have a vastly larger written output.

It sounds like most of your criticisms are criticisms of dynamic languages. Ruby gives you a million and one footguns, but they are beautiful and elegant footguns.

Re: JavaScript is Good, Actually

#230

Earlier quoted context omitted.

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

Yup, relatively new. Only around since python 3.0, for the last 12 years ;-)
Post reply on HN