back

by hexomancer·3y ago·view on hn ↗
Off topic: Jesus Christ that table is bad. How badly have they messed it up that reversing sort order takes multiple seconds on my pc? It was so slow that I thought maybe it is sending a new request to the server every time I change the sort order but no, it is just that slow.
1 comments
The power of modern Javascript. So what if my pentium 133mhz could invert an entire table with hundreds of cells in lotus 123 back in the early 90s in the blink of an eye. The fact that 20 years later with computers 100x faster inverting a table takes longer is progress! Also don't forget to mock people who care about performance by screaming "premature optimization" without fully understanding what it means.
Blaming poorly optimized sorting on a whole ecosystem of a language feels lazy at best. It wouldn't have mattered if it was done in Python, PHP or whatever, if the developer who programs something doesn't know how to sort things efficiency, there is nothing to say they'd do a better job in a different language.

Bad programming is just bad programming, no need to pull what language is being used into it. Just happens to be JavaScript because that's what browsers natively support. But if Python (or whatever) was used instead, the very same programmer would have done the very same mistake.

> Blaming poorly optimized sorting on a whole ecosystem of a language feels lazy at best. It wouldn't have mattered if it was done in Python, PHP or whatever, if the developer who programs something doesn't know how to sort things efficiency, there is nothing to say they'd do a better job in a different language.

Counterpoint: It's not what programming languages do, it's what they shepherd you to

https://nibblestew.blogspot.com/2020/03/its-not-what-program...

>Blaming poorly optimized sorting on a whole ecosystem of a language feels lazy at best.

The sorting is actually fine. On my Mac the sort completes in less than 1ms.

The performance issue is because of all of the hooks of the svelte framework trying to do their thing in the middle of the sort, and then another frame-sizing script trying to do its thing in the middle of the sort. This is an endemic problem in Angular apps as well.

Not javascript's fault, or even the sort algos fault.

Thanks for doing somewhat of an analysis, I was just guessing it was a shitty sorting algorithm, but thanks for clarifying the actual problem :)
Yes the entire eco system is bloated and badly optimized. A lot of the web has become laggy, slow and battery drainers due to modern js frameworks.

You're right it isn't the language but since js is the only front end language it gets called out.

Just so we are clear, I love JavaScript and write it everyday but I avoid the “modern” eco system like it is the plague.

Careful. I just got a slap on the wrist for calling out lazy commentary, apparently it’s “taking a swipe” at someone.
...who are you arguing with?
No one, just making an observation.