Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Other Discussions
  3. The Insider News
  4. What if we had a great standard library in JavaScript?

What if we had a great standard library in JavaScript?

Scheduled Pinned Locked Moved The Insider News
javascriptcomquestion
10 Posts 7 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kent Sharkey
    wrote on last edited by
    #1

    Thomas Fuchs[^]:

    Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

    25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

    M C R L R 5 Replies Last reply
    0
    • K Kent Sharkey

      Thomas Fuchs[^]:

      Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

      25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

      M Offline
      M Offline
      Marc Clifton
      wrote on last edited by
      #2

      > What if we developers would make things simpler instead of more complex? Amen to that. One of the problems though is of course an artifact created by Git and their ilk. The "oh look, I just wrote something useful, let me share it with the world" even if it's something like:

      int initializeToZero() {return 0;}

      And of course one of the driving forces nowadays is the job interview pre-screening: "do you participate in open source projects? Do you maintain any of your own? Do you have a GitHub account?" We're only touching the tip of the chaos iceberg, it'll be amusing to see how this sorts itself out. Marc

      Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!

      K J 2 Replies Last reply
      0
      • M Marc Clifton

        > What if we developers would make things simpler instead of more complex? Amen to that. One of the problems though is of course an artifact created by Git and their ilk. The "oh look, I just wrote something useful, let me share it with the world" even if it's something like:

        int initializeToZero() {return 0;}

        And of course one of the driving forces nowadays is the job interview pre-screening: "do you participate in open source projects? Do you maintain any of your own? Do you have a GitHub account?" We're only touching the tip of the chaos iceberg, it'll be amusing to see how this sorts itself out. Marc

        Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!

        K Offline
        K Offline
        Kent Sharkey
        wrote on last edited by
        #3

        Marc Clifton wrote:

        int initializeToZero() {return 0;}

        I need to take that as a dependency for a new library I'm working on, but I'll send you a pull request for 20 updated versions (to return 0f, 0x0, ..., and of course, "zero").

        TTFN - Kent

        1 Reply Last reply
        0
        • K Kent Sharkey

          Thomas Fuchs[^]:

          Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

          25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

          C Offline
          C Offline
          Camilo Reyes
          wrote on last edited by
          #4

          I'm more on the "no frameworks" bandwagon now. If you want it done well, do it yourself.

          R 1 Reply Last reply
          0
          • K Kent Sharkey

            Thomas Fuchs[^]:

            Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

            25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

            R Offline
            R Offline
            raddevus
            wrote on last edited by
            #5

            Kent Sharkey wrote:

            What if we had a great standard library in JavaScript?

            Now, just how do you think that makes John Resig* feel when he reads that headline? You got a lot of 'splainin to do. :laugh: *Creator of jQuery (THE STANDARDEST of standard libs for JavaScript). Just because people call it a framework, don't mean it ain't a library. :-D You obviously need some sensitivity training before you continue these blurbs. :laugh:

            My forthcoming book, Launch Your Android App, is available for pre-sale at Amazon.com -- releases on April 1, 2016 (no joke). :)

            1 Reply Last reply
            0
            • C Camilo Reyes

              I'm more on the "no frameworks" bandwagon now. If you want it done well, do it yourself.

              R Offline
              R Offline
              raddevus
              wrote on last edited by
              #6

              Camilo Reyes wrote:

              I'm more on the "no frameworks" bandwagon

              I agree with you. However, here's a counter-point. I really think the problem is that a lot of people use frameworks just because they are there and don't know why they use them. And, what about just the selector stuff from jQuery? You got to admit that the selector stuff on it's own is nice, right? Right? :)

              document.getElementById("first").innerHTML = "super stuff";

              The original is kind of long and ugly.

              $("#first").text("super stuff");

              Plus, it's so much easier to select by class and it works in various browsers and browser versions.

              My forthcoming book, Launch Your Android App, is available for pre-sale at Amazon.com -- releases on April 1, 2016 (no joke). :)

              C 1 Reply Last reply
              0
              • K Kent Sharkey

                Thomas Fuchs[^]:

                Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

                25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

                L Offline
                L Offline
                Lost User
                wrote on last edited by
                #7

                ..it would still be JavaScript X|

                Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^][](X-Clacks-Overhead: GNU Terry Pratchett)

                1 Reply Last reply
                0
                • K Kent Sharkey

                  Thomas Fuchs[^]:

                  Imagine a library with no books, instead being filled to the gills with fortune cookie fortunes. That are tied with strings to each other.

                  25% would complain it's too large, 25% would complain about the implementation of sort, 25% would complain it's not comprehensive enough, and 25% would complain it's still JavaScript

                  R Offline
                  R Offline
                  realJSOP
                  wrote on last edited by
                  #8

                  I can't believe you put the words "great" and "javascript" into the same sentence.

                  ".45 ACP - because shooting twice is just silly" - JSOP, 2010
                  -----
                  You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
                  -----
                  When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013

                  1 Reply Last reply
                  0
                  • M Marc Clifton

                    > What if we developers would make things simpler instead of more complex? Amen to that. One of the problems though is of course an artifact created by Git and their ilk. The "oh look, I just wrote something useful, let me share it with the world" even if it's something like:

                    int initializeToZero() {return 0;}

                    And of course one of the driving forces nowadays is the job interview pre-screening: "do you participate in open source projects? Do you maintain any of your own? Do you have a GitHub account?" We're only touching the tip of the chaos iceberg, it'll be amusing to see how this sorts itself out. Marc

                    Imperative to Functional Programming Succinctly Contributors Wanted for Higher Order Programming Project!

                    J Offline
                    J Offline
                    Jeremy Falcon
                    wrote on last edited by
                    #9

                    Marc Clifton wrote:

                    Do you have a GitHub account?

                    I've actually be asked that before. Because you know, if you're not on GitHub, you have cancer and suck as a person. X|

                    Jeremy Falcon

                    1 Reply Last reply
                    0
                    • R raddevus

                      Camilo Reyes wrote:

                      I'm more on the "no frameworks" bandwagon

                      I agree with you. However, here's a counter-point. I really think the problem is that a lot of people use frameworks just because they are there and don't know why they use them. And, what about just the selector stuff from jQuery? You got to admit that the selector stuff on it's own is nice, right? Right? :)

                      document.getElementById("first").innerHTML = "super stuff";

                      The original is kind of long and ugly.

                      $("#first").text("super stuff");

                      Plus, it's so much easier to select by class and it works in various browsers and browser versions.

                      My forthcoming book, Launch Your Android App, is available for pre-sale at Amazon.com -- releases on April 1, 2016 (no joke). :)

                      C Offline
                      C Offline
                      Camilo Reyes
                      wrote on last edited by
                      #10

                      Excellent point. jQuery I feel has taken me down the wrong path, specifically around unit testability. Say:

                      $('#first').text('stuff');

                      It looks nice, but how do I unit test this? How about:

                      function fillWithStuff(el) {
                      el.innerHTML = 'stuff';
                      }

                      The beauty here is I have a testable component. This testable component is not tight-coupled to the DOM. All I need is a simple mock like

                      {}

                      So:

                      function testMyStuff() {
                      var mock = {};
                      fillWithStuff(mock);
                      console.log(mock.innerHTML === 'stuff');
                      }()

                      Yea jQuery is cool and all. But I once looked at the code I was writing and couldn't stop seeing where it was taking me. I like writing modules I can test in isolation that aren't tightly-coupled to any DOM. JavaScript is way more beautiful like that. :cool:

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups