Web Analytics Made Easy -
StatCounter Why do people use javascript frameworks? - CodingForum

Announcement

Collapse
No announcement yet.

Why do people use javascript frameworks?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new 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
    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

    Comment


    • #3
      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.
      Stop solving problems you don’t yet have!

      Comment


      • #4
        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.
        Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

        Comment


        • #5
          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.
          Stop solving problems you don’t yet have!

          Comment


          • #6
            Has anyone mentioned the real value
            of frameworks is easier collaboration
            between somewhat isolated programmers ?

            Comment


            • #7
              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.

              Comment


              • #8
                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.
                Stop solving problems you don’t yet have!

                Comment


                • #9
                  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; Aug 30, 2011, 12:31 PM.

                  Comment


                  • #10
                    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.
                    Stop solving problems you don’t yet have!

                    Comment


                    • #11
                      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.


                      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; Aug 30, 2011, 05:05 PM.
                      Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com

                      Comment


                      • #12
                        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?
                        Stop solving problems you don’t yet have!

                        Comment


                        • #13
                          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.

                          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.

                          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

                          Comment


                          • #14
                            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

                            Comment

                            Working...
                            X
                            😀
                            🥰
                            🤢
                            😎
                            😡
                            👍
                            👎