Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Vanilla Javascript

  • 01-05-2013 10:00pm
    #1
    Registered Users, Registered Users 2 Posts: 403 ✭✭


    Ok so I realise this is a joke, I first the heard the term 'Vanilla Javascript on one of Scott Hanselman's podcasts (not sure which one), and Mozilla's Christian Heilmann had a few things to say about it on a more recent podcast with him.

    Is there a move away from frameworks back to standard Javascript in the interest of performance on mobile devices?

    Is JQuery dead?

    I had been looking at Typescript and AngularJS as possible technologies to learn in the near future, would my time be better spent learning good design patterns in standard Javascript?

    Interested in peoples thoughts on this.


Comments

  • Registered Users, Registered Users 2 Posts: 4,509 ✭✭✭robbiezero


    Ok so I realise this is a joke, I first the heard the term 'Vanilla Javascript on one of Scott Hanselman's podcasts (not sure which one), and Mozilla's Christian Heilmann had a few things to say about it on a more recent podcast with him.

    Is there a move away from frameworks back to standard Javascript in the interest of performance on mobile devices?

    Is JQuery dead?

    I had been looking at Typescript and AngularJS as possible technologies to learn in the near future, would my time be better spent learning good design patterns in standard Javascript?

    Interested in peoples thoughts on this.

    Why would standard Javascript be more performant on mobile devices than say the JQuery library?
    Do you mean JQuery UI?


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    For most modern browsers, jQuery is not required. A few wrappers will suffice for querying (QSA), attribute handling and event handling.

    I find libraries like PhoneGap, Sencha grotesque for mobile, overkill and dog slow for the most part. Less is always more when it comes to mobile. Decent mobile devices support CSS3 hardware acceleration these days.

    Angular and Knockout are pretty cool, as well as stuff like SignalR


  • Registered Users, Registered Users 2 Posts: 403 ✭✭counterpointaud


    robbiezero wrote: »
    Why would standard Javascript be more performant on mobile devices than say the JQuery library?
    Do you mean JQuery UI?

    Ok we are only talking about miliseconds in most cases, but it is slower. For some applications, on some networks/devices/countries, that could be an issue.

    http://jsperf.com/vanilla-js-vs-jquery

    I love JQuery, and really like what I have seen of Typescipt and Angular, but am just wondering if this is the start of a wider trend.

    There is also a lot of cross-browser and legacy browser code running under the hood with JQuery which may not be appropriate in all situations, no?


  • Registered Users, Registered Users 2 Posts: 403 ✭✭counterpointaud


    Giblet wrote: »
    For most modern browsers, jQuery is not required. A few wrappers will suffice for querying (QSA), attribute handling and event handling.

    I find libraries like PhoneGap, Sencha grotesque for mobile, overkill and dog slow for the most part. Less is always more when it comes to mobile. Decent mobile devices support CSS3 hardware acceleration these days.

    Angular and Knockout are pretty cool, as well as stuff like SignalR

    Could you expand on that a little? You are saying that implementing things via the new CSS features wherever possible (rather than Javascript) is the way to go when developing for mobile, right?

    Interesting that you have found Phonegap slow, I have heard a few people say that.


  • Registered Users, Registered Users 2 Posts: 11,989 ✭✭✭✭Giblet


    You use javascript to do things like add a class (http://davidwalsh.name/classlist)
    The default style declares a transition and a 3d translation, the added class defines the target of that transition.
    You can use javascript to measure (most cases you use 100% or whatever anyway!).

    There are simple methods to determine viewport positions via javascript, a few lines of reusable code tops.

    I made a mistake saying PhoneGap is slow, it really doesn't do too much. When used in conjunction with something like jQuery Mobile or Sencha, it really becomes a bad combo.

    It all depends on context. What do you need to support. If you need to support multiple contexts, maybe some feature detection for those features that cause sticking points. (Say, event handling in old IE).

    The biggest issue with older browsers is querying. You really need to ask yourself why you are doing complex querying in JavaScript in the first place, when you could structure stuff better and use simple gEBTN or gEBI, and a few traversal methods for getting parents/children or siblings. Modern browsers can use native querying through querySelectorAll.


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,021 ✭✭✭ChRoMe


    We have banned jQuery mobile at our agency, way too much bloat for the mobile platform.

    Regular jQuery is still used on the desktop sites.


Advertisement