8 ms·
Please forgive the simple question, but... Why does this exist? Is creating desktop programs out of HTML code really a good idea?
by eykanal 11y ago
Please forgive the simple question, but...
Why does this exist? Is creating desktop programs out of HTML code really a good idea?
- tuananh 11y agoweb-based apps; like Spotify?
- voltagex_ 11y agoBecause NodeJS is popular and desktop apps were getting small and efficient so we crammed a 30MB Chrome runtime in there.
- laichzeit0 11y agoActually it's more like this: That ugly language called Javascript that everyone derided and said was "too shit and slow to ever write a Demo in" back in the 90s when all the "real developers" were writing server side scripts in Perl and left the frontend people to their own devices caught up with them. They kept pushing the boundaries, discovering things like XMLHttpRequest, and using that crap little language. Eventually big players like Google started throwing a lot of money at the problem and Javascript became usable enough to write apps in. The front end people that all the cool Perl kids derided needed something on the backend. They wern't going to touch Perl since by this time it was an old languishing dinosaur and there was a bad taste left in their mouth. And thus NodeJS was born. The frontend dev could write his server side stuff in the one language he knew. This is my completely biased and highly selective history of events ;)
- voltagex_ 11y agoYep. If this is the only thing stopping native apps from disappearing completely then it's probably a good thing.
- jakejake 11y agoExcept the perl kids weren't cool (I was one of them) because they didn't write c++, and they weren't cool because they didn't write assembly, and on on!
- MichaelGG 11y agoServer-side JavaScript was a thing in the 90s with Classic ASP.
- fyolnish 11y agoThey discovered a documented browser feature? Hooray for that.
- 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.
- izacus 11y agoWe also almost managed to let blind and other impaired people use their computers via OS-level accessibility settings and features so now we need to throw all that away :)
- voltagex_ 11y agoCrap, does Chromium-via-electron not advertise the correct accessibility things for Windows?
- shoover 11y agoHow about NodeJS bindings to a native desktop library of choice and a React.js backend to said library slipped in? They're decoupling the React API from the DOM, right?
- bjt 11y agoYeah, react-dom is a separate package now.
- ludbb 11y agoI see it as an initial step towards actual native code generation. I would rather use that than the likes of Qt QML if it actually produced native code.
- evinism 11y agoThis is the question I was going to ask. It seems like porting many of the poor decisions that were made in creating the web to native desktop.
- marcus_holmes 11y agoBut that's the point of React - providing an abstraction layer over the poor decisions that were made in creating the web. Apart from Javascript, of course. But that particular "bad decision" is getting modified with every version into something more acceptable ("now with classes!"). I guess the endpoint is that React + Javascript (+ Redux) becomes the defacto language for developing UIs in, and what implements that abstraction layer is immaterial. React-native all the things!
- IshKebab 11y ago> But that particular "bad decision" is getting modified with every version into something more acceptable True, but it definitely seems like they're only fixing the low-hanging fruit. They're never going to fix the insane type system.
- marcus_holmes 11y agoI know I'm a nutter, but I like the type system :) I like that there's "==" and "===", because that's exactly how I think. It fits my use case of "is this the same value as that?" or "is this really equal to that?" exactly. I like that types are fluid, flexible and never get in my way. But there's a religious war here that I think got won by the static type side, so I'm not going there again ;)
- Tehnix 11y agoBecause working with things like GTK and QT is horrible compared to working with HTML/JS/CSS, for anything other than trivial things. That said, it'd be cool to have native code generation from this though.
- discreteevent 11y agoHave you used Qt and QML? For me it's much more productive and straightforward than html/js/css. Delarative legible ui with built in dataflow/reactive properties. Performs straight out of the box without having figure out how to work with the mechanisms buried in this hugely complex and opaque machine called a browser. In fact its a relief to work with it. Could you say where you think its so 'horrible'.
- jnbiche 11y agoAgreed. Assuming they took this to its full potential, and created native, cross-platform, desktop widgets for React, what they'd end up with would look startingly similar to QML, except without the easy C++ interop. I'm a fan of React, but I have no desire to use it outside of the web, and maybe mobile (still on the fence there). For desktop, we have QT, which is truly an awesome native widget toolkit, with many thousands of man-years work in it, excellent cross-platform desktop coverage, along with pretty good accessibility standards.
- makecheck 11y agoAlthough I've never had to start from scratch, the Qt projects I've maintained have been prone to crashing. Maybe the Qt apps have legitimate bugs but the fact is that native environments like Objective-C, and most likely this JavaScript environment, would both handle those issues very cleanly compared to Qt.
- lobster_johnson 11y agoDo you know of any modern OS X apps written with Qt that have a native look and feel that, in particular, take advantage of Core Animation for UI transitions? All the Qt apps I have touched (Google Earth comes to mind) have neither looked nor felt native on OS X, much like Swing and SWT apps don't at all feel native. Whereas all the best apps are written in native Cocoa.
- moretti 11y agoYou're probably not familiar with Atwood's Law[0]: > Any application that can be written in JavaScript, will eventually be written in JavaScript [0]: http://blog.codinghorror.com/the-principle-of-least-power/ http://blog.codinghorror.com/the-principle-of-least-power/