7 ms·
Writing Desktop Class Applications in JavaScript
- blahbap 14y agoYou should have a look at AngularJS. It's two way binding and declarative philosophy makes it very tidy and true to the MVC paradigm.
- cheez 14y agoGreat library. Just watched the demo.
- rimantas 14y agoOh demo… So it usually goes as this: great demo, should try -> hey building some PoC is so easy -> hm, how do I get around this corner case -> hm, how do I implement this particular thing -> damn, how do I debug that? -> fuck it, we ar going native.
- blahbap 14y agoThat might be your experience, but I don't agree as for Angular. We are building a "desktop application" using AngularJS just now. The application is a visualization of the status of multiple systems over time - nothing very complex, but still it is a real application. I have not yet been disappointed by Angular - I love being able to build my model, and then bind all my views to the model and all the views update automagically whenever one of the views update the model.
- cheez 14y agoCould be.
- edwinyzh 14y agoAgreed! AngularJS makes the code so concise and easy to read! I'm even considering adding specific support for it in my LIVEditor project (a live html/css/js code editor).
- kevingadd 14y agoThe article mentions debugging support in Webkit for Objective-J/Cappucino, but it's my understanding that it's only there in Safari, not Chromium: http://code.google.com/p/chromium/issues/detail?id=17356 http://code.google.com/p/chromium/issues/detail?id=17356
- zinssmeister 14y agosproutcore is probably the most complete framework to deliver desktop class apps. But I find the combination of Backbone.js and the Handlebars.js template engine very effective as well. They feel lighter and not so set in stone.
- swah 14y agoI`ve been using Backbone, and one thing I forget all the time and bothers me is when you use Jquery plugins on elements that get re-rendered from templates (then you have to initialize the plugin on the element again, etc - for example, something like the Jquery UI Slider).
- elliottkember 14y agoTry breaking up your render method into smaller chunks, and only re-rendering content that needs replacing. You can even leave the el if it exists already, and just update text or form fields.
- swah 14y agoI do that in some places, but its much harder to this.$el.find and replace elements than just re-running the template.
- some1else 14y agoThe render method is the right place to hook things up with the DOM. Although I trust the garbage collection is up to par when it comes to forgotten DOM elements, I've recently started implementing destroy methods on views that deal with more complex jQuery plugins. Some plug-ins implement destroy methods themselves, but in some places I just unbind the few events manually.
- rsanchez1 14y agoI'm going with Enyo: http://www.enyojs.com http://www.enyojs.com
- seltzered_ 14y agoHmm, I was looking at appcelerator last year, it's used by wunderlist for their desktop app: https://github.com/6wunderkinder/wunderlist https://github.com/6wunderkinder/wunderlist
- scottfr 14y agoI've had a problem with Appcelerator and using the ExtJS framework. Appcelerator seems to do something strange with the DOM that can break Ext. There's also Adobe Air, but its security policy breaks a lot of existing JS. In my case, I just ended up writing a wrapper for my app in QT.
- zachwill 14y agoI used to think the solution to the web’s gotchas was a framework to conform the web to a native app mentality. I built and deployed web apps with these stacks. I would never do it again. These frameworks build abstractions on top of abstractions. In every non-trivial app I worked on, the top abstractions leak, and you still have to hack HTML and CSS. Web technology is great for many things. Replicating a native app experience is not one of them. http://sandofsky.com/blog/shell-apps.html http://sandofsky.com/blog/shell-apps.html
- mkmcdonald 14y ago> Web technology is great for many things. Replicating a native app experience is not one of them. Yep. The client-side environment is far too unstable to build a "native app". There's a reason why monumental frameworks like ExtJS barely work in IE 9.
- MatthewPhillips 14y agoWindows 8 allows you to build native apps in HTML/JS. You would be very hard pressed to tell any difference at all.
- TazeTSchnitzel 14y agoWindows 8 also provides a consistent set of APIs across all languages supported: JScript, C#, C++ and VB.NET. There's nothing you can do in C# that you can't do in JScript on Windows 8, with the possible exception of DirectX.
- wmf 14y agoAre we talking plain vanilla HTML/JS or HTML/JS+Metro extensions? Also, I guess those apps don't have to be cross-browser.
- MatthewPhillips 14y agoThere are extensions.
- Detrus 14y agoHow old is this article? Seems that most JS MVC frameworks appeared after it was written.
- kirbysayshi 14y agoI agree, this article feels like it was written in 2006. While the analysis of Obj-J is spot on, does anyone actually use it anymore? I would never consider it a viable framework, especially with the proliferation of top-notch, extremely active community-driven projects, like Backbone, Ember, Knockback, Spine, Angular, and so many others.
- Vekz 14y agoAgreed. Ember.js was originally named Sproutcore 2.0 and is a much better successor.
- harel 14y agoExtJS from Sencha is lightyears ahead of any other JS framework as far as a polished UI toolkit goes. Its not free if you're not free and open source yourself, but its worth every penny.
- taligent 14y agoFantastic framework but they really need to demonstrate the ability to theme the UI in much more dramatic ways that I've seen to date. Because right now it looks like something that belongs on Windows 95.
- harel 14y agoOh its very themable. You can dramatically change the way it looks, but you need to know the CSS structure. They should focus more on that, I agree.
- gouranga 14y agoThere appears to be a lot of FUD in that article which is unjustified or loosely cited. For example the following paragraph: "Standardization is slow, so proprietary platforms are the first to solve problems. Flash, Silverlight, and JavaFX offer desktop like frameworks but carry technical flaws: the iPhone doesn’t support them, vendors may break things at any time, and the runtimes are often slower than JavaScript." Most of it is rubbish. However, I'm a firm believer that if you're going to build desktop class applications, you do it in a desktop class runtime, not JavaScript. If you have Java installed on your workstation, click here to launch ArgoUML (UML editor). This is what I expect from a "desktop class application" from deployment to usability: http://argouml-downloads.tigris.org/jws/argouml-latest-stable.jnlp http://argouml-downloads.tigris.org/jws/argouml-latest-stabl...
- jawngee 14y agoNo offense, but your aesthetic sensibilities suck if you think this argo UML is a desktop class application in the realm of natively built desktop class apps. These apps belong to what I refer to as the "just barely good enough" class of desktop apps. Doesn't look native, doesn't feel native, aesthetics are strictly academic stuck in the 1990's and usability is just north of nominal. This is a prime example. Fonts, control spacing, inconsistent sizing, 8-bit aliased bitmaps ... it looks like crap compared to a native app like OmniGraffle.
- gouranga 14y agoNo offense taken. Perhaps a bad example aesthetically I agree, but otherwise the experience is good. Please note that Argo is a heavyweight engineering tool with metadata, not a pretty picture generator. It's an order of magnitude more powerful with respect to semantic modelling. What it looks like is less important that how it works in that sector. EDIT: also regarding native appearance. Every web site looks different - should have a common stylesheet for everyone? No.
- batista 14y ago>If you have Java installed on your workstation, click here to launch ArgoUML (UML editor). This is what I expect from a "desktop class application" from deployment to usability Is this a joke? That would be barely tolerable for 2000. Slow, clunky, non-native feeling, the bad kind of cross-platform, a UI beaten with the ugly stick and very little thinking about usability issues.
- nebiros 14y agoWhat about AppJS (http://appjs.org/ http://appjs.org/)?, I never use it, but it seems promising.
- jebblue 14y agoThe dark page with white text hurt my eyes so bad I couldn't stand to look at it let alone read it.
- jebblue 14y agoWhy does it say -1 points? Do some people have the ability to reduce the points on posts they don't like and aren't even required to post why?
- sandofsky 14y agoSince I wrote this post in 2009, my opinion changed. You're better off letting the web act like the web, and leave app interactions for native apps. I've updated the preface to say as much.
- 6ren 14y agoI started building a desktop app last year, but realized that many features I'd come to expect from using reddit/HN (like spell-check, and familiar keyboard short-cuts) weren't there, and I'd have to re-implement each one to mimic the web experience. (Do native apps for mobile get these for free?) Webapps have surreptitiously become my standard for app features.
- sandofsky 14y agoOn the Mac, you can enable continuous spell checking by calling -[NSTextField setContinuousSpellCheckingEnabled:YES]. On iOS, continuous spell checking is on by default. If you want to put together really simple interactions, then a web page will get you off the ground fast. The problem is when you get to the details. Harder things become more difficult, or just impossible. For example, I don't think there's any way to control a browser's spell checker, beyond turning it on and off for a given field. (Correct me if I'm wrong.) In a native app, I have implemented functionality so the spell checker would ignore text with a certain pattern, but spell check the rest of the input.