• (nodebb)

    One of the nice things about Git is that it makes it very easy for us to learn the steps that went into a WTF

    Isn't that a general characteristic of version control systems? I'm pretty sure I could obtain the same story if the code was stored in Perforce, Subversion, Hg, CVS, RCS, or even SCCS. Or PVCS, if anyone else remembers that.

  • Jonathan (unregistered)

    Clearly no one ever looked at the code to "fix it", but more to stop their ESLint from complaining about it.

  • (nodebb)

    Haha, I read the headline "Maximizing Code Quality" and was expecting some great discussion topic and then I see it's just Javascript lol Nice clickbait :P

  • (nodebb)

    If this function is actually used, I have to assume that calling "loadSomeData" with "undefined" was actually doing the correct-ish thing, so no one bothered to fix it.

  • L (unregistered) in reply to colejohnson66

    except that in js, referencing an undefined variable (as opposed to a property) throws a ReferenceError

    so either:

    • userId is a global
    • getData is always called in a try-catch
  • RLB (unregistered)

    The best thing is that JavaScript doesn't care whether you end a line with a semi-colon in the first place...

    (Oh, and what's betting that userId is a global, and so this function has always worked, just never as it was intended to?)

  • Sauron (unregistered)

    Maybe user is a device. IT'S A ROBOT!

  • (nodebb) in reply to Steve_The_Cynic

    How dare you question the godlike qualities of Git, the best version control system in the history of the entire universe? Please tell me you already switched to distributed version control by committing all your stuff to GitHub, the most centralized code repository in the world.

  • (nodebb)

    It was a running joke on my team that when we had to commit something to the core team's repository (in Objective-C), the PR always attracted a complaint about spaces missing before a semicolon. We did everything in our repo in Swift, which generally does not need a semicolon.

  • (nodebb) in reply to Steve_The_Cynic

    [...] if the code was stored in Perforce, Subversion, Hg, CVS, RCS, or even SCCS. Or PVCS, if anyone else remembers that.

    But not SourceSafe. Even Microsoft's own programmers hated that piece of shut.

  • (author) in reply to Steve_The_Cynic

    In the initial draft, I did say "Git and other VCSes" but I cut it because it wasn't adding much, and I like to leave people opportunities to be pedants in the comments.

  • (author) in reply to dpm

    SourceSafe was an amazing piece of technology. Amazing that anyone in their right mind was willing to release that POS.

  • nchantim (unregistered)

    And this is why I describe JS to my daughter as "mainly voodoo"

  • (nodebb) in reply to Remy Porter

    TFS (now "Azdo") is not much better. I had the misfortune to look at their backing databases. What a total absolute mess. Result: slow performance, ridiculous SQL queries, etc.

  • Duke of New York (unregistered)

    The real fake WTF is that some scoundrel could rebind this. Make it an arrow function already!

  • (nodebb) in reply to Remy Porter

    Yeah, it was especially lovely when a coworker checked out something, forgot to unlock it and went on a two week vacation. Good times.

  • (nodebb) in reply to Mr. TA

    Yeah, they only made TFS because they needed something to compete with the back then super popular spiritual CVS successor SVN. So at least they got rid of eager locking, but by the time they crunched the thing out git was already super popular... so ironically if you check old MS blocks, they started recommending git as a replacement for their own product as soon as there was rudimentary support in their build pipeline available :-)

  • (nodebb) in reply to dpm

    Indeed. Not SourceSafe. I've used it in the past (1999-2003), and to express how I feel, I'd need that projectile-vomiting emoji we have on the forums here.

  • (nodebb) in reply to Mr. TA

    At work, I use, by necessity, git (but not in Github), but at home I have a Perforce depot with 23 years' worth of commits. (Yes, the oldest commits, er, changelists are older than git.

    Addendum 2024-06-05 10:35: And I k'bah to migrate.

  • (nodebb)

    Excepting a brief stint with CVS, I started out with SourceSafe. Locking files wasn't "the wrong way", it was "the only way". To the point that when we switched to TFS around 2010, we actually kept the "Locking" model for a few more years.

    Of course, that was then. Now I'm a total Git noob experiencing the joy of resolving Git merge conflicts for the first time.

    Addendum 2024-06-05 10:55: And coping with the fact that Git doesn't track file renames.

    Addendum 2024-06-05 10:59: Or the fact that the recommended strategy for migrating your repository and its history to Git is "don't bother with the history, any changes older than six months are forfeit anyway".

  • Lurk (unregistered) in reply to Remy Porter

    Well, that rather depends upon what you'd experienced before SourceSafe. If it was, working backwards in time before SourceSafe, VMS versioned files - so only your recent history up to the file purge limit, no source control at all and no change history at all other than comments in source, then SourceSafe was pretty bloody good. Was it problematic at times? Certainly, but it was a damn sight better than that.

  • (nodebb) in reply to L

    or - and I think this is the most likely - getData is never actually called anywhere and it's dead code that should be pruned except that would require testing to make sure it really actually isn't called anywhere. So shutting up the linter is the most they're allowed to do.

    Six years of a function with an obvious error in it and no bugs that have ever been traced back to it is suspicious unless it's actually never used.

  • (nodebb) in reply to Steve_The_Cynic

    I accepted a job offer as a web developer in 2008 on the condition that the first task assigned to me would be "migrate everything to subversion". A big win for everyone involved.

  • (nodebb) in reply to Lurk

    oh, you were coding on VAX/VMS? Then you could have used DEC/CMS (first available in 1982) instead of SourceSafe (first available in 1995). I certainly did.

  • (nodebb)

    Three people have attempted to clean up technical debt. The first was someone trying to get rid of the userID global.

  • Officer Johnny Holzkopf (unregistered) in reply to Jonathan
    Comment held for moderation.
  • Lex (unregistered)
    Comment held for moderation.
  • bwldrbst (unregistered) in reply to dpm

    "What do you use for source control?" is a question I always ask in job interviews. Some time around 2010 I did get an answer of "Uh, nothing." and replied that if I was hired, that would be changing immediately. I did not get the job.

  • (nodebb) in reply to Lurk

    VMS versioned files

    I worked on a Fortran project on VMS that used a source code control system - I forget what it was called, but it was much better than just the versioned files.

    Addendum 2024-06-06 07:36: Just read dpm's comment. The one I used was CMS.

  • (nodebb) in reply to bwldrbst

    Conversely, when I interviewed developers, I would always ask what source code control systems they liked to use. Not seeing the point of source code control was not an automatic rejection, but it made their task of getting the job much harder.

    Even in my personal projects, setting up source control is almost a reflexive action, like putting my seatbelt on in a car.

  • (nodebb) in reply to dpm

    oh, you were coding on VAX/VMS? Then you could have used DEC/CMS (first available in 1982) instead of SourceSafe (first available in 1995). I certainly did.

    CMS on (Open)VMS was my first encounter with version control as well. The good thing about CMS is that I don't remember anything about it any more. Which probably means it didn't have any annoying bugs or quirks, unlike VSS, PVCS, svn and git.

  • Lurk (unregistered) in reply to dpm

    oh, you were coding on VAX/VMS? Then you could have used DEC/CMS (first available in 1982) Unfortunately not installed, it was the NHS. Nuff sed? Dunno if it would have worked with VAX-DSM, MUMPS was a bit odd in the way source code was held. I was much more at home with the way it was put together on PDPs (DSM-11), the VAXEN always seemed like overkill for it.

  • Aoife (unregistered)
    Comment held for moderation.
  • (nodebb)
    Comment held for moderation.

Leave a comment on “Maximizing Code Quality”

Log In or post as a guest

Replying to comment #:

« Return to Article