SitePoint Sponsor

User Tag List

View Poll Results: Which JS Library you prefer to use for creating desktop type web applications?

Voters
53. You may not vote on this poll
  • JQuery

    34 64.15%
  • YUI

    1 1.89%
  • Prototype

    1 1.89%
  • Ext JS

    11 20.75%
  • Moo Tools

    5 9.43%
  • DOJO

    2 3.77%
  • Mochikit

    0 0%
  • Other

    4 7.55%
  • Will create my own library

    8 15.09%
Multiple Choice Poll.
Page 1 of 11 12345 ... LastLast
Results 1 to 25 of 262
  1. #1
    SitePoint Enthusiast alokjain_lucky's Avatar
    Join Date
    Feb 2008
    Location
    India
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to build a desktop like application interface using JavaScript?

    Hi

    I just came across following demo application: http://mochaui.com/demo/

    I have a few questions about this:
    1. What is the right approach to start a project, which have heavy use of JS?
    2. how to choose which library is best, or one should develop his own library specific to requirements to keep the file size smaller?
    3. Can you suggest any study material (tutorials or books etc.) to learn building this type of interfaces.


    Thanks.

  2. #2
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can build a true Windows desktop application (as opposed to a "desktop-like" application) in JavaScript and HTML with Windows HTML Application Host (HTA).

    http://msdn.microsoft.com/en-us/libr...8VS.85%29.aspx

    If you choose this route, you won't have to worry about cross-browser scripting because HTA uses a special mode of Internet Explorer.

    In any case, the size of the scripting library or framework wouldn't be a major issue in a continuously-running application because it would only be evaluated once when the page loads.

    It would be a good idea to keep the business logic (e.g., an native JavaScript object model) separate from the presentation (HTMLElement objects and other DOM elements manipulated by jQuery or whatever). Then wire them together with event handlers to obtain the desired interaction between UI and application.

    If directly manipulating DOM elements (via a framework or standard DOM methods) and/or string concatenation proves cumbersome, you can easily evaluate JavaScript Templates (JST) in the context of the model to update entire sections of the page in one operation.

    http://blog.markturansky.com/BetterJ...Templates.html

    The link in my signature is to a small JavaScript application platform that demonstrates some of these ideas.

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Another option is to use Adobe AIR to build the application. JavaSscript is one of the several options available there for writing applications.

    If you are going to create application like web pages for the internet then the most important step is to first get it working without JavaScript.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  4. #4
    SitePoint Enthusiast alokjain_lucky's Avatar
    Join Date
    Feb 2008
    Location
    India
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your comments.

    Quote Originally Posted by World Wide Weird View Post
    If you choose this route, you won't have to worry about cross-browser scripting because HTA uses a special mode of Internet Explorer.
    Do you mean it only works for IE? I think a web application should support all browsers.

    Quote Originally Posted by felgall View Post
    Another option is to use Adobe AIR to build the application. JavaSscript is one of the several options available there for writing applications.
    That's a nice option, but i don't want to force my users to install Adobe AIR to use my application.

    Quote Originally Posted by felgall View Post
    If you are going to create application like web pages for the internet then the most important step is to first get it working without JavaScript.
    I appreciate this thought, but what if application relies heavily on it's interface. I think i will need to create 2 versions: one JS based and another one without JS. What do you suggest?

  5. #5
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by alokjain_lucky View Post
    I appreciate this thought, but what if application relies heavily on it's interface. I think i will need to create 2 versions: one JS based and another one without JS. What do you suggest?
    No you create one version and make sure that it works without any JavaScript. Then you add the JavaScript to that version so as to reduce the number of steps involved in various processes. Creating two separate versions is the wrong approach but one you are likely to end up with if you start adding JavaScript before you finish testing the application without it.

    The sole purpose of JavaScript in a web page is to enhance the functionality already built into the page.

    You might have a ten step process without JavaScript that can be combined all into one step with JavaScript. By building the ten step process first and then adding the JavaScript that combines them into one step those people without JavaScript can still perform the ten steps to achieve what those with JavaScript can do in one and you still only have one version of the application.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  6. #6
    SitePoint Addict telos's Avatar
    Join Date
    Mar 2005
    Location
    192.168.2.34
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    The sole purpose of JavaScript in a web page is to enhance the functionality already built into the page.
    I understand the rationale behind this, but honestly, I don't agree.

    There are certain (and in my business, often) instances where JS is not only required for usability, but because it simply can't be done without it. Certain tools and features, made to accomplish a specific task, require a certain level of technology before they can be used.

    An example of this is gaming. Every new game seems to require an even higher level of hardware. Without this hardware, the graphics and frame rates we expect are not possible - and honestly, I wouldn't play the game on old hardware anyway, because the experience wouldn't be a positive one.

    The same goes for the UI. The level of interactivity and ease-of-use that users have come to expect require certain technologies. Without them, you just can't produce that level of quality.

    Obviously, there are cases when this is not true. Audience is important. If you're site is geared toward third-world countries, you need to build for that. Same with disabilities.

    I have a site that is very heavy on GUI. 10,000 monthly subscribers - and I've never had anyone complain that it "doesn't work with JavaScript turned off". And if I did, I'd tell them nicely that if they don't want to use JavaScript, they don't have to purchase a subscription.

    Why would I do that?

    Simple cost/profit analysis. It doesn't make sense to spend 1/3 (at least) more of the time making it work for 1/10,000 of potential customers. It just doesn't make sense.

    If you want to go 4-wheeling the Utah desert, you have to have a 4 wheel drive vehicle - not to mention bigger tires, good suspension, a roll cage - the list goes on.

    I believe your statement holds true, felgall, for a public sites aimed at the general population. Or perhaps a contact form for lead generation where you don't want any chance that someone can't submit. But when you're talking about an advanced UI with enhanced functionality aimed at a specific end result - it just doesn't make sense.

    (Obviously, if someone does log in and turns JS off, you need to make sure they can't do things (like submit a form) that would cause undesired or dangerous outcomes.)

    PS. By the way, felgall, you're awesome. Thank you for all you contribute to this community! I just disagree with you on this point
    Last edited by telos; Dec 22, 2009 at 05:47. Reason: A PS for felgall

  7. #7
    SitePoint Member
    Join Date
    Dec 2009
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Ajax engine allows the user's interaction with the application to .... you couldn't accomplish the same effects using a technology

  8. #8
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by alokjain_lucky View Post
    Do you mean it only works for IE? I think a web application should support all browsers.
    Yes. It behaves like a Windows application that you download and execute, rather than a website.

  9. #9
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think if you're bent on having a desktop-like interface, you should write two versions. Bolting a modern interactive UI onto an old-fashioned CGI-style website isn't very elegant.

  10. #10
    SitePoint Zealot
    Join Date
    Apr 2009
    Location
    South Florida
    Posts
    187
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What about using silverlight, then you can run multithreaded application on browser and able interact more dynamically with local files.

  11. #11
    Non-Member DelvarWorld's Avatar
    Join Date
    Jul 2004
    Location
    Baloney
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Definitely MooTools or ExtJS. Ext is designed for building complicated RIAs (rich internet applications) and handles all of the layout for you. If you need something very custom go with MooTools. People are only voting for JQuery because they know it. MooTools is better for RIA development because of its class like inheritance. JQuery is mainly a powerful DOM manipulation library.

    YUI is probably also a good choice but I haven't worked with it before.

    Edit: Of course if you plan to sell anything you build with Ext you need to pay for some steep developer licenses.

  12. #12
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by telos View Post
    I believe your statement holds true, felgall, for a public sites aimed at the general population. Or perhaps a contact form for lead generation where you don't want any chance that someone can't submit. But when you're talking about an advanced UI with enhanced functionality aimed at a specific end result - it just doesn't make sense.
    Such an application should either be on an extranet (where only selected people have access at all) or should be written to run outside the web browser using a platform such as Adobe AIR.

    For all public sites on the internet the site needs to be accessible without JavaScript. At least one web site that made the mistake of not building their site that way is now millions of dollars poorer as a result.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  13. #13
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DelvarWorld View Post
    JQuery is mainly a powerful DOM manipulation library.
    I'm glad someone else recognizes that jQuery is primarily a GUI framework and not a full client application platform. That said, I use it extensively with my own client platform, although any other UI library should presumably work with it as well.

  14. #14
    Non-Member DelvarWorld's Avatar
    Join Date
    Jul 2004
    Location
    Baloney
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Also, do NOT roll your own. Anyone suggesting that you make your own javascript library is showing their inexperience with web development (looking at you, darkecho). Frankly, the size of a javascript library is irrelevant. And there are a whole bunch of other reasons not to roll your own. Do NOT do it. You will be sextupling your workload for literally zero gain.

  15. #15
    SitePoint Addict telos's Avatar
    Join Date
    Mar 2005
    Location
    192.168.2.34
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    Such an application should either be on an extranet (where only selected people have access at all) or should be written to run outside the web browser using a platform such as Adobe AIR.

    For all public sites on the internet the site needs to be accessible without JavaScript. At least one web site that made the mistake of not building their site that way is now millions of dollars poorer as a result.
    I completely disagree.

    That's the point of the Internet. To be able to reach the masses easily with you're unique product or information. The point of a profit-oriented site is to make money. If you put too many obstacles and regulations and technical "musts" in the way, it's not worth doing in the first place.

    Why does putting it in AIR fix the problem? Just to say it's not public? If we want to get technical, visiting my site on my server isn't public, either.

  16. #16
    SitePoint Enthusiast bnewton's Avatar
    Join Date
    Nov 2005
    Posts
    31
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think something like Sproutcore would be a better to build a desktop like application interface using JavaScript. It's just about to go 1.0 soon. However Apple already makes use of it in it's Mobile Me and iWorks Services. So I think that would be something to take a look at.

    Also see cappuccino that's look good too, but I think is Sproutcore better.

    Sproutcore Demos

  17. #17
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by telos View Post
    If you put too many obstacles and regulations and technical "musts" in the way, it's not worth doing in the first place.
    I agree with that statement and requiring JavaScript is just such a MAJOR obstacle that will make it not worth doing. That's why ALL web sites should be able to be used without JavaScript.

    If you want to build something that requires JavaScript then the web is the wrong place to build it.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  18. #18
    Non-Member DelvarWorld's Avatar
    Join Date
    Jul 2004
    Location
    Baloney
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bnewton View Post
    I think something like Sproutcore
    Hey sweet their demos don't load in Opera. I will never touch whatever the hell this library is.

  19. #19
    SitePoint Addict telos's Avatar
    Join Date
    Mar 2005
    Location
    192.168.2.34
    Posts
    279
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by felgall View Post
    If you want to build something that requires JavaScript then the web is the wrong place to build it.
    I don't get it. Why not?

    How's that any different than "requiring" them to download software?

  20. #20
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @felgall:

    Is it okay to provide toll free operator assistance for users who experience trouble using a site, or is the developer legally obligated to anticipate every possible difficulty the user may have?

  21. #21
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    France
    Posts
    58
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by DelvarWorld View Post
    Definitely MooTools or ExtJS. Ext is designed for building complicated RIAs (rich internet applications) and handles all of the layout for you.
    Agreed. In fact writing applications with ExtJS feels pretty much like working with C# or Delphi. The underlying HTML and Web environement is (almost) completely abstracted, you just end up manipulating GUI components.

    The learning curve is really steep however.

  22. #22
    We're from teh basements.
    Join Date
    Apr 2007
    Posts
    1,205
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DelvarWorld View Post
    Also, do NOT roll your own. Anyone suggesting that you make your own javascript library is showing their inexperience with web development (looking at you, darkecho). Frankly, the size of a javascript library is irrelevant. And there are a whole bunch of other reasons not to roll your own. Do NOT do it. You will be sextupling your workload for literally zero gain.
    I disagree. I rolled my own (incorporating various third-party packages) to provide shortcuts for common operations that typical DOM-centric JavaScript "frameworks" don't address. The resulting code reusability has saved me countless hours of work. But I only have 10+ years of "inexperience" with JavaScript, so what would I know? All I really know is that I prefer a predictable and repeatable information architecture and interchange protocol to the jQuery-based spaghetti code I see on every site.

  23. #23
    Non-Member DelvarWorld's Avatar
    Join Date
    Jul 2004
    Location
    Baloney
    Posts
    341
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What common operations does JQuery or MooTools not include? Also, I am completely for extending functionality on top of a JavaScript library to include custom things that you need. That's fine. But starting from the ground up puts you in a place you don't want to be. Suddenly you now have to worry about testing your own framework. And cross browser compatibility. And upkeep / efficiency work. I think it's much better to have that side of the workload be on the developers of the library.

    You probably see a lot of spaghetti code because JQuery is the easiest to pick up, and the more new people using it the more instances of awful code you will see. Same thing with PHP, even the tutorials show off awful code. Code quality is independent of the underlying library. However, MooTools does have more logical naming conventions and function returns, and it has the built in class definition system, so I personally find writing elegant code easier in that.

    But why would you want to worry about developing your own library? They're designed for code reusability just as much if not way more than your own personal library. And extending them is a safer bet then trying to reinvent the wheel to get a few custom things.

  24. #24
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,862
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by telos View Post
    I don't get it. Why not?

    How's that any different than "requiring" them to download software?
    Okay - blindfold yourself so you can't see anything. Now when you access the web the web reader you are using to read out what the web page says will allow you to navigate things perfectly well as long as you have JavaScript turned off (assuming your web reader even supports JavaScript). With JavaScript turned on chances are that things will happen that you know nothing about because the JavaScript has done things to the page that the web reader doesn't know about in order to tell you what happened.

    Now download an application to run separately outside the web reader (or just pick one that is already there). That application will typically use the standard windows interface for all of the standard functionality within the application which the program that you are using to talk to you to tell you what is happening on the screen that you can't see recognises so that it can tell you exactly what you are doing.

    So with the appropriate software installed on your computer to cater for the fact that you can't see the standard web pages without JavaScript are usable and the regular applications installed on your own computer are also usable. While it is possible for someone to write the JavaScript for a web page in such a way that the page would still be usable so many sites don't write their JavaScript that way and so the only safe option to ensure you don't end up in a total mess is to keep JavaScript turned off in your web reader.

    Perhaps if you keep the blindfold on while you actually write your application you'll be able to make absolutely certain that it works properly for all users. Of course you still have the problem that not all web readers support JavaScript at all.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">

  25. #25
    SitePoint Addict Mal Curtis's Avatar
    Join Date
    Jul 2009
    Location
    New Zealand
    Posts
    327
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I'd suggest looking into Cappuccino and Atlas


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •