There have been multiple accounts created with the sole purpose of posting advertisement posts or replies containing unsolicited advertising.

Accounts which solely post advertisements, or persistently post them may be terminated.

programmer_humor

This magazine is from a federated server and may be incomplete. Browse more on the original instance.

ConstantPain , in git commit -m "minor fixes" +26858 -69429

At least none of it is WIP…

Buttons ,
@Buttons@programming.dev avatar

Meh. At least you know “WIP” means you shouldn’t expect that particular commit to work.

ConstantPain ,

It just has to work enough.

ryannathans ,

Perhaps, but there will a bunch of TODO comments so pick your poison

oeLLph OP ,

There are some, but not in the picture 🙃

ClamDrinker , in Fitbit Clock Face

Finally. A human readable format. And pretty too.

Dkarma ,

Jesus I hope this is a joke. I hate json 🙄

damnfinecoffee ,

yeah for real, let’s see an xml one instead

gornius ,

Ah yes, perfect data format, where markup takes more space than the actual data.

curiousaur ,

Would you prefer Yaml?

Omega_Haxors , in Guys! Should I accept the offer? 😂

Sub for sub is a pretty standard social contract between upstarts. It looks beneath you because your livelihood isn’t going up against goliaths.

sag , in Guys! Should I accept the offer? 😂
@sag@lemy.lol avatar

deleted_by_author

  • Loading...
  • sag ,

    Stupid alt don’t tell our secrets

    kubica , in TypeScript is Quantum Ready
    @kubica@kbin.social avatar

    Put it in an if-else and it executes both blocks.

    bananaw , (edited )

    - if else

    + if and else

    Klear ,

    if or else

    steersman2484 ,

    But only if you don’t look

    madkarlsson ,

    Here is one of the programmers who is quantum ready as well

    Omega_Haxors ,

    Screw else statements, people who use if-return have 180% more readable code.

    SpeakinTelnet ,

    Because everyone knows a function stops at the if-else. Nothing ever happens afterward.

    Omega_Haxors , (edited )

    You’re writing extremely bad code if that’s the case and you need to refactor. The point of a function is to return a value. Anything else is just there to waste cycles and make the code less readable. You should also never use else statements for arithmetic due to their massive relative overhead. Your processor can do multiple arithmetic operations in the time it takes to process one if statement, and don’t get me started on people who demand you use nested if even though switch statements are way faster and leagues more readable.

    SpeakinTelnet ,

    I disagree but you do you.

    Edit: dammit you edit your comment a lot for someone who claims to know how to write code properly.

    Omega_Haxors ,

    Those who are the most wrong have the strongest conviction

    EDIT: I make a lot of edits because unlike you, I care about the quality and accuracy of what I write. You’re going to spend like an extra 10 minutes tops writing for something that will be read by thousands for years to come. It’s basic courtesy.

    quicksand ,

    …and the self-awareness finally hits

    Omega_Haxors , (edited )

    Yeah i’m starting to remember why I quit. In any other industry toxic shit like this goes sinks to the bottom, not the top.

    Like seriously, what were you hoping to accomplish with this one? The thread ended yesterday. That’s reddit tier douchery.

    1rre ,

    Who’s suggesting that people are using if statements for arithmetic?

    The only time that you can feasibly replace an if statement with arithmetic is if it’s a boolean, but frankly that’s an edge case… Also if you’re not writing in rust or c or whatever then don’t worry as the interpreter will run a huge amount of branches for every line of code (which is what all your nested ifs, switches, gotos, returns etc. will compile down to anyway)

    AVincentInSpace , (edited )

    god forbid anyone do multiple non-nested if blocks one after another in the same function as the function does multiple different things or (horror of horrors) put an if-else inside a loop

    also unless your compiler is completely and utterly brain dead (as is the case with Python, Java, C#, and most other languages that only pretend to be compiled compile to bytecode) a switch and a series of elif statements will compile to the exact same sequence of machine instructions. you can check on godbolt.org if you don’t believe me.

    modern compilers are insanely smart. as an example, this loop counts the number of 1’s in the binary representation of a number:

    
    <span style="color:#323232;">    </span><span style="font-weight:bold;color:#a71d5d;">while </span><span style="color:#323232;">(n)
    </span><span style="color:#323232;">    {
    </span><span style="color:#323232;">        n </span><span style="font-weight:bold;color:#a71d5d;">=</span><span style="color:#323232;"> n </span><span style="font-weight:bold;color:#a71d5d;">&</span><span style="color:#323232;">amp; (n </span><span style="font-weight:bold;color:#a71d5d;">- </span><span style="color:#0086b3;">1</span><span style="color:#323232;">);    </span><span style="font-style:italic;color:#969896;">// clear the least significant bit set
    </span><span style="color:#323232;">        count</span><span style="font-weight:bold;color:#a71d5d;">++</span><span style="color:#323232;">;
    </span><span style="color:#323232;">    }
    </span>
    

    LLVM will recognize that this is what you are trying to do and emit a single POPCNT instruction on x86, eliminating the loop entirely.

    also how would you even use if statements for arithmetic at all? you aren’t thinking of that one joke isEven() function, are you?

    Octopus1348 ,
    @Octopus1348@lemy.lol avatar

    It’s much more readable when you use else depending on the checks. You can still use return in an else block.

    def Allowed()

    
    <span style="color:#323232;">  if name == "Octopus1348": return True
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">  elif name == "Bobert": return True
    </span><span style="color:#323232;">
    </span><span style="color:#323232;">  else:
    </span><span style="color:#323232;">        return "You are not allowed to use this script."
    </span>
    

    print(Allowed())

    `

    datelmd5sum ,

    doesn’t the CPU already do this?

    theneverfox ,
    @theneverfox@pawb.social avatar

    Fun fact I learned today - you know how when there’s a compound conditional, the interpreter stops once the result is known? (Eg, if the left side of an and is false, it’s false so it doesn’t bother checking the second condition)

    Apparently, visual basic doesn’t do this thing every other language I know of does… It might be a debug only thing for the convenience of the depreciated ide I’m forced to use, but I did a null check && called a function on it if it’s not null, and it blew up

    I pride myself on my ability to change to a new programming language and make progress on day one, but vb is truly the most disgusting POS language I’ve ever seen. From syntax to jarring inconsistencies in language design, it’s just gross

    noli ,
    1. That’s behaviour that’s just part of language design. If you rely on it you should probably check how the language you’re using handles it.
    2. relying on that behaviour sounds a lot like “clever” (read unnecessarily unreadable) code
    theneverfox ,
    @theneverfox@pawb.social avatar

    Are you serious? It’s one of the most basic and common if statements that exist.

    If( foo != null && foo.isBar() )

    That’s what we’re talking about. Looking before you leap.

    I take issue with the whole “too clever” argument fundamentally (for a number of reasons), but this isn’t some fancy quality of life feature. This is as simple as it gets

    noli ,
    theneverfox ,
    @theneverfox@pawb.social avatar

    Scroll on down to the first common example there champ.

    If you really think that’s being “too clever” I don’t know what to tell you… A big reason I think that argument is bullshit is because writing simple code isn’t a goal (what does that even mean?) - readability is a big one, and breaking up every part of every conditional would just lead to unreadable spaghetti

    Also, take a look at the languages being discussed. This is a long settled question - every language I’ve ever used has this.

    Including VB, I found out it uses AndAlso…so gross

    noli ,
    1. several languages that are still in use have eager evaluation.
    2. I’m a dumb programmer. The more I need to keep implicit behaviour in mind, the higher the probability I’m writing bugs. Short circuit evaluation is an optimization technique IMO and shouldn’t be relied upon for control flow.
    3. The aggressive tone you’re using is completely unnecessary and immature, so I’ll refrain from responding any further. Have a nice day.
    theneverfox ,
    @theneverfox@pawb.social avatar

    You’re the one who started this by criticizing my knowledge and my coding practices, in response to me sharing one very specific example of why I believe VB is a bad language

    I held off because I thought you must’ve misread it and we’d laugh and maybe talk about language design… But no, you confirmed you just came at me with a bad take extremely dismissively

    If you want respect, try showing it.

    shotgun_crab , in TypeScript is Quantum Ready

    Schrödinger’s boolean

    mrkite ,
    @mrkite@programming.dev avatar

    Known to cause heisenbugs. They’re bugs that disappear when you try to measure them with a debugger or a printf.

    jaybone ,

    So regular bugs then.

    aluminium , in Fitbit Clock Face

    You can connect to a vscode server on a Galaxy Watch, just sayin’

    FMT99 , in Bug Thread

    They missed “oh nevermind, I fixed it” without explaining how or ever commenting again.

    Sibbo ,

    Here is a fix <broken link>

    marcos ,

    That person isn’t welcome on the beach house.

    0110010001100010 ,
    @0110010001100010@lemmy.world avatar

    That person isn’t welcome on the beach house planet.

    FTFY

    porgamrer ,

    Also somewhere in the middle:

    “There’s been no report of this for a while so we’re marking it resolved.”

    ChapulinColorado ,

    Developer1: @developer2: could you take a look, I know u know stuff about this.

    Developer2: can’t reproduce. Might be able to if I get the app logs in trace level, the blood of 3 dragons and a signed autograph of Michael Jordan’s third hello world program.

    User1: here are some other unrelated logs at info level only and nothing else.

    Git bot: clozed y’all.

    kamenlady ,
    @kamenlady@lemmy.world avatar

    No contava con tu astúcia

    Ashelyn ,

    But if anyone tries to open a new thread on the issue it gets marked as a duplicate and removed

    Mango ,

    Or the “How dare you zombie a post this old!?”

    TheGreenGolem ,
    @TheGreenGolem@lemmy.dbzer0.com avatar

    That was Denvercoder9…

    SatyrSack ,
    Artyom ,

    <mod> marked this as resolved 3 months after last comment

    hakunawazo ,
    MonkderZweite ,

    “Someone fixed it in <here>.” with <here> being only remotely similiar and the “fix” not being available since 10 years anymore.

    edit: hey, they fixed the bracket bug in Lemmy?!

    docAvid , in TypeScript is Quantum Ready

    Weird. Booleanish isn’t a built-in, I’m pretty sure. I’d like to see the definition.

    madkarlsson ,

    This looks like javascript so let me guess the typescript definition

    any|unknown

    this is a joke, please chill

    where_am_i , in Bug Thread

    Nothing like receiving a GitHub email with a page of traceback cuz someone replied to an issue thread. It looks like they’re running anaconda on windows. And their problem is probably something else. Oh gosh, why did I waste my brain looking into this traceback? But sure this was very relevant to the discussion.

    neurospice , in Bug Thread

    Gets linked to a reddit post with someone having the exact same bug as me.

    Comment 1: This comment has been deleted because of Reddit’s api change, here is a link to lemmy lol

    OP replying: OMG THIS FIXED IT THANKS!!

    wahming ,

    Sorry not sorry

    XEAL ,
    jherazob ,
    @jherazob@beehaw.org avatar

    As one of the very likely commenters that falls into this i’m sorry, but fuck the reddit administration, i left them nothing. Hopefully you might find an archived version of the answer.

    Octopus1348 ,
    @Octopus1348@lemy.lol avatar

    That’s why I whitelisted the comment editing from subreddits where it might be helpful. Even r/linuxmemes, I left some helpful comments there too.

    sovietknuckles , in Bug Thread
    @sovietknuckles@hexbear.net avatar

    Edit: Nvm, figured it out

    keepcarrot ,

    Haha my first thought

    UnRelatedBurner , in TypeScript is Quantum Ready

    HOW?

    prettybunnys , in Bug Thread

    I’m actually part of a email chain that randomly got created because of a bug on GitHub that created an issue out of nowhere.

    Every year for the past decade or so folks pop up, say hi, talk about life, etc.

    We’ve celebrated birthdays, graduations, marriages and births and talked about job losses and even death of loved ones.

    Thanks random GitHub bug.

    Feathercrown ,
    NewAgeOldPerson ,

    I thought I had read every xkcd there is. That was beautiful!

    Rodeo ,

    Damn that last panel hits hard lol

    Whirlybird , in Bug Thread

    There’s also always someone that says “I fixed it, thanks” and then doesn’t say how.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • [email protected]
  • random
  • lifeLocal
  • goranko
  • All magazines