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. The mistakes not to make

The mistakes not to make

Scheduled Pinned Locked Moved The Insider News
csharpjavascriptcomgraphicsgame-dev
15 Posts 11 Posters 1 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.
  • P Pete OHanlon

    PIEBALDconsult wrote:

    A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?"

    Have to disagree here I'm afraid. If the problem is trivial then yes, that's a good attitude. If, however, it's going to take you six months to implement and you are writing this for a commercial product then you should probably look to the ready made version that ticks all the boxes as far as the functionality you need.

    This space for rent

    R Offline
    R Offline
    Rob Grainger
    wrote on last edited by
    #6

    Definitely with you on this one Pete. Hopefully there is happy middle ground between 10 line "packages" and 20000 line frameworks somewhere.

    "If you don't fail at least 90 percent of the time, you're not aiming high enough." Alan Kay.

    1 Reply Last reply
    0
    • P Pete OHanlon

      PIEBALDconsult wrote:

      A developer's first thought upon meeting a challenge (something the standard library or framework doesn't have) should not be "where can I find something that does that?", but instead "can I do that myself?"

      Have to disagree here I'm afraid. If the problem is trivial then yes, that's a good attitude. If, however, it's going to take you six months to implement and you are writing this for a commercial product then you should probably look to the ready made version that ticks all the boxes as far as the functionality you need.

      This space for rent

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

      Agreed, but I have to wonder why so many projects took this on as a dependency:

      module.exports = leftpad;
      function leftpad (str, len, ch) {
      str = String(str);
      var i = -1;
      if (!ch && ch !== 0) ch = ' ';
      len = len - str.length;
      while (++i < len) {
      str = ch + str;
      }
      return str;
      }

      TTFN - Kent

      M V 2 Replies Last reply
      0
      • K Kent Sharkey

        Agreed, but I have to wonder why so many projects took this on as a dependency:

        module.exports = leftpad;
        function leftpad (str, len, ch) {
        str = String(str);
        var i = -1;
        if (!ch && ch !== 0) ch = ' ';
        len = len - str.length;
        while (++i < len) {
        str = ch + str;
        }
        return str;
        }

        TTFN - Kent

        M Offline
        M Offline
        Master Man1980
        wrote on last edited by
        #8

        Because... because... it's javascript. :)

        1 Reply Last reply
        0
        • K Kent Sharkey

          Agreed, but I have to wonder why so many projects took this on as a dependency:

          module.exports = leftpad;
          function leftpad (str, len, ch) {
          str = String(str);
          var i = -1;
          if (!ch && ch !== 0) ch = ' ';
          len = len - str.length;
          while (++i < len) {
          str = ch + str;
          }
          return str;
          }

          TTFN - Kent

          V Offline
          V Offline
          Vark111
          wrote on last edited by
          #9

          They didn't. Most of those guys took a dependency on Babel-core, a rather large library. Babel-core took a dependency on a small package called line-numbers that, of all things, auto-numbers lines of text, keeping them aligned. line-numbers is the one who took a dependency on left-pad.

          K 1 Reply Last reply
          0
          • V Vark111

            They didn't. Most of those guys took a dependency on Babel-core, a rather large library. Babel-core took a dependency on a small package called line-numbers that, of all things, auto-numbers lines of text, keeping them aligned. line-numbers is the one who took a dependency on left-pad.

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

            But at the end, someone took a dependency on a glorified function call. I'm not blaming the people at the top (gulp, Babel-core, etc.), but the guy that decided, "I'm just not up for writing 10 lines of code today, I'll trust this guy to never break this."

            TTFN - Kent

            V 1 Reply Last reply
            0
            • K Kent Sharkey

              But at the end, someone took a dependency on a glorified function call. I'm not blaming the people at the top (gulp, Babel-core, etc.), but the guy that decided, "I'm just not up for writing 10 lines of code today, I'll trust this guy to never break this."

              TTFN - Kent

              V Offline
              V Offline
              Vark111
              wrote on last edited by
              #11

              True, but at the end of the day, it's only one guy who made that mistake. The guy who wrote line-numbers. But then, line-numbers itself is only 35 lines of code. Add in the aforementioned 17 and now he has a 52 line package. Is that small enough to inline, or not? And how many lines does it take? That's really where I was coming from. Yes you can point to this one guy in this one situation, but in reality, there is no good answer. Because if we decide that 52 line libraries are OK, then what happens when the maintainer for line-numbers decides to melt down and yank his library? Babel-core and gulp are still hosed. NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.

              K 1 Reply Last reply
              0
              • V Vark111

                True, but at the end of the day, it's only one guy who made that mistake. The guy who wrote line-numbers. But then, line-numbers itself is only 35 lines of code. Add in the aforementioned 17 and now he has a 52 line package. Is that small enough to inline, or not? And how many lines does it take? That's really where I was coming from. Yes you can point to this one guy in this one situation, but in reality, there is no good answer. Because if we decide that 52 line libraries are OK, then what happens when the maintainer for line-numbers decides to melt down and yank his library? Babel-core and gulp are still hosed. NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.

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

                Vark111 wrote:

                NPM needs to do the same thing that every other package manager does: You can only "un-publish" insofar as it hides your package from searches and new dependencies. Packages that had an existing dependency still keep that, and can still access your now-hidden package.

                Completely agree. It's the only way this house of cards Can be sustained. Just saw this: Your “just” considered harmful — Medium[^] come through my RSS this morning. IMO it's yet another example of a potential problem with the current "share everything/trust people not to be jerks" model.

                TTFN - Kent

                1 Reply Last reply
                0
                • S Super Lloyd

                  NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!

                  All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

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

                  It also amazes me that there are 52 forks of this, um, "code." Really? People needed to fork this code to tweak it for their own use? I wouldn't even bother to search for a package that does leftpad. But then again, I use C#, which, oh look, already has a String.LeftPad()[^] method. Maybe people ought to start using real programming languages. The open source programming community really has gone to hell in a handbasket. [edit]Need proof? Just look at the various implementation suggestions on SO[^] [/edit] Marc

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

                  D 1 Reply Last reply
                  0
                  • S Super Lloyd

                    NPM &# left-pad: Have We Forgotten How To Program? | Haney Codes .NET[^] Oh... I found a package that convert object to string, *must* depend on it!

                    All in one Menu-Ribbon Bar DirectX for WinRT/C# since 2013! Taking over the world since 1371!

                    E Offline
                    E Offline
                    ed welch
                    wrote on last edited by
                    #14

                    That's why the internet is so slow. Every web site is using 100's of javascript libraries and this is for websites that are basically just static text and images.

                    1 Reply Last reply
                    0
                    • M Marc Clifton

                      It also amazes me that there are 52 forks of this, um, "code." Really? People needed to fork this code to tweak it for their own use? I wouldn't even bother to search for a package that does leftpad. But then again, I use C#, which, oh look, already has a String.LeftPad()[^] method. Maybe people ought to start using real programming languages. The open source programming community really has gone to hell in a handbasket. [edit]Need proof? Just look at the various implementation suggestions on SO[^] [/edit] Marc

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

                      D Offline
                      D Offline
                      Dan Neely
                      wrote on last edited by
                      #15

                      How many are real forks vs I-clicked-the-wrong-button-in-githubs?

                      Did you ever see history portrayed as an old man with a wise brow and pulseless heart, waging all things in the balance of reason? Is not rather the genius of history like an eternal, imploring maiden, full of fire, with a burning heart and flaming soul, humanly warm and humanly beautiful? --Zachris Topelius Training a telescope on one’s own belly button will only reveal lint. You like that? You go right on staring at it. I prefer looking at galaxies. -- Sarah Hoyt

                      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