4 ms·
+1 With all respect to leichzeit0 comment, IMHO, JS is an ugly language, with way too many pitfalls [0]. Even big boys [1] use CoffeScript to transpile into JS
by trymas 11y ago
+1
With all respect to leichzeit0 comment, IMHO, JS is an ugly language, with way too many pitfalls [0]. Even big boys [1] use CoffeScript to transpile into JS.
JS for cross platform desktop development may be an easy thing to manage, though it can become unusable and clunky super fast. You can spot JS desktop apps, just by the size of executable, which is at least 5-10 times bigger than you could expect (Spotify - 130MB). They have poorer performance, can drain your battery faster, and some OS native features/guidelines must be implemented in a custom way, or could not be implemented/used at all. Sorry, for my critical and conservative view, but it's just my opinion (probably due to annoyance of overflow of laggy (web)apps, riddled with complex JS, where it could be avoided).
Probably it's the price of 'cross-platformity'.
[0] https://www.youtube.com/watch?v=20BySC_6HyY https://www.youtube.com/watch?v=20BySC_6HyY (original site does not load for whatever reason)
[1] https://github.com/basecamp/trix https://github.com/basecamp/trix
- MichaelGG 11y agoTrue. Popcorn Time is written with NodeJS. Hence it takes a very long time to install or upgrade (has to handle thousands of files) and has rather high CPU use at runtime.
- voltagex_ 11y agoI wonder if it read from a tar file instead of individual files on slow (NTFS) filesystems it'd be faster.
- scrollaway 11y agoThat's the logic behind most games. They implement a package format (sadly usually their own) for the game files for fast access.
- cristianpascu 11y ago>> "JS is an ugly language" >> "riddled with complex JS" If you pick a technology by the aesthetics of the language, I'm pretty sure you'll make a bad decision no matter what. Not you like in you, but in principle. :) The code is clean if you write it well. Ugly code comes in all parentheses positions.
- SturgeonsLaw 11y agoThat's why I do all my coding in brainfuck. People can't tell if it's ugly or not.
- trymas 11y ago>> "JS is an ugly language" What I meant: > "JS is an ugly language, with way too many pitfalls." IMHO it's ugly from 'within', just look at the JS truth table [1] and video I linked with the quote [2]. I just feel that I have no control of what I am doing with JS. <rant> It's quite a paradox, that new people to programming, can get start quick with JS, though are not repelled how easily you can shoot yourself in the foot with it. But maybe they just do not catch the errors.. </rant> [1] https://dorey.github.io/JavaScript-Equality-Table/ https://dorey.github.io/JavaScript-Equality-Table/ [2] https://www.youtube.com/watch?v=20BySC_6HyY https://www.youtube.com/watch?v=20BySC_6HyY
- insin 11y agoThe link you provided to demonstrate the problem also gives you the solution: > Moral of the story: > > Always use 3 equals unless you have a good reason to use 2. Tools like ESLint make it easy to enforce this (and to only allow == in the few cases where those good reasons apply).
- trymas 11y agoI think we are getting into deep rant, though I want to say, that even I know this rule of JS (always use 3 equals, unless you know why you need 2) why not make double equal work as triple one?
- mkishi 11y agoIf we were to rewrite history, that'd probably happen. Now count the number of languages that wouldn't reconsider something if we were able to.. I understand your frustration with js, but let's not pretend it's objectively worse to learn to deal with its pitfalls instead of other languages'.
- mikekchar 11y agoJS has an ungainly syntax, but then so do many other languages. I have been really surprised at how nice it is to work with a transpiler for JS (I do a lot of CS these days). One of my first jobs was working with CFront, which was a gigantic hassle so I was a bit apprehensive about moving to CS. Nevertheless I think it hits quite a nice sweet spot of giving you nice syntax but not being so different from JS that you forget what you're doing. As for pitfalls, most languages also have pitfalls. The "this" convention in JS is downright weird, but I've actually used it to my advantage (admittedly only once). The only other thing I can really think of that is actively hostile is automatic coersion of various types. The core of JS is actually quite small and elegant, though (IMHO). I really like the prototypical inheritance. Once you understand how it works, it is very flexible and easy to work with. It lacks a lot of explicit facilities, but it is usually very easy to implement them if you want. The main thing JS lacks is decent standard library. The recent Ecma script standards are moving in the right direction, but it is slow progress (understandably). I've worked professionally with FORTH, C, C++, Perl, C#, Java, Ruby, Go and probably a few more which I'm forgetting. When I'm programming in Coffeescript, I never feel like I'm missing out. When I'm programming in JS, I'm frustrated by all the parens and "function"s that I have to type, but otherwise quite content. I like types, though, so will probably checkout typescript or something similar one day.
- voltagex_ 11y agoWhat would help is if the Node.js foundation could ship a Node Runtime, similar to the CLR for each platform and then applications could use that. You know, dynamic linking like we've done forever. Go and Node seem to be heading back to static linking. Meanwhile Australia is getting left further and further behind. Our internet speed isn't increasing, yet webpages, games, movies and applications are getting bigger and bigger. Help!
- scrollaway 11y agoI'm going to elaborate on your comment a bit because this infuriates me and I don't think people truly understand the reasons behind why web-apps-for-desktop generally suck and there's nothing you can do to fix it in yours. Background: I'm the lead dev/UX on LXQt, a linux desktop environment (http://lxqt.org/ http://lxqt.org/). First one that comes to mind is accessibility and consistency of interactions. Apps that do not respect a host of user settings because the devs don't even know they exist -- but on desktop frameworks, you get these for free. You find this on the web, too. People hijacking scrolling behaviour on websites, without a damn clue that not everybody is on a fucking iphone. You don't respect smoothscroll options, you don't respect autoscroll, you don't respect lines-per-tick, it's infuriating. Zooming? What's that? Let me disable it for whatever hacky performance reason. Who zooms anyway, people who can't see well? FUCK EM! There's a lot of those examples. Maybe one day I'll write about all of them. They infuriate me as both a user (who is used to some specific behaviour) and a UX guy. Second reason is the performance. Both in executable size and general runtime performance, as you yourself mentioned. We, as engineers, spent a lot of time and effort working around all the design flaws of js and the web because it was the most pragmatic thing to do. But if you bring these problems with you on the desktop, you are doomed to lowering the quality of the experience we have on our machines. And the user won't understand why their battery now drains at twice the rate - they'll blame it on Lenovo's shitty hardware, so you can get away with it. sighs And the final one is the direct consequence of lowering the barrier of entry. You often deal with worse quality code. Because of the reasons I cited above, serious devs work with different languages when dealing with the desktop. There are better ways, that's the worst thing. Qt and QML are extremely productive, work well on mobile and don't have all of these issues. They also work on more platforms than you'd be able to enumerate. Don't get me wrong, I am a proponent of lowering the barrier of entry, and I want to bring the advantages of the web to the desktop. But you can't just move the web there, lest you get its serious flaws and throw away decades of good engineering and UX.
- david_ar 11y agoThis! I don't particularly care what technology people use to write apps, so long as it works well. As others in this thread have said, you can immediately spot a web-app-pretending-to-be-native because it doesn't work well. QML appears to offer the best of both worlds - I don't understand why it isn't more popular?
- ojr 11y agoCoffeescript is a compiler/transpiler and Babel does a much better job of doing it, Javascript has all the requirements you want in the "Next Big Language", dynamic languages will have pitfalls, implementing type coercion and lexer/parser optimization are the reason for some of the "wat" stuff in that video, if the speaker made a a popular language like javascript he would have a better understanding of why some of those pitfalls end up existing
- sankluj 11y agoI actually find that Spotify is a good example of a well made JS desktop app: _ I used it on Windows, OSX and several Linux distros and really like the fact that the experience is the same everywhere. _ No notable performance issues even with modest configs. It's been always usable in my experience. _ Install size is on par with its competitors _ Never noticed battery draining but I'll probably keep an eye out for this one now that you made me think about it :) I really doubt that a normal user would notice a difference. Concerning code maintenance, it would be interesting to hear the opinion of someone who worked on such a complex desktop hybrid app.