Live data from Hacker News

Ask HN: Why is everything in JavaScript changing so fast?

news.ycombinator.com

41–50 of 303 posts

Re: Ask HN: Why is everything in JavaScript changing so fast?

#41

Earlier quoted context omitted.

For APIs the lack of typing hurts; only that is now no argument because it is fixed by TypeScript / Babel. Performance? That is a good reason, but again if you actually pay attention to defining (and testing) your APIs that is in most cases a solved problem - use a fast language for performance sensitive endpoints. Team's lack of knowledge? That's the only real argument. But that works both ways. If you have a team o…

I would not call TypeScript/Babel making it a non-argument, because those two are separate languages that are compiled to Javascript. The language itself still has those limitations, you're just hiding it under the rug. Regarding performance, your solution means that in order to understand your site, you need to understand another language and javascript now. At which point, why swap between languages and mindsets wh…

Programming languages in general hide the limitations of machine code under the rug.

Regarding performance, why don't we write our web applications in C++, Rust or Go?

There is a lot of churn in front-end frameworks, but for back-end frameworks the ecosystem is more stable (I like ExpressJS, which is like the Rails for NodeJS).

If you factor your architecture correctly (e.g. separate your domain model from your views), you can also switch a bit easier between front-end frameworks.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#42
post #16

The open-source-JavaScript community right now is just the largest, most active open source community that has ever existed. Check out the stats that GitHub recently announced: https://octoverse.github.com/ Open source JavaScript activity as measured by pull requests has doubled (!!) in the past year. It's more than the next two languages (Java and Python) combined. Most of the top repositories on GitHub are JavaScri…

To a large extent this is true because the javascript community is busy with the re-invention of all of computer history, only without applying all of the lessons learned.

Activity does not equate quality.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#43

In an industry without a guild / license / what have you, the incentives skew towards articles of proof. Articles of proof could be demo websites, screen shots, and open source libraries. Being the creator or top two contributor of a library is now worth so much more than being a small time contributor that the incentives are skewed towards everyone just making a new thing, always. It's their way to stand out. So why…

> The python API would likely be no slower and much easier to write and debug.

But probably not for your qa engineer who most likely already (and possibly only) knows javascript.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#44
post #28

Cause JavaScript is used in browsers so it is the language of the web, and because it has turned out to be incredibly flexible and adaptable, and because it's pretty simple once yo get past the async thing, and because alot of effort has gone into making it fast.

I think out of all the comments so far this passes closest to the real reason. It's simple: if you're developing for the web, you almost certainly have to use Javascript. That reality corrals so many more people into Javascript than any other language.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#45
post #38

I think all the churn is a sign of several problems. First, the language was not designed to do what people are trying to use it for. Second, I question whether the framework makers are familiar with "native" UI APIs (e.g. Java, Qt, NextStep), which solved a lot of these problems years ago. Notice the lack of churn in native UI APIs (exception of Microsoft). Third, it seems like the frameworks try to build on top of…

> I think we need a standardized virtual machine, like a lightweight JVM (or, better, a heavyweight Lua), which would allow people to use whatever language they prefer

To be fair, a lot of languages compile to Javascript. Do we really need a second standard?

Re: Ask HN: Why is everything in JavaScript changing so fast?

#46

In an industry without a guild / license / what have you, the incentives skew towards articles of proof. Articles of proof could be demo websites, screen shots, and open source libraries. Being the creator or top two contributor of a library is now worth so much more than being a small time contributor that the incentives are skewed towards everyone just making a new thing, always. It's their way to stand out. So why…

Just a minor off topic correction, since you made the mistake twice: "squeue" is actually "skew".

Thanks! I forgot to require the spellcheck module ;).

Re: Ask HN: Why is everything in JavaScript changing so fast?

#47
post #29
post #13

Earlier quoted context omitted.

Unless your project is small (like under 10-20k lines), why use node when you can use a typed language? Javascript is a mess and if I'm server side and using something dynamic, I might as well use something nicer like ruby or python.

Types are low level. JavaScript is very high on the stack, and has no concept of types, it only has "value objects" (variable values: string and number, plus static values: true, false, null, undefined) and "normal objects" (Array, Object, Date, Function, etc). There's a debate though on what type should be used for numeric values in JavaScript. In JavaScript you rarely see getters and setters, as you do not need any…

You seem to assume that

A) Types are low level

B) C++ and C are the only competition to JavaScript

C) Not having to worry about types makes you faster or in any way better

A) is simply refuted by looking at java or SQL. SQL is a very high-level language compared to other stuff, yet it's heavily typed simply to ensure that data is either valid or the query fails (SQL Injection is still valid data in this case)

B) Take a look at Go. It's blazing fast. It beats Node.js in all benchmarks but Regex matching -> https://benchmarksgame.alioth.debian.org/u64q/compare.php?la...

Furthermore, Go is statically linked which means deploying to production is a simple scp operation to drop the binary.

Lastly, Go is opinionated on how you write programs, you will write programs that are scalable simply because of how simple goroutines are, using channels you can utilize asynchronous execution as you would in node.js but also utilize all available cores without having to think about threads or synchronization. Just pipe data through the channel!

C) Is a red herring, depending on who you ask it's either opinion or static typing being "better". http://danluu.com/empirical-pl/

Some studies indicate that it does not matter, some indicate faster development but more bugs for no types and others indicate less bugs and slightly longer development for types.

IMO Types are good. I want to worry about the types because when I receive user input I can be sure that once parsed it's 100% an int or a float or it fits in a certain struct. For the same reason I think relational databases are better than document stores, they ensure that my data is valid.

I don't have to write as much validation logic. It is sufficient to know that my function has been passed an int-type, I don't have to check if it's nil or a string.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#48
post #29
post #13

Earlier quoted context omitted.

Unless your project is small (like under 10-20k lines), why use node when you can use a typed language? Javascript is a mess and if I'm server side and using something dynamic, I might as well use something nicer like ruby or python.

Types are low level. JavaScript is very high on the stack, and has no concept of types, it only has "value objects" (variable values: string and number, plus static values: true, false, null, undefined) and "normal objects" (Array, Object, Date, Function, etc). There's a debate though on what type should be used for numeric values in JavaScript. In JavaScript you rarely see getters and setters, as you do not need any…

[deleted]

Re: Ask HN: Why is everything in JavaScript changing so fast?

#49
I have a pet theory about that.

I think it based on two factors:

1. the size of the community, JavaScript popularity is huge, it's probably the biggest programming community in the world, even the not so popular frameworks have a bigger community then the biggest frameworks in other popular languages (as a not at all accurate measurement, see vue.js and Python's django github stars/followers).

If you look at js frameworks/methodologies/libraries compared to the sum of the other languages' frameworks then the pace of change in Javascript compared to how many people use it is not as bad.

I had a similar experience with Java when it was the king of the web frameworks - JSP, JSX, JSF, Spring MVC, Struts, Stripe, Wicket and a dozen others.

Java was big enough to contain all of these frameworks, and it was big enough for people to support new ideas rather then iterate on existing ones.

I'm not familiar with C/C++ enough, but I think it has a similar amount of change to Java (which is somewhat less the JS)

2. the other big factor is how decentralized it is - JS is extremely decentralized, there are tons of big organizations contributing to it's advancement, to frameworks even building their own compilers (all the browsers).

Java is very similar in this regard, even in their governing model (a collection of companies that decide on standards together, though Java has drifted from that model with Oracle's lead lately).

C# is the opposite, it's one of the biggest languages but doesn't have a lot of change in it - everything is dictated by the central authority (Microsoft) and competing frameworks that don't get popular enough.

There are other factors of course, but I think most of those can be seen in other languages with less change, and are less relevant overall.

Re: Ask HN: Why is everything in JavaScript changing so fast?

#50

Earlier quoted context omitted.

Mind sharing why you consider node.js and other server-side javascript tools irrational?

Because when asked if (9999999999999999 == 10000000000000000), they return true.

This is why types are nice.

In Javascript you're not ensured to have an error, your program might continue working based on wrong data because some type has been randomly converted to a float.

In Go or C# you'd get an overflow error if the type is an int or you know it's a float and you get inaccuracy, if you need the accuracy you use a decimal type which will also ensure that any result is always of it's type.

Typed languages mean I cannot loose data accuracy without explicitly doing so. I have to tell Go that I want this uint64 as uint8 otherwise it's an error.

Post reply on HN