Slashdot Mirror


How One Dev Broke Node and Thousands of Projects In 11 Lines of JavaScript (theregister.co.uk)

An anonymous reader quotes an article written by Chris Williams for The Register: Programmers were left staring at broken builds and failed installations on Tuesday after someone toppled the Jenga tower of JavaScript. A couple of hours ago, Azer Koculu unpublished more than 250 of his modules from NPM, which is a popular package manager used by JavaScript projects to install dependencies. Koculu yanked his source code because, we're told, one of the modules was called Kik and that apparently attracted the attention of lawyers representing the instant-messaging app of the same name. According to Koculu, Kik's briefs told him to take down the module, he refused, so the lawyers went to NPM's admins claiming brand infringement. When NPM took Kik away from the developer, he was furious and unpublished all of his NPM-managed modules. 'This situation made me realize that NPM is someone's private land where corporate is more powerful than the people, and I do open source because Power To The People,' Koculu blogged. Unfortunately, one of those dependencies was left-pad. It pads out the lefthand-side of strings with zeroes or spaces. And thousands of projects including Node and Babel relied on it. With left-pad removed from NPM, these applications and widely used bits of open-source infrastructure were unable to obtain the dependency, and thus fell over.

80 of 480 comments (clear)

  1. Re:The guy was ripping off leftpad by phishybongwaters · · Score: 4, Insightful

    See this is the exact scenario I've talked about before, typically when learning a new coding language. Dependancies and libraries are BAD. 1: because they remove the need to understand what's actually going on (premade functions for example) 2: because some asshat could yank them away and leave your project broken, then YOU have to figure out how to replace the dependencies. I get not reinventing the wheel. But you really need to pay attention to what your code is dependent on and remove that dependency if possible

  2. So, in summary by Anonymous Coward · · Score: 4, Insightful

    So, what have we learned?

    External dependencies are unsustainable;

    JavaScript is unmaintainable;

    Dozens of mainstream projects relying on a trivial bit of string padding code from an external JavaScript dependency is unconscionable.

    1. Re:So, in summary by Anonymous Coward · · Score: 2, Insightful

      Dozens of mainstream projects relying on a trivial bit of string padding code from an external JavaScript dependency is unconscionable

      This is the state a *lot* of open source projects are in. Dependency trees that make windows dll hell look sane. We have cranked out thousands of packages like this. Tons of people writing things to get 'resume cred' then immediately forgetting about it after they get a job. The code lives on as a zombie with no one really digging in and taking a look at it.

      Then this little gem "and I do open source because Power To The People" No dude you are throwing a fit and punishing everyone for it. You just showed yourself to be a 'my code is the best and i am taking my ball and going home' sort of guy. You are pissed off that the npm guys did not side with you over a rather minor issue. You also just gave the kik guys some good will and make them look like they have the higher ground. Good luck getting people to accept your pull requests. As they will forever be thinking 'what if he does it again?'.

    2. Re:So, in summary by ultranova · · Score: 2

      I'm quite certain that most programmers worth their salt of re-invented some wheel that outperformed a popular wheel in every way.

      Perhaps. But that took time they could had used to invent a hyperdrive instead. So does the super-wheel outperform the popular wheel even when the opportunity cost of the time and effort that went into inventing it in a world where the popular wheel already existed is taken into account?

      --

      Forget magic. Any technology distinguishable from divine power is insufficiently advanced.

    3. Re:So, in summary by Dog-Cow · · Score: 2

      I think the Kik guys deserved to have a sharp spike "kiked" (sic) up their asses. You really think they look like good guys for threatening an open source developer who probably never wrote an IM client in his life?

  3. oh vanity... by retchdog · · Score: 5, Funny

    This is just hilarious. What a shit-show, from the bullshit legal threat to the developer's hissy fit to the dependence on an apparently obscure package to implement (lol) left-padding.

    Reminds me of someone I knew who was wringing his hands for a few days over which license to use for his super-awesome R function library. He asked me for advice, and I told him that it's ~30 lines of syntactic boiler-plate code so get over yourself and just put it in public domain so that the two people who ever use it can do so easily. But of course, he had to deeply consider the political implications of which flavor of "freedom" he would support.

    --
    "They were pure niggers." – Noam Chomsky
    1. Re:oh vanity... by The+Evil+Atheist · · Score: 2, Insightful

      Yeah, because should only apply their ethics when you say it's okay. How vain of people to care about their personal ethics.

      --
      Those who do not learn from commit history are doomed to regress it.
    2. Re:oh vanity... by retchdog · · Score: 3, Funny

      you make a good point.

      incidentally, i just took my morning shit. could you please tell me, before i flush the turds down the toilet, what redistribution license should i bless them with?

      --
      "They were pure niggers." – Noam Chomsky
    3. Re:oh vanity... by retchdog · · Score: 2, Insightful

      The downstream impact of my dump is comparable to the downstream impact of 99% of github bullshit. That's the analogy.

      Some things are not worth agonizing over, or "discretion is the better part of valor".

      --
      "They were pure niggers." – Noam Chomsky
    4. Re:oh vanity... by firewrought · · Score: 5, Insightful

      Missing from your list is that NPM didn't just pull the npm package, they reassigned it to a different user. Think about the security implications of that... it implies anyone can send a few intimidating emails, gain control of a major project, and then substitute with their own code/malware.

      Assuming that's how it played out, it might be a good thing the developer threw a hissy fit: the resulting public fallout may or may not prompt NPM (and NuGet, Cargo, Docker, and so forth) to reconsider the trust problem they have created.

      --
      -1, Too Many Layers Of Abstraction
    5. Re:oh vanity... by goose-incarnated · · Score: 2

      You'd be right if PTSD wasn't considered a disability. As it is considered a disability by medical professionals and organisations the world over, you are massively incorrect, and you've just shown that you're quite happy being incorrect if you can grind a suitable axe in the process.

      Sure, its considered a medical disability, but what I started on about is still not measurable. Doesn't matter how you want to put it, it's not measurable. You cannot compare two cases of PTSD the way you can with most other things, because you cannot measure it. It all comes down to who says they feel $X more.

      You've got to draw the line in the sand *somewhere*; you choose to draw the line at unmeasurable feels. I choose to draw it at what can be measured and quantified. Because, you see, if the world has to care about *your* unmeasurable feels, then they have to care about *my* unmeasurable feels, at which point it just degrades into who better expresses their unmeasurable feels, which they may or may not even be feeling.

      Thus, the world doesn't particularly care about your feels. We don't care if you "feel" triggered, were you actually? Doctors the world over require substantial evidence before diagnosing PTSD. Social mountaineers, OTOH, get by with just "You said $FOO, you triggered me".

      As far as the axe-grinding goes, I've never espoused any ideology, and continue to refuse espousing any particular ideology; however I've noticed the various *wing nutcases always try to console themselves that because they are true to their ideology, they *must* be the good guys, hence everyone on the other side must be bad, hence anyone who expresses skepticism of their extraordinary claims must be on the "other side".

      The world is not so black and white - if the bar for PTSD was "You've triggered me" you can be sure it would abused. And, to be honest, as someone with a close family member who actually suffered from PTSD, there is a world of difference between actual diagnosed PTSD and someone on the internet who got offended that someone else used the word "cunt". You trivialise real victims in pursuit of your ideology, just like those professional whiners do when they complain about "stare-rape".

      I can just about guarantee you that no PTSD sufferer is going to get triggered by someone on the internet. Real suffering and real loss puts a whole of things into perspective, and one of those things is that the offensive words on the internet remain there.

      --
      I'm a minority race. Save your vitriol for white people.
  4. What is Kik? by The+Evil+Atheist · · Score: 2

    Don't know who they are or what they do, but fuck them and boycott whatever it is they sell.

    --
    Those who do not learn from commit history are doomed to regress it.
    1. Re:What is Kik? by Luthair · · Score: 3, Informative

      They're a messaging application and have been around 5-6 years. Recall that trademark owners are required to protect their trademark.

    2. Re:What is Kik? by Luthair · · Score: 2

      Not really, the owner distributed under an open source license.

    3. Re:What is Kik? by __aaclcg7560 · · Score: 2

      Recall that trademark owners are required to protect their trademark.

      That's only relevant if Kik has a JavaScript library. AFAIK, they do not. It's just another patent troll overreach.

    4. Re:What is Kik? by angel'o'sphere · · Score: 4, Informative

      And the trademark for "KiK" an instant messenger "App" on phones or tablets, does not cover a "library" or even a "program" written for software development.

      At least not in my country, and likely not in yours either.

      --
      Cost free eBook I read (by iBook/Kobo/Amazon/ObookO/Gutenberg etc.): "The Green Odyssey" by Philip Jose Farmer.
    5. Re:What is Kik? by NotInHere · · Score: 2

      There is a legal aspect, and there is a moral aspect. SourceForge had the right to adware infected installers for open source software. Whether they should do, is another question. Same here.

    6. Re:What is Kik? by AmiMoJo · · Score: 4, Insightful

      True, but lawyers don't understand those words, they just know it's about computers so anything computer related called "kik" must die. They are like marauding barbarians, waving their clubs in the air and smashing anything that looks a bit like the magic rock they worship.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    7. Re:What is Kik? by Cid+Highwind · · Score: 4, Funny

      This is the USPTO we're talking about here. Instant messaging services and Node.js libraries probably both fall under a category like "Products and services pertaining to computers, electronic calculators, magnetic or paper tapes, teletypes, slide rules, and abacuses"...

      --
      0 1 - just my two bits
    8. Re:What is Kik? by Anonymous Coward · · Score: 2, Insightful

      Yeah but that's not how they think.

      They're not real lawyers. They're a "brand management" company that was hired over a game of golf. Their job is to prove that they are useful to their clients.

      So they fire up a search engine and find every instance of the word 'kik', then send legal flavored nastygrams to everyone they can find. In some cases they harass poor developers working on js projects.

      Then they put it all in a report and give it to their employer to 'prove' how much they protected their 'brand'

      They don't give a wet fart about the consequences as there are effecively zero legal repercussions for this behavoir.

    9. Re:What is Kik? by Luthair · · Score: 2

      When the author pushed to npm he granted them a license, given its an open source license it is not a violation for npm to continue to distribute the code.

    10. Re:What is Kik? by DRJlaw · · Score: 2

      Restoring something that someone has removed is the same as making a copy. It is not distributing.

      If the license applied to the project didn't explicitly mention "copying, distribution, and modification" that distinction might possibly have meant something.

      But the license does. So the distinction does not.

    11. Re:What is Kik? by Hognoxious · · Score: 2

      You are absolutely fucking shit at using commas.

      --
      Confucius say, "Find worm in apple - bad. Find half a worm - worse."
    12. Re:What is Kik? by Jahta · · Score: 2

      And the trademark for "KiK" an instant messenger "App" on phones or tablets, does not cover a "library" or even a "program" written for software development.

      At least not in my country, and likely not in yours either.

      I'm guessing you are not a lawyer. The international law on trademarks classifies goods and services into trademark categories. This classification puts "data processing equipment, computers; computer software" in the same group (along with bunch of other things). So an "App", a "program" and a "library" are all just "computer software" for trademark purposes.

      But if you wanted to start a company called "KiK" to sell "Apparatus for lighting, heating, steam generating, cooking, refrigerating, drying, ventilating, water supply and sanitary purposes" (for example) you're good to go.

  5. And nothing of value was lost by 31415926535897 · · Score: 2

    Just kidding, I have no problem with Javascript. By the way, that summary was confusing as hell.

    One of the beauties of JS is that it's easy to provide your own functions, so as long as it's only left-pad missing, you could provide your own, right?

    function left_pad(str, min_length, pad_char){
            if(str.length min_length){
                    str = Array(min_length - str.length).join(pad_char) + str;
            }
            return str;
    }

    (note, I did not do any sanity/error checking in the function, so do not simply copy/paste, please fill it out if you intend to use it)

    1. Re:And nothing of value was lost by __aaclcg7560 · · Score: 3, Insightful

      Your left pad solution is 40% shorter and probably more efficient than the crap that was yanked from NPM.

      The original code from NPM is more readable. Given the choice between compact code and readable code, I prefer readable code. Especially when it comes to my own code and I have to figure out what I wrote months or years later.

    2. Re:And nothing of value was lost by CrashNBrn · · Score: 4, Informative
      I prefer something like this:

      function PadZero(s,z) {
      padstr = "0000000000";

      while(z>padstr.length)
      padstr+=padstr;

      return padstr.substr(0-z) + s;
      }

      Which only concatenates the string once.

  6. Re:What a strange name for an IM app... by itamihn · · Score: 4, Insightful

    Everything is one letter away of meaning something in some language.

  7. Re:The guy was ripping off leftpad by Lisandro · · Score: 5, Insightful

    Dependencies are unavoidable, specially on big projects - you are not expected to reinvent the wheel every time you code.

    Now, having a dedicated library dependency for padding strings is a bit of a stretch though...

  8. Re:What a strange name for an IM app... by Anonymous Coward · · Score: 2, Funny

    Kik is one letter short of being kike (a racist name for a Jewish person). How brilliant.

    It's also one letter short of being "kick" (an racist action to be performed on a Jewish person). How brilliant.

  9. Anybody surprised? by gstoddart · · Score: 5, Insightful

    I've always thought this interconnected pile of stuff, linking across a bunch of domains was lazy, dangerous, and likely to be very brittle.

    Sorry, but the interwebs have shown me I can't afford to trust arbitrary code from all over the place, which can change at a moments notice, and which I know nothing about.

    If you've created an infrastructure where tons of stuff breaks because some asshole corporation forces some guy to say "fuck you, you can't have my code", you have a terrible mess. What happens if someone adds some malicious code?

    What I find really odd is they've over-ruled him and said "no, you can't un-publish your own stuff, we own it". So, what, they've decided his stuff was too important to still be his own? So he got fucked because of corporate assholes only to have his copyright infringed?

    Jenga tower indeed, it sounds like the state of the art is a bunch of brittle dependencies controlled by a few places, and subject to causing a shit top of things to happen when someone makes a change.

    This reminds me of a company I worked at which had a universal build system ... everything build from scratch every day and wouldn't build if any of its dependencies didn't build. So when some guy broke a components 3 components upstream, nobody could get anything compiled because the system was too stupid to go with the last known good ... and hundreds of developers sat around all day going "but, what do you mean we can't do anything because some guy checked in shit code".

    And that's how JavaScript app development works in 2016.

    Wow, just wow.

    Steaming Heaps of Innovative Technology.

    --
    Lost at C:>. Found at C.
    1. Re:Anybody surprised? by 110010001000 · · Score: 2

      If you used git and used your own local branches for your dependencies you would avoid this issue. You only pull from upstream when there are changes you need to incorporate. It sounds like a lot of people were doing it wrong.

    2. Re:Anybody surprised? by jareth-0205 · · Score: 3, Insightful

      What I find really odd is they've over-ruled him and said "no, you can't un-publish your own stuff, we own it". So, what, they've decided his stuff was too important to still be his own? So he got fucked because of corporate assholes only to have his copyright infringed?

      *sigh* We really shouldn't still be having this conversation about how open source licensing works, but OK: They don't claim to own it, but they can redistribute it under the same licence that it was being distributed under. His copyright isn't infringed, it just remains distributed under the non-reversible licence that he chose to distribute it under in the first place.

  10. Re:Lesson for next time ... by NotInHere · · Score: 4, Insightful

    So you say everybody should write their own buggy and incomplete reinvention of the wheel?

    Yes, probably most of his libraries aren't longer than 2000 lines of code, and therefore are pretty replaceable, but I don't think that writing your own libraries will decrease the total number of bugs, it will rather increase them.

  11. Re:The guy was ripping off leftpad by nedlohs · · Score: 5, Insightful

    Bullshit.

    Dependencies and libraries are fine. If you want to use SSL encryption in your software you should try and re-implement it all, because while SSL libraries have been having security issues in the last few years there's almost zero chance you make something that doesn't have bigger ones. Multiply that by all the domain specific pieces of code you need.

    Not having to understand what's actually going on is a feature not a problem.

    What is retarded is using a dependency that exists out in the internet somewhere only, so that your code breaks if some random internet service disappears. As long as you have your own copy of the dependency it's fine. Some asshat can't yank them away since you have your own copy that doesn't magically stop working. Obviously you want the source code, or at the very least the source code escrowed somewhere that you obtain if the provider vanishes in the future.

  12. Re:The guy was ripping off leftpad by Aaden42 · · Score: 5, Informative

    I don't think this proves libraries per-se are bad, but blindly depending on out-of-house software repositories for every build or (worse) every startup/deploy is crazy.

    We're a Java house (go ahead, get your ki[c]ks in...), and we use around 100 open source libraries. They're all mirrored locally in an Ivy repository we maintain. No new versions get checked in unless they've passed a reasonable level of scrutiny, and nothing gets deleted unless we delete it.

  13. Kik's briefs told him to take down the module by rudy_wayne · · Score: 2

    Damn bossy underwear!!!

  14. Re:The guy was ripping off leftpad by 110010001000 · · Score: 4, Interesting

    It is 2016. You need to use libraries. You just copy them to your local repo so they are in a known state if you use them.

  15. Re:Great. THAT was that bug I ran into 2 days ago. by __aaclcg7560 · · Score: 2

    Does anyone know when this gets fixed and what the plan is?

    You could try to read the article.

    To fix the internet, Laurie Voss, CTO and cofounder of NPM, took the "unprecedented" step of restoring the unpublished left-pad 0.0.3 that apps required. Normally, when a particular version is unpublished, it's gone and cannot be restored. Now NPM has forcibly resurrected that particular version to keep everyone's stuff building and running as expected.

  16. Re:What a strange name for an IM app... by gstoddart · · Score: 5, Funny

    And your nick is one character away from including the word "reamer", and two letters away from being "screamer".

    It is simply not possible to exclude every word which is one or two letters away from offending some random idiot who thinks being one letter away is the same thing.

    People can give something a name which is totally innocuous to them and which someone else is going to get into a hissy fit about.

    So, what's more likely, he had no idea some random guy on the interwebs would make the comparison to a racial slur, or he used a word which sounded cool to him?

    --
    Lost at C:>. Found at C.
  17. Re:OPC by Njorthbiatr · · Score: 4, Funny

    Yeah, real programmer treat integers as byte arrays.

    You kids and your new fangled pythons don't know how good ya'll have it.

  18. Re:The guy was ripping off leftpad by rockmuelle · · Score: 4, Insightful

    Dependencies are unavoidable, true, but it's a good practice to vet libraries before you include them and make sure they're worth the risk.

    The risk with Open Source libraries is usually long term maintenance - will the project be maintained for the lifetime of my project? If the project is not maintained, is it something you're willing to take on and will the license and community let you fork it? If not, there's risk.

    You also have the risk we see here - ideology trumping pragmatism (that's a nice way of saying the developer had a fit and took his toys away for reasons even he doesn't fully understand). In those cases, you also have the chance to fork, assuming the license/community allows it.

    For trivial operations, such as left padding, it's almost never worth the risk to use a library unless it's part of the language's standard library. Sure, don't write your own FFT or ORM, but if you can code a function in a few minutes for a well defined problem, there's no reason to add an external dependency.

    -Chris

  19. D'oh by tekrat · · Score: 2

    If you write *anything* that assumes the perpetual existence of a linked library from somewhere on the internet, you deserve what you get.

    Most kids these days don't remember a time where internet access required a dial-up modem -- or it wasn't a 100% certainty it would be available.

    --
    If telephones are outlawed, then only outlaws will have telephones.
  20. Re:Unavoidable if you're LAZY by Lisandro · · Score: 4, Insightful

    Nonsense. Laughable, even. Quality programmers can build anything. If they're wise, they will.

    I guess you never worked with code then, eh? It is not about whether they can or cannot - is about the resources involved. Writing and testing a production-level software library is not a trivial task. It takes time.

    Again, this does not apply to string padding, which is usually resolved on a couple lines of code on the language of your choice...

  21. JAVASCRIPT NEEDS TO GO! by Anonymous Coward · · Score: 3, Insightful

    It's fucking unbelievable how much trouble JavaScript has caused for so many people.

    Let's ignore how fundamentally broken it is, as a programming language, in almost every respect. That includes its fucking awful type system, its total lack of real OO (sorry, prototypes are complete shit), its ultra shitty standard library (which is why NPM and this problem exist in the first place), and similar problems.

    JavaScript has allowed too many unskilled cranks to shit out way too much broken code. It was one thing when they did it client-side, where it was isolated. Now it's being done server-side, and it's a motherfucking disaster!

    Worse, JavaScript has enabled the web advertising industry. JavaScript makes it trivial for them to track your every move online. If you don't want to fall victim to it, then you have to waste your time disabling it everywhere by default, and selectively enabling it where you need it.

    JavaScript needs to go.

    If you really need to use a scripting language server-side, use Lua, or Python, or even goddamn Tcl. All three of them are better than JavaScript in every way.

    1. Re:JAVASCRIPT NEEDS TO GO! by rwven · · Score: 2

      JS/Node/NPM are the new PHP.

    2. Re:JAVASCRIPT NEEDS TO GO! by Penguinisto · · Score: 4, Insightful

      ...and Docker is the new Solaris Zones. Err, okay?

      The point isn't that node.js sucks (personal opinion - it kinda does when mishandled, just like PHP), it's that like any tool, you have to use it correctly and try not to make it do shit that it wasn't designed to do.

      We see this shit in Puppet-land, where so-called DevOps people rely on external github (not puppetforge, but random github) modules to run their servers. They never pull a local copy, but instead use something like Librarian to pull it in dynamically... never realizing that if the guy maintaining $randomModule says 'fuck it' and pulls his project (or even just breaks his module), suddenly you're stuck with a broken model and a potential outage.

      --
      Quo usque tandem abutere, Nimbus, patientia nostra?
  22. Re:What a strange name for an IM app... by __aaclcg7560 · · Score: 3, Funny

    And your nick is one character away from including the word "reamer", and two letters away from being "screamer".

    I got the nickname "Reamer the Screamer" in the engineering class at junior high school. My model car required a larger opening to fit the CO2 cartridge ("reamer") and it whistled down the string ("screamer"). I never liked that nickname as it fit the reputations of several girls quite well.

  23. Re:OPC by Delwin · · Score: 5, Insightful

    ... I hope you're kidding. Don't reinvent the wheel - if someone else has already written the code then there's no reason to re-write it. That's a huge waste of man hours. Instead you should package all dependencies in such a way that they can be retrieved without requiring the other guy to still be offering it. Yes, that means a snapshot of the version you rely of should be in your repository because you also can't guarantee that a given version will be available as long as your own project is.

  24. Improper assertion of trademark? by Steve1952 · · Score: 2

    Ironically, it may be Kik's attorneys that acted improperly here. Trademark law allows similar names to be reused for different fields of use, so long as there is not a possibility of confusion/loss of market. Here I seriously doubt that anyone would confuse a Javascript module with a chat application. So quite possibly this was a bogus assertion in the first place, which ended up causing serious damage to a lot of folks.

    1. Re:Improper assertion of trademark? by mwvdlee · · Score: 2

      This begs a question; is NPM (or a package manager in general) legally responsible for the hosted content?

      --
      Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  25. Re:The guy was ripping off leftpad by tripleevenfall · · Score: 2

    It's a bit like asking the bum in the alleyway to hold the keys to your business for you over nights, instead of carrying them in your own pocket.

  26. Re:OPC by Luthair · · Score: 5, Insightful

    The AC is too busy to respond, he's currently fixing the 9999999 security flaws in his hand-rolled SSL library.

  27. Re: OPC by Anonymous Coward · · Score: 3, Funny

    No, real programmers use a magnetized needle to manipulate bits in memory directly. #notruescotsman

  28. Build a mirror for your dependencies! by damaki · · Score: 5, Insightful

    Thou shalt always mirror your dependencies. Never assume that everything will always be available. That's continuous integration 101.
    Second paradigm: mirror even your dependencies source code, if you can.

    --
    Stupidity is the root of all evil.
  29. Re:OPC by Anonymous Coward · · Score: 3, Funny

    he's currently fixing the 9999999 security flaws in his hand-rolled SSL library

    Well, I suppose that still means his library has fewer flaws than OpenSSL does, so maybe he is doing something right.

  30. Re:OPC by mrchaotica · · Score: 4, Insightful

    Using other people's libraries is fine; you just need to keep your own copy of them instead of dynamically-linking (or hotlinking, in the case of Javascript web shit).

    --

    "[Regarding the 'cloud,'] ownership was what made America different than Russia." -- Woz

  31. Re:The guy was ripping off leftpad by kuzb · · Score: 2

    What a crock of shit. Do this and you increase your development time 1000-fold. It's stupidity to think that just because someone uses a dependency that they're incapable of understanding it and it blows my mind that this absolute garbage has been voted up. No sane developer would tell you this.

    --
    BeauHD. Worst editor since kdawson.
  32. Re:The guy was ripping off leftpad by kuzb · · Score: 2

    "Dependencies are unavoidable, true, but it's a good practice to vet libraries before you include them and make sure they're worth the risk."

    But that's not what is being said. What is being said is "dependencies are bad, you shouldn't have them" which is just ridiculous ideological bullshit. If nobody used dependencies half the software today wouldn't exist in any stable form because people would still be testing and debugging their newly-invented wheels.

    --
    BeauHD. Worst editor since kdawson.
  33. PLUMBING NEEDS TO GO! by Pseudonymous+Powers · · Score: 5, Funny

    It's fucking unbelievable how much trouble plumbing has caused for so many people.

    Let's ignore how fundamentally broken it is, as a technology, in almost every respect. That includes its fucking awful historical association with toxic lead, its total lack of real modularity (sorry, reservoirs are complete shit), its ultra shitty set of mutually incompatible pipe sizes, materials, and connections (which is this problem exist in the first place), and similar problems.

    Plumbing has allowed too many unskilled cranks to shit out way too many leaky pipes. It was one thing when they did it in Ancient Rome, where it was isolated to a fountain in the town square. Now it's being done in people's houses, and it's a motherfucking disaster!

    Worse, plumbing has enabled the for-profit water supply industry. Plumbing makes it trivial for them to track every drop of water you use. If you don't want to fall victim to it, then you have to waste your time turning off a bunch of valves, and digging wells everywhere.

    Plumbing needs to go.

    If you really need to use a water delivery technology, use a river, or a pond, or even a goddamn barrel . All three of them are better than plumbing in every way.

    1. Re:PLUMBING NEEDS TO GO! by AmiMoJo · · Score: 4, Informative

      Do you work in the water industry? This is actually spot on!

      It's so bad we don't even know where half the damn pipes are. We know where the ends are, but if there is a leak in the middle we are fucked. Even in the best countries 25% of the water leaks out, and in some places it's over 50%. Even better, the last 20% just isn't even worth fixing... If a leak is costing the company 5 bucks a month, they ain't gonna send someone to dig up the road and fix it.

      --
      const int one = 65536; (Silvermoon, Texture.cs)
      SJW, n: "Someone I don't like, and by the way I'm a fuckwit" - AC
    2. Re:PLUMBING NEEDS TO GO! by NormalVisual · · Score: 2

      Interestingly, I'm dealing with that problem now. The place I'm renting has a bad slab leak, and rather than bust up the floor to fix it, the landlord decided it's going to be better to put new pipe in the walls, meaning that one bedroom, a closet, both bathrooms, and the kitchen are going to get the walls ripped up to put the new plumbing in. I'm *so* looking forward to the next few days, and then cleaning up all of the dust when everyone involved is done.

      I'd almost rather deal with Javascript. Almost.

      --
      Please stand clear of the doors, por favor mantenganse alejado de las puertas
    3. Re:PLUMBING NEEDS TO GO! by cas2000 · · Score: 2

      unfortunately for you, the rant against javascript was not equivalent to a rant against plumbing, it was equivalent to a rant against using plain cardboard for pipes rather than, say, copper or stainless steel or plastic.

  34. Re:OPC by pla · · Score: 4, Insightful

    I hope you're kidding. Don't reinvent the wheel - if someone else has already written the code then there's no reason to re-write it.

    I hope you're kidding, and the present situation makes an excellent example of why.

    Tracking down Open Source dependencies has become a complete nightmare, in many cases, because far, far too many devs unfortunately take your advice to heart. No, we shouldn't roll our own bigmath libraries, or nosql implementations. But what lazy-assed devs would import an external dependency for something as trivial as padding a string? Oh, right - Apparently thousands of them. Gee, I wonder why the business world doesn't take us seriously, despite offering them our work for the low, low price of "free"?

  35. Re:The guy was ripping off leftpad by kuzb · · Score: 3, Interesting

    This. Exactly this. Someone needs to allow your score to go to 6 for combating the stupidity around here.

    --
    BeauHD. Worst editor since kdawson.
  36. Re:OPC by mwvdlee · · Score: 2

    Because iterating backwards is the same as forwards?

    --
    Slashdot social media options: AIM, ICQ, Yahoo, Jabber and Mobile Text. Why no MySpace?
  37. Re:OPC by Curunir_wolf · · Score: 2

    ... I hope you're kidding. Don't reinvent the wheel - if someone else has already written the code then there's no reason to re-write it. That's a huge waste of man hours. Instead you should package all dependencies in such a way that they can be retrieved without requiring the other guy to still be offering it. Yes, that means a snapshot of the version you rely of should be in your repository because you also can't guarantee that a given version will be available as long as your own project is.

    Exactly. And this is the very reason we went to using Maven and a private Nexus server. Nexus will go out periodically and find all the security patches, bug fixes, etc. (and upgrades, if you want them) for all of your dependencies, and keep a local copy. If the upstream repository goes dark (this actually happens a lot), you still have a copy of the latest version.

    I'm sure there are other similar system that do the same thing. How are people managing their "nuget" packages?

    --
    "Somebody has to do something. It's just incredibly pathetic it has to be us."
    --- Jerry Garcia
  38. Re:The guy was ripping off leftpad by Fallso · · Score: 2

    What an absurd statement. You only need to understand the implementation details if you have the responsibility of changing or fixing something - the whole basis of high(er) level languages is that you don't need to understand how absolutely everything works in order to use it; and the same applies to third party libraries.

  39. Re:It's the "Hipster False Switcheroo" fallacy! by Pseudonymous+Powers · · Score: 3, Informative

    Yes, it's the Hipster False Switcheroo Fallacy. Also known as satire.

    "Mr. Swift, cease this frippery at once! I fail to see what infant cannibalism has to do with wealth inequality and class relations in Ireland!"

    And how dare you, sir or madam or other. I'll have you know I've put countless man-or-woman-or-other-hours into my artisanal gluten-free bread.

    Also, how dare you, Slashdot! Putting a squiggly red underline under "artisanal" in 2016. This is disappointingly regressive!

  40. Re:Unavoidable if you're LAZY by istartedi · · Score: 2

    Try writing an application that handles all the common image file formats, (at least JPEG, GIF, PNG and BMP) and get back to us.

    --
    For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
  41. Re:The guy was ripping off leftpad by phantomfive · · Score: 3, Informative

    For trivial operations, such as left padding, it's almost never worth the risk to use a library unless it's part of the language's standard library. Sure, don't write your own FFT or ORM, but if you can code a function in a few minutes for a well defined problem, there's no reason to add an external dependency.

    Generally I've found that anything taking less than two days (one day for writing, one day for testing) is worth rewriting yourself instead of adding a dependency (arguably, anything taking less than a week is worth rewriting, depending on the quality and stability of the dependency).

    --
    "First they came for the slanderers and i said nothing."
  42. Re:Unavoidable if you're LAZY by phantomfive · · Score: 2

    FYI, to give an idea of how long that would take, I did that a while ago for GIF, and between understanding the documentation and writing the code and debugging, it took 40 hours (my original estimate was ~8 hours ha!). So extrapolating based on that, the time required for the total collection would be 160 hours, pad it up to 200 hours to account for complications. Given the relative stability of the image libraries, it's unlikely to be worth re-implementing them.

    --
    "First they came for the slanderers and i said nothing."
  43. Re:OPC by ripvlan · · Score: 2

    real programmers swipe code from SO and compile it without attribution - saying "I wrote all of this"

  44. Re:OPC by networkBoy · · Score: 2

    I have an SVN repo on the same server that hosts my sites. All code is linked from there for js stuff.
    I have a private side as well that I use to deploy all server side code from. Works quite well.
    -nb

    --
    whois gawk date unzip strip find touch finger mount join nice man top fsck grep eject more yes exit umount sleep dump
  45. Re:The guy was ripping off leftpad by TheRaven64 · · Score: 2

    What is being said is "dependencies are bad, you shouldn't have them"

    It's true. It's also true to say 'reinventing the wheel is bad, you shouldn't do it'. Eventually, you have to pick the lesser of two evils, but neither solution is particularly enjoyable.

    --
    I am TheRaven on Soylent News
  46. Re:OPC by parkinglot777 · · Score: 2

    The script shouldn't use while loop at all. Instead, it could be replaced with a simple for loop instead because the loop number is defined.

    for (var i=0; i<(len-str.length); i++) { ... }

    Back to the topic, I think the word kik is a trademark - http://tmsearch.uspto.gov/bin/... - and it is still enforcible. If you look at the Good and Services, it may be the reason why the developer should not use the name or he could be sued...

  47. Re:The guy was ripping off leftpad by david_thornley · · Score: 2

    Define "need". Explain to me why I need to understand how a library works in detail. We use a geometry library that uses NURBS, which I haven't bothered learning enough to debug the library. We use a JPEG library, and I really haven't bothered to learn how JPEG works. Add up all the third-party libraries we use, and the company would never have gotten off the ground if we'd had to write all those ourselves.

    --
    "When you have eliminated the unacceptable, whatever is left, however improbable, must be the truthiness" - Holmes
  48. Re:OPC by phantomfive · · Score: 3, Insightful

    You got me interested, and with efficiency you can never be sure until you time it, so I wrote a program to time it. Looping from zero to a billion, with an assignment inbetween. Then I recompiled and ran it again, this time going backwards to zero. Here are some times (in milliseconds):

    Going up: 32453 / 32536 / 32232 / 32604
    Going down: 32587 / 32416 / 32216 / 32466

    There seems to be no difference at all in either direction. Code is here.

    --
    "First they came for the slanderers and i said nothing."
  49. Re:Unavoidable if you're LAZY by phantomfive · · Score: 2

    Worse then that, because you probably didn't check for security issues and all the corner cases that other libraries developed over 2+ decades have dealt with.

    No, I would take an approach similar to formal verification.

    --
    "First they came for the slanderers and i said nothing."
  50. Re:The guy was ripping off leftpad by Darinbob · · Score: 2

    People reinvent the wheel all the time. You'd have to or else we'd still be using stone wheels. Even a bigmath library gets reinvented, I've seen many versions. That's because one size does not fit all and some of those libraries or their RAM usage will literally not fit on some machines.