Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Why do people use javascript frameworks?

    My question is why do people use JQUERY etc for everything?

    Everyone at my uni uses this JQUERY, i choose not to and code everything in just javascript; my goal is to learn to code great a new ****.

    Am i wrong or right? is this the right approach to take if i want to learn javascript?

    Are JQUERY users wannabee coders? or do professionals use it to develop too?

  • #2
    Senior Coder Rowsdower!'s Avatar
    Join Date
    Oct 2008
    Location
    Some say it's everything.
    Posts
    2,027
    Thanks
    5
    Thanked 397 Times in 390 Posts
    jQuery enjoys extremely wide use, for better or for worse. You almost can't escape it. The benefit to using a framework rather than strictly "home-grown" javascript is that coding is faster and easier and, in the case of jQuery, it's pretty well tested and likely to work in every major browser. It is also more portable since it is written to a standar. It's basically worry-free.

    That said, it comes with overhead (bandwidth, page load time, what have you). I have seen people load up the jQuery framework for something as simple as an alert. I wanted to slap someone when I saw that. People use it as a crutch, sure. And we have all seen that.

    But to a larger and more significant degree it is used well and saves a lot of people - professional and otherwise - a lot of time and grief. I think learning both methods is important. I think learning to code "vanilla" first is best since you can then get a better understanding of what code does and how the DOM reacts...and why. People who never venture outside of their frameworks will generally not understand any of that and it tends to limit their coding ability. Once you understand the beast then use a framework where it makes sense to do so. And write your own extensions for it, too!

    That's my official opinion on it, at least.
    The object of opening the mind, as of opening the mouth, is to shut it again on something solid. –G.K. Chesterton
    See Mediocrity in its Infancy
    It's usually a good idea to start out with this at the VERY TOP of your CSS: * {border:0;margin:0;padding:0;}
    Seek and you shall find... basically:
    validate your markup | view your page cross-browser/cross-platform | free web tutorials | free hosting

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,785
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Basic JavaScript can become really repetetive when you do a lot of DOM manipulation. That’s why some smart people wrote a few functions to make it easier and quicker to execute similar functions over and over again. For example, rather than perpetually writing
    Code:
    document.getElementById('example')…
    document.getElementById('whatever')…
    document.getElementById('another_element')…
    You can write a function that’s shorter, like (simplified for demonstration):
    Code:
    function getEl(element_id) {
      document.getElementById(element_id')…
    }
    and then just call
    Code:
    getEl('example')…
    getEl('whatever')…
    getEl('another_element')…
    So, there you have your very very basic framework yourself. That’s how jQuery came to be. The drawback of making it so easy to use is – as with everything – that every idiot tends to use it now without knowing why and what they are doing. So you’re still way ahead of the crowd if you still know raw JavaScript.

  • #4
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,401
    Thanks
    11
    Thanked 595 Times in 575 Posts
    there are no wrong or rights in programming, that like asking if a truck is better than a car...

    there's a perception that jQuery makes development faster and easier. If that's true or not depends on the coder's skill/knowledge, the target device range, and the project requirements.

    can it be mis-used? sure, it's definitely over-used, no question about it. But that doesn't mean that every use is superfluous. In particular, supporting 3+ year old browsers is a lot easier with jQuery than raw js.

    With modern devices, document.querySelectorAll (IE8+) provides THE killer feature of jQuery: css selectors for dom elements. Turning that collection into an array allows "Array 1.6" methods like forEach, filter, and reduce to be chained together, much like jQuery. In short, browsers have actually responded to back pressure produced by jQuery...

    Few devs seem to trust that anyone has anything other than a 5 year old system with IE7 running on it. Look at the sheer volume of dogma about "progressive enhancement", aka apologetic programming. there's a perception that the 10% of folks who get left behind are more important than the 90% who have up-to-date configurations.

    in terms of learning, learn CS, then JS, then jQuery. if you do it backwards you'll be a bad programmer for a lot longer while you slowly unravel what's really going on. If you understand the foundational basics, it's easier to at least imagine how different jQuery chunks are implemented. If you understand that, you'll be in a strong posistion to deliver the optimal solution, jQuery or otherwise; you can DIY if you know JS.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #5
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,785
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Quote Originally Posted by rnd me View Post
    Look at the sheer volume of dogma about "progressive enhancement", aka apologetic programming. there's a perception that the 10% of folks who get left behind are more important than the 90% who have up-to-date configurations.
    You’re seeing this from the wrong perspective. I see progressive enhancement actually as a part of semantic web development. Everything on a website has a meaning. If it doesn’t it’s useless and shouldn’t be there in the first place. And if something meaningful is missing in the HTML (because it’s only added dynamically) then the content makes no sense either, in the worst case.

    This is not just about outdated browsers or users with JS disabled, this is simply part of the semantic web. A web that is accessible and machine readable to facilitate the holistic user experience.

  • #6
    Regular Coder
    Join Date
    Aug 2010
    Posts
    974
    Thanks
    19
    Thanked 212 Times in 210 Posts
    Has anyone mentioned the real value
    of frameworks is easier collaboration
    between somewhat isolated programmers ?

  • #7
    Regular Coder
    Join Date
    Aug 2011
    Posts
    120
    Thanks
    1
    Thanked 15 Times in 15 Posts
    Quote Originally Posted by VIPStephan View Post
    Everything on a website has a meaning. If it doesn’t it’s useless and shouldn’t be there in the first place. And if something meaningful is missing in the HTML (because it’s only added dynamically) then the content makes no sense either, in the worst case.
    I agree with you for the most part. The point that I would differ on is the word 'meaning.' Does an advertisement have a meaning? Not without stretching the bounds of the meaning of 'meaning.' It has an intention.

    A great deal of the web lacks coherent intention. Take any main-stream business' website as an example. The first thing you notice is most likely a banner that takes up the top third of the screen that shows off some basically useless graphic that either has no information at all or has information that you already knew about before you navigated there, like their name.

    Programming is not immune to this uselessness. A framework abbreviates development time by providing many lines of code that do not have to be written but may not add anything relevant to the end product.

  • #8
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,785
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Quote Originally Posted by M.Jackson View Post
    Does an advertisement have a meaning?
    By “everything has a meaning” I mean in the document’s mark-up everything that’s there should have a meaning, a reason to be there: An empty div bears no meaning (content/mark-up wise), hence it shouldn’t be there in the first place. A “print page” link has no meaning by itself because without JS you can’t print a page by clicking on that link. So, since it only works with JS anyway, you can as well add it with JS dynamically.

    Likewise, if you add some content with JS that could be relevant for the understanding (or if an actual link to a physical file with that information is missing) that means it’s missing in the document’s body as hard coded HTML/content which renders it inaccessible for devices and some people.
    But that goes beyond the scope of this thread. I just wanted to clarify. Let’s not get too much off-topic. jQuery is useful if used properly.

  • #9
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also another point i would like add to this thread is; do people realy find satisfaction from using JQUERY in web development?

    I for one find it more satisfying and rewarding to hardcode the site in javascript rather than just using the JQUERY library.

    For example, making your own library and using it in your own websites; this is so much more satisfying for me anyways.

    I'm new to javascript, spent yesterday coding my own library to call PHP functions and return the values to a speicifed div from one simple function. So much more satisfying than just using the JQUERY stuff.

    If i do it this way am i being ignorant? and would it make me incapable of reading other peoples code?
    Last edited by NickyYo; 08-30-2011 at 05:31 PM.

  • #10
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,785
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Yeah, if you’ve got the time to reinvent the wheel that may be fine. But in a professional environment using a library just takes less time to perform a task or complete the project and this is what matters most there.

  • #11
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,401
    Thanks
    11
    Thanked 595 Times in 575 Posts
    Quote Originally Posted by NickyYo

    Also another point i would like add to this thread is; do people realy find satisfaction from using JQUERY in web development?

    I for one find it more satisfying and rewarding to hardcode the site in javascript rather than just using the JQUERY library.

    For example, making your own library and using it in your own websites; this is so much more satisfying for me anyways.

    I'm new to javascript, spent yesterday coding my own library to call PHP functions and return the values to a speicifed div from one simple function. So much more satisfying than just using the JQUERY stuff.

    If i do it this way am i being ignorant? and would it make me incapable of reading other peoples code?
    DIY is the best way to learn, but can take longer to implement far and wide on public sites. for personal, internet, or other controlled environments, modern browsers are powerful and standardized enough that simply setting your bar as any browser within the last year as a pre-req, you can make RAD apps without frameworks. it's not like you can't write jquery if you know js, but try taking jquery away from a script kiddie and see how far how quick he gets... furthermore, jquery is not compatible with a lof of javascript enviroments, so if that's the only way you know to map a function against an array, you're gonna be screwed when you work in your first non-browser js environment. these are increasingly common; node.js, win8, raw V8, jsc, .net, etc. so, if all you do is browser work, jquery might help you spruce up an existing site with less effort, but it won't help you get a new site of the ground.


    Quote Originally Posted by VIPStephan View Post

    Likewise, if you add some content with JS that could be relevant for the understanding (or if an actual link to a physical file with that information is missing) that means it’s missing in the document’s body as hard coded HTML/content which renders it inaccessible for devices and some people.
    sorry top continue off-topic, but no it doesn't.
    AT (screen readers) uses the dom, so injected content is seen just like hard-coded content. maximum interactive accessibility actual REQUIRES javascript not prohibits it. very few devices (and fewer every day) that people want to use don't run js. while i agree wholeheartedly in the spirit of compatibility and accessibility, the whole static html take is outmoded. APIs provide better access to meaningful content and descriptive meta than html syntax ever will, so the need is far less. RSS is darn accessible on lots and lots of devices; my phone shows them in a widget...

    The html4 way of doing lifeless documents has begun to run thin, while web apps are just beginning to become expected by the masses. if you want to make online brochures, go for it, but don't expect to wow anyone these days by doing so.
    Last edited by rnd me; 08-30-2011 at 10:05 PM.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/9/03) IE7:0.1, IE8:4.6, IE11:9.1, IE9:3.1, IE10:3.0, FF:17.2, CH:46, SF:11.4, NON-MOUSE:38%

  • #12
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,785
    Thanks
    6
    Thanked 1,022 Times in 995 Posts
    Quote Originally Posted by rnd me View Post
    The html4 way of doing lifeless documents has begun to run thin, while web apps are just beginning to become expected by the masses. if you want to make online brochures, go for it, but don't expect to wow anyone these days by doing so.
    You seem to ignore that not every website is a “web app” and never will there be a need to display all plain information (and that’s what it’s eventually all about) in a super flashy interactive way. And why does one have to “wow” anyone with everything? I’m not using Google docs for the “wow” effect but because it’s practical (hypothetically spoken – I’m not actually using Google docs). Apart from all the “cool” effects like dragging and dropping, swiping, rotating, and instantly updating content the plain information is still marked up as good ol’ HTML (or XML) and will most likely be for years to come. Even Facebook and the like could easily work without JavaScript (and without losing any of its basic abilities – displaying and updating content, that is) and still be just as usable (not that I care about Facebook, just saying it could).

    So, let’s not forget what the web is and will likely be for the next few years: an ever growing collection of information, be it editable on the client side or not. And information is marked up as HTML. If every program is theoretically able to parse JS then why would there be any need to write plain HTML anyway? Why not do everything with JS? Why have separation of presentation and content and behavioral separation been invented? Or are these all outdated principles now since we’re able to update content asynchronously?

  • #13
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,788
    Thanks
    8
    Thanked 131 Times in 129 Posts
    Quote Originally Posted by DaveyErwin View Post
    Has anyone mentioned the real value
    of frameworks is easier collaboration
    between somewhat isolated programmers ?
    I think this is a very good point. I work in an environment with developers from (that I know of) six states and five countries. Using a common framework makes it a whole lot easier to pick up code written by someone else later. A lot of the time, by the time another dev touches the code, the original writer has moved on from the company entirely.

    Quote Originally Posted by NickyYo
    For example, making your own library and using it in your own websites; this is so much more satisfying for me anyways.
    True, making your own projects from scratch does leave a little more "ahhh" factor most of the time. But, when you are working on a team and on a site that has thousands of pages with literally millions of views a month, the feasibility of rolling your own is small.

    Quote Originally Posted by NickyYo
    do people realy find satisfaction from using JQUERY in web development?
    I think your looking at it the wrong way. I don't get satisfaction in using a particular js framework or for that matter a PHP framework. What you should get satisfaction in is the final product whether you used a framework or not. If you are learning along the way is more important. Even after you master JavaScript and you then master a framework, there will hopefully still be challenges to learn from.
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis

  • #14
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Quote Originally Posted by harbingerOTV View Post
    True, making your own projects from scratch does leave a little more "ahhh" factor most of the time. But, when you are working on a team and on a site that has thousands of pages with literally millions of views a month, the feasibility of rolling your own is small.
    Not to mention using a framework can reduce the number of bugs in your final product. If you roll your own cross browser JavaScript library you have to deal with the bugs in your library plus the code exercising it.

    Not to say jQuery is bug free but the chances that a bug will be a found and fixed for you is much higher. Then all you have to do is upgrade to a newer version to fix it.
    OracleGuy


  •  

    Posting Permissions

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