9 ms·
> The result of that approach is that in 2023, our desktop is worse in usability and performance than what is was in 1998. No. This is undoubtedly because ever
by DarkNova6 3y ago
> The result of that approach is that in 2023, our desktop is worse in usability and performance than what is was in 1998.
No. This is undoubtedly because every UI nowadays is using JavaScript. This is problem is way waaaaay larger than any premature optimization considerations.
- papruapap 3y agoTypical HN take that is nothing but a lie. Worst experience I ever had in a desktop app were from Java UI applications (jdownloader), python (caliber, pgadmin) or the win 11 super laggy ui (native). Meanwhile now we have a lot of web application with much better performance that their "native" counterpart (For ex: Email clients, Text/Code editors).
- Cthulhu_ 3y agoIs windows 11's UI laggy because of the UI library, or because of fetching things from the internet?
- MrPatan 3y agoNot because of JS in any case. JS is the whipping boy of desktop performance because its ascendance happened at the same time as what you say: interfaces that update on the fly and need data from the net to do anything at all. So now download times get blamed on JS and Electron by the haters. Ah, well.
- DarkNova6 3y agoI'm not sure about this. There are simple JS applications like Postman which can be unbearably slow (try closing tabs in fast succession, you will know what I mean). And this is for local-only data.
- The_Colonel 3y agoJavaScript is the fastest scripting language in existence and it's not close. It's strange that people automatically suspect it has to be the culprit as opposed to e. g. bad application programmers or (more likely) product owners putting more focus on features at the cost of optimization.
- robertlagrant 3y ago> win 11 super laggy ui (native) It's hard to know what this might be. I wouldn't assume it's a lack of perfectly CPU-optimised native UI code when it could be all manner of things.
- DarkNova6 3y agoIt’s not difficult to provide a bad experience regardless of technology. But if your baseline is slower and messier, it has a significant impact on your average application. I can also tell you bad personal experiences, but how about not making it personal? Thanks
- dataflow 3y ago> This is undoubtedly because every UI nowadays is using JavaScript. This happens in pure C++ or C in Windows too. It's neither just JS nor the problem the parent mentions (though of course in those cases those can sometimes contribute too). My understanding is that it's the various the layers of abstraction + security mitigations code has to go through nowadays.
- BiteCode_dev 3y agoThere is another point to consider: more and more people are writing code without being experienced programmer, thanks to easier languages, better IDE, more streamlined lib API, and now, even ChatGPT. A geographer scripting her GIS in Python or a quant doing some pandas analysis has a very limited programming experience, since her expertise is in her job. And so we see more and more code produced by people that don't know what is slow and fast, what is safe or dangerous, what is maintainable or not. This code is popular, because it solves a real problem by people deeply familiar with the problem, way more than a programmer would be. I have an example at $current_client, where they have some matlab code that handles tremendous amounts of money, with no comments, no doc, no tests, side effect everywhere and some interesting quadratic behaviors. They solved by loading balancing the thing on 6 servers with 17 processes, and manual testing.
- MrPatan 3y agoThe code the unexperienced write is infinitely faster than the non-code that would be not-written by nobody would the unexperienced not write code.
- tialaramex 3y agoSometimes it's concretely a specific amount faster because you're replacing some other workflow with the software, but yes sometimes you're enabling something which would otherwise just not happen. Colleagues in our sister group, which doesn't have any actual software engineers, helped some academic librarians build a tool to automate something they knew they couldn't otherwise do at scale. They want to teach students how to use a library effectively, and while any of them could walk say, one student per hour through this, there are thousands of new students every year, it's not manageable. Midway through the presentation the specialist explaining it said "It's not a program" and I was glad to find I wasn't the only person who wanted to interrupt, because duh, of course it's a program. They've built a program. It's a bunch of instructions, for how the computer does stuff, it's a program. Yes these people wouldn't have attempted Python, let alone Rust, but what they've built is a program, in a visual programming language. Is that intimidating and so they might struggle to maintain it? Yes, a little bit maybe, but pretending it isn't a program won't help. And that might mean sometimes you need a software engineer, the same way that if we want a bike shed (and sometimes we do, students like bicycles), sometimes we might need the staff architects down the corridor from me, don't just throw up a few brick walls and hope you got it right.
- ragnese 3y agoNo. Doing UI in JavaScript shouldn't make any noticeable difference. I say that as someone who hates JavaScript and doesn't think it should be used for anything, really. But, UI apps are long-running, and interactive. There's no real "throughput" or anything like that to be concerned with. The problem is precisely with the crowd that believes that ALL optimization is premature--or rather that code styles that I would consider pessimization is good. For example, in JavaScript, it's considered hip and "functional" to have a local variable that's an array, and instead of mutating it, programmers will string together five calls to `map`, `filter`, etc, making a bunch of temporary copies and iterating the data five times instead of once. Writing JavaScript with what I've heard called "mechanical sympathy" does not have to be slow at all.
- 6510 3y agoput the nice looking calls to `map`, `filter`, etc in a comment then rewrite it with a for loop under it.
- ragnese 3y agoThat's a pretty nice suggestion. Honestly, though, the expanded for loop implementation is never really that complicated in practice.
- shadowgovt 3y agoIt depends what you're aiming for. For accuracy, map and filter make it impossible to fall off the bounds of your iteration. While it would certainly be nice if the runtime could do that faster, slow + correct is often (not always) better than fast + broken. (There are languages that make fast + correct easier. Unfortunately, JavaScript isn't really one of them).
- ragnese 3y agoJavaScript has `for-of` syntax for iterables, so you won't go out of bounds, regardless.
- ndriscoll 3y ago
- kaba0 3y agoWhy would JS be the problem itself? Bundling a whole browser engine? Sure. JS itself is quite fast and plenty of frameworks use it for scripting their GUIs, e.g. QT.
- jcelerier 3y agoIt's not only JavaScript. For instance all the c# apps I ever had to use on windows had GUIs that felt less responsive than their old win32 counterparts or Qt equivalents (exhibit A: visual studio which became incredibly slower and laggier for the c# / WPF migration compared to... VS2008? and honestly never recovered)
- WalterBright 3y agoThere may be another cause of that. There appears to be an explosion of background tasks running, even when you do nothing. You can look at the task list and see them. The disk drive light comes on when I'm not using the computer.
- patmorgan23 3y agoUsing javascript... To simulate an entirely duplicate DOM structure and then diffing it to update the real thing. JavaScript is fine it's the massive frameworks that add 20 extra layers of abstraction that has to be processed that's the real problem.