Some middle-aged guy on the Internet. Seen a lot of it, occasionally regurgitating it, trying to be amusing and informative.

Lurked Digg until v4. Commented on Reddit (same username) until it went full Musk.

Was on kbin.social (dying/dead) and kbin.run (mysteriously vanished). Now here on fedia.io.

Really hoping he hasn’t brought the jinx with him.

Other Adjectives: Neurodivergent; Nerd; Broken; British; Ally; Leftish

  • 0 Posts
  • 34 Comments
Joined 8 months ago
cake
Cake day: August 13th, 2024

help-circle


  • In this instance, I think there was some suggestion to write code in mostly lower case, including all user variables, or at least inCamelCaseLikeThis with a leading lower case letter, and so to make True and False stand out, they’ve got to be capitalised.

    I mean. They could have been TRUE and FALSE. Would that have been preferable? Or how about a slightly more Pythonic style: __true__ and __false__



  • It’s an even-numbered Star Trek movie. They followed a pattern for a while where they were the good ones and if you were going to skip one, you skipped the odd numbered ones, even the first. Especially the first.

    As for recommend, it depends how much you love / know the characters. I grew up on re-runs of the 60s TV show and am pretty sure I saw it for the first time at the cinema. That would have been a couple of years before TNG was even a thing, so my opinion might not mean much even then.

    But yeah, sure. Watch it on a grey rainy afternoon with friends or family when you’ve nothing else to do. Trust me when I say that specific weather outside will definitely add to the experience.





  • Sometimes, when something won’t even compile, I have try to compile it a second time - and get the exact same error message(s) - before my brain will accept there is a problem and perhaps begin to see the cause.

    Somewhere in my head must be a gremlin who says, “No! It is the compiler that is wrong!”

    The same can apply to semantic errors (the code is valid but does not do what it was intended to do) but those take longer to track down. To make the trick work, the debugging output has to be in just the right place in order to print proof of the wrong logic and then do the same on the next run, preferably in under a minute, so that I can begin to see the error.



  • palordrolap@fedia.iotoProgrammer Humor@programming.devDOGE employee
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    2 months ago

    It’s kind of easy to forget about or ignore any experience they might have if they’re asking questions like that. Sure, maybe it was a brain fart from a panicked intern who’s having orders barked at them from a powerful individual that they want to impress, but that doesn’t make it any better, does it?


  • There used to be an undocumented setting in early versions of MS-DOS that would allow the setting of the command option character to something other than the slash, and if you did that, the slash automatically became the path separator. All you needed was SWITCHAR=- in your CONFIG.SYS and DOS was suddenly very Unix-y.

    It was taken out after a while because, with the feature being undocumented, too many people didn’t know about it and bits of software - especially batch files, would have been reliant on things being “wrong”. The modern support for regular slash in API calls probably doesn’t use any of the old SWITCHAR code, but it is, in some way, the spiritual descendant of that secret feature.

    Here’s an old blog that talks about it: https://learn.microsoft.com/en-gb/archive/blogs/larryosterman/why-is-the-dos-path-character



  • palordrolap@fedia.iotoProgrammer Humor@programming.devErrors
    link
    fedilink
    arrow-up
    23
    arrow-down
    1
    ·
    2 months ago

    Urge to analyse… rising…

    My first guess would be to take out that semicolon on line 264. JavaScript will often happily take a new line as end of statement if it makes sense to do that, so in theory, that semicolon is not needed. And it might be a Greek question mark your prankster colleague put in your code when you weren’t looking.

    And then I’d be tracing parentheses, curlies, quotes and so on, because that error could be the point the parser gave up trying to make sense of the code rather than where the error actually is.

    And if that didn’t find it, I’d put in a deliberate error at an earlier, known line to see where the parser thinks that error is. If it’s offset by 20 lines, then I know the original error is probably offset by a similar amount.


  • Ah, misleading use of terminology that indicates one thing, but will win in court even if it actually means, or can later be said to mean, another.

    I hope those involved in helping companies win these lawsuits choke on bones from food sold as boneless. Because that won a court case after “boneless” was redefined as a cooking method.

    I don’t want them to choke to death. Just a little lesson, you know?



  • Sometimes, programs that need to start up an editor will honour the $EDITOR environment variable, which should contain the name of, or full path to, a user’s preferred editor.

    It’s not set by default though, and a lot of things will naturally default to vi or even ed. Something to be set in a .profile, .bashrc or similar.

    $VISUAL is another variable that is used for similar purposes.

    The resemblance to certain two letter commands is not entirely a coincidence.



  • This is actually the correct way to do it in JavaScript, especially if the right hand side is more than 1.

    If JavaScript thinks i contains a string, and let’s say its value is 27, i += 1 will result in i containing 271.

    Subtraction doesn’t have any weird string-versus-number semantics and neither does unary minus, so i -=- 1 guarantees 28 in this case.

    For the increment case, ++ works properly whether JavaScript thinks i is a string or not, but since the joke is to avoid it, here we are.