Live data from Hacker News

JavaScript is Good, Actually

ashfurrow.com

161–170 of 369 posts

Re: JavaScript is Good, Actually

#161
post #124

Earlier quoted context omitted.

There are a lot of valid criticisms against JavaScript. This is a fact. It's not a great language (clearly demonstrated by the discussion about it being good or not) but it's not terrible. I doubt anyone calls JS terrible on its own merits. There is a lot of hate against the runtime (edit: I mean the browser, not JS VMs or interpreters). The runtime enforces JS and the runtime itself is enforced everywhere. There is…

The difference between the hostility to php and the hostility to js is that there are many alternatives to php whereas, right now, if you want code to execute in the browser or on many different platforms, you don't have a choice. So where I would normally tell people who boo php to use whatever language they prefer, and get over it, that's not possible with js.

No alternatives to JS browser runtimes & environments maybe but you can use one of many transpile-to-JS languages and you shield yourself from most of JS badness.

Re: JavaScript is Good, Actually

#162

Earlier quoted context omitted.

> My main problem with Python: passing a temporary closure to a function is very messy. What's messy about it?

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 pass functions just like any other argument.

clos = 42

def foo(x): return x + clos

def bar(y): return y * clos

higher_order(foo, bar)

What's so hard about that?

Re: JavaScript is Good, Actually

#164
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?

No but on HN you should expect that criticism in that direction is valid. You can be world-class in certain niches but I doubt that calling oneself a world-class developer holds in the context of parts of the audience here.

It's ok to sell oneself but I'd be careful with exaggerations in a field with probably >1 million professionals.

Re: JavaScript is Good, Actually

#165
I would have liked to have seen some comparisons. Showing javascript syntax but then not showing anything else and then saying its good is not really an argument.

And aren't frontend dev essentially forced to use javascript since we can't compile to anything else at the current time? yes webasm is coming and yes there are languages that compile to js

Re: JavaScript is Good, Actually

#166
post #94

Earlier quoted context omitted.

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…

I think python is a terrible language. It has so little syntax you can't tell the difference between various things. A variable declaration, a reassignment, a keyword, a whatever else, they don't have any visual distinction from each other. I also find that python has reserved a whole bunch of keywords that I can't use as function names, making APIs hard to create with appropriate names. You also have to pollute your…

Explain how you can't tell the difference between a variable assignment and a keyword.

Re: JavaScript is Good, Actually

#167

Earlier quoted context omitted.

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

are you that saying based on his contributions or the actual projects he's created? Because former doesn't make any sense to me.

[deleted]

Re: JavaScript is Good, Actually

#168

Earlier quoted context omitted.

>It's not a systems programming language, so all the comparisons against typed, compiled languages are moot. No they are not 'moot'. At least not if you're building applications with 100k+ LOC. For dinky websites and small projects I'm with you. >Introducing transpiling as a mandatory pattern for JS development was a mistake. Again, what are you building? A dinky website, or a large application that you'll have to ma…

Transpilation is the number one reason I've seen that makes maintenance of older projects hard. The fact that JS didn't standardize on a module syntax until far too late means that we're forced into a transpilation cycle to build bigger projects. I can call that a mistake without denying it's reality. If you want to build a web application, at some point, until we have true web assembly, you will have to use javascri…

>Transpilation is the number one reason I've seen that makes maintenance of older projects hard. The fact that JS didn't standardize on a module syntax until far too late means that we're forced into a transpilation cycle to build bigger projects. I can call that a mistake without denying it's reality.

You answered your own objection. The language is deficient so alternatives are sought (lack of standard modules is one problem). Nobody likes transpilation and nobody would do it if JavaScript was conducive to building and maintaining large applications.

>If you want to build a web application, at some point, until we have true web assembly, you will have to use javascript

No. You can build it in TypeScript or Dart or any number of more sane language and transpile to JavaScript. Which is what people are doing.

Re: JavaScript is Good, Actually

#169

Earlier quoted context omitted.

Perhaps, but probably not. ES6 recognises the distinction, and includes native functions for serialisation. That's first-class treatment if anything is.

JSON.stringify and JSON.parse? They're standard library functions that many languages have, I don't see what's ES6 about them, they're much older. First class treatment would be if the language had JSON-typed objects with functionality, e.g. something like const myJson = j'{"key":"value"}'; const value = myJson['key']; const newJson = myJson.set("otherkey", "newValue"); (using the j'' notation for a hypothetical json…

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Implementing j`{"key":"value"}`; as a tagged template literal is left as an exercise for the reader.

Re: JavaScript is Good, Actually

#170
post #62
post #31

To me JavaScript is very similar to VBA. Based on its own merits it’s a pretty average language with lots of design flaws. But it has a monopoly for what it does (browser/cross platform vs ms office scripting) and most of its users never really got a chance to solve the same problems with a better language. And like VBA, it is probably the only language known to the bulk of it user base (semi-amateur web designers vs…

The crucial difference with VBA is its openness and community-driven evolution. VBA is stewarded and designed almost entirely by Microsoft whereas there are many many stakeholders involved in Javascript, and it's certified by an independent body and has lots of different variants that complement each other. Also it has many "cousins" such as actionscript or swift which you can get up to speed quite quickly in once yo…

Exactly that. I recently started programming JS again after not using it for a while and was surprised about some of the new language features. It certainly develops in the right direction, IMO.

VBA, on the other hand, hasn't really changed at all over the past decades. It's still as annoying as it can be with no help from the IDE. That's helpful as scripts from Office XP usually run with only minor edits but it also means that flaws annoying a decade ago are now much more severe. Luckily, we'll get JS on Office, although it'll probably take another decade until a reasonable share of companies have upgraded to a version that supports it.

Post reply on HN