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.

ryan , in I am God's greatest programmer

Let him play in the legacy code. You can just hose him off later before letting him back into the office so he doesn't track it everywhere.

ISometimesAdmin ,
@ISometimesAdmin@the.coolest.zone avatar

Unfortunately if you let Junior play in legacy code once, it'll learn some nasty habits and make more of it from scratch, usually when you're trying to sleep.

Hazzia ,

It’s true, spaghettification sauce stains clothes. Best keep Jr out of it entirely.

MagicShel ,

I don’t want that shit all over me though. That’s why I hired junior!

MonkderZweite ,

That’s what the line represents. So they can pull you if you do something nasty.

BaardFigur ,

deleted_by_author

  • Loading...
  • CodeMonkey ,

    If you are creating an alternative implementation and leaving the old one in place, you are not fixing a problem, you are just creating a new one (and a third one because you have duplication of logic).

    Either refactor the old function so that it transparently calls the new logic or delete the old function and replace all the existing usage with usage of the new one. It does not need to happen as a single commit. You can check in the new function, tell everyone to use it, and clean up usage of the old one. If anyone tries to use the old implementation, call them out in a code review.

    If removing or replacing the old implementation is not possible, at least mark it as deprecated so that anyone using it gets a warning.

    BaardFigur , (edited )

    deleted_by_author

  • Loading...
  • magic_lobster_party ,

    I’m sure that ring buffer started out as a “temporary solution”.

    mbp ,
    @mbp@lemmy.sdf.org avatar

    God, I would love that so much

    PrettyFlyForAFatGuy , in There once was a programmer

    I can code a feature faster than i can debug ChatGPTs attempt. so long as it’s in JS

    ChatGPT is better at bash than me though

    i_am_hiding ,

    The good thing about ChatGPT is that it gives you a starting point for languages you’re not familiar / rusty with.

    RandomVideos , in There once was a programmer

    I cant use chatgpt with godot :(

    kurwa ,

    Why not? I haven’t had the best time with it, but it certainly can write gdscript

    RandomVideos ,

    Godot 4.0, which was released in 2023, changed a lot of gdscript

    Chatgpt only knows gdscript from godot 3.x

    squaresinger , in The Password Game

    I hate Paul…

    I made it up to rule 25 and then Paul starved because I was thinking too long about which characters to ban.

    To make it over Rule 24 (Paste the URL of a Youtube video with a certain random length), I even created a video with the correct length and kept uploading it to Youtube to get a URL without roman numerals and decently usable atomic weights.

    When I tried it again after that dumb chicken starved, I hit Youtube’s maximum daily upload limit. Now Youtube thinks I am a spambot or something.

    Btw, there are 35 rules total, in case anyone else makes it over 24. And spoiler, the one that got me doesn’t matter at all. It’s one of the easiest of all.

    canpolat OP ,
    @canpolat@programming.dev avatar

    That’s a heroic effort! I laughed so hard.

    netwren , in There once was a programmer

    ChatGPT is next level Rubber Duck. Tell it to talk to you like Socrates.

    phorq , in There once was a programmer

    ChatGPT just makes me feel like I’m doing code review for junior developers who don’t understand the task… wait…

    EveryMuffinIsNowEncrypted , in Le torture
    @EveryMuffinIsNowEncrypted@lemmy.blahaj.zone avatar

    Come on. Dude. Give credit where credit is due. SMH…

    Source.

    HappyHam ,

    It’s not SMH, it’s SMBC

    EveryMuffinIsNowEncrypted ,
    @EveryMuffinIsNowEncrypted@lemmy.blahaj.zone avatar

    SMH = Shaking My Head

    It’s an Internet initialism.

    HappyHam ,

    I know. Just foolin’ :)

    EveryMuffinIsNowEncrypted ,
    @EveryMuffinIsNowEncrypted@lemmy.blahaj.zone avatar

    Oh. Sorry about that. Text is not a good medium for tone. xD

    TootSweet , in I mean it could be right
    
    <span style="color:#323232;">for (int y = MIN_INT; y &lt;= MAX_INT; y++) {
    </span><span style="color:#323232;">        if (y == x + 1) {
    </span><span style="color:#323232;">                x = y;
    </span><span style="color:#323232;">        }
    </span><span style="color:#323232;">}
    </span>
    

    (Not sure there’s a way to prevent Lemmy from escaping my left angle bracket. I definitely didn’t type ampersand-el-tee. You’ll just have to squint and pretend. I’m using the default lemmy-ui frontend.)

    xthexder ,
    @xthexder@l.sw0.com avatar

    y &lt;= MAX_INT will never be false, since the loop will overflow and wrap around to MIN_INT

    (You can escape code with backticks, and regular markdown rules)

    TootSweet ,

    Oh good call! What I was trying to do is more complex than I was thinking.

    Hmmmmm.

    
    <span style="color:#323232;">int f = TRUE;
    </span><span style="color:#323232;">for (int y = MIN_INT; f || y - 1 &lt; y; y++) {
    </span><span style="color:#323232;">  f = FALSE;
    </span><span style="color:#323232;">  if (y == x + 1) {
    </span><span style="color:#323232;">    x = y;
    </span><span style="color:#323232;">  }
    </span><span style="color:#323232;">}
    </span>
    

    (I should just test my code to make sure it works, but I haven’t. Heh.)

    Also, Lemmy escaped your angle bracket too. Back ticks don’t seem to do the trick.

    
    <span style="color:#323232;">Block: &lt;
    </span>
    

    Inline: &lt;

    Or were you suggesting back ticks for some other purpose? (I did use back ticks in my first post in this thread.)

    xthexder ,
    @xthexder@l.sw0.com avatar

    The backticks worked in the preview, and showed up correctly to start, but there must be a bug in the lemmy ui, since now it’s double-escaped. No idea /shrug

    mormegil ,
    @mormegil@programming.dev avatar

    It will not “overflow”. Signed integer overflow is undefined behavior. The compiler could remove the whole loop or do anything else imaginable (or not).

    TootSweet ,

    TIL!

    I wonder how many languages out there do define what happens on integer overflow.

    BatmanAoD ,

    Languages with dynamic typing and implicit large-integer types, such as Python and Ruby, generally just convert to that large-integer type.

    I figured Java would probably define the behavior in the JVM, but based on a quick web search it sounds like it probably doesn’t by default, but does provide library methods to add or subtract safely.

    Rust guarantees a panic by default, but provides library methods for wrapping, saturating, and unchecked (i.e. unsafely opting back in to undefined behavior).

    nybble41 , in I mean it could be right

    I’m fairly certain that last one is UB in C. The result of an assignment operator is not an lvalue, and even if it were it’s UB (at least in C99) to modify the stored value of an object more than once between two adjacent sequence points. It might work in C++, though.

    Beanie ,

    That was my first thought when trying to figure out what it did

    Hephoh2 , in Language

    sry but correct french would be:

    couleur = “(4*20+10+9)fafalala”;

    Blamemeta , in I mean it could be right

    When the metric is lines of code

    mcmoor ,

    When the company tries to be cheeky and starts to count characters instead

    Johanno ,

    Rename c to completelyUnimportantVariableThatISoLongBecauseIGetPaidMore

    fluxion , in haha patents

    It’s amazing how much work goes into cleaning up code before you feel comfortable posting it to a mailing list that you would never even bother doing for internal-only stuff.

    backhdlp , in classic configure neovim experience
    @backhdlp@lemmy.blahaj.zone avatar

    kickstart.nvim is one of the configs of all time

    fluxion ,

    I can also contest that this is a config

    henfredemars , in finally there is a perfect monitor for Java programmers

    I have a monitor that’s almost like this and it’s surprisingly nice. It feels like a two-monitor setup. Two actual monitors would probably have been cheaper, but I got mine from work, so it wasn’t a factor.

    The real advantage of having two actual monitors is being able to flip one vertically for reading code.

    EDIT: a word

    VanillaGorilla ,

    I bought one after some months of remote work in 2020. Then when I started my new job they gave me another one (different manufacturer but exact same panel size). I needed to rearrange my desk a lot, but holy shit so much room for error messages!

    Yes, I'm a Java developer ¯_(ツ)_/¯

    SpaceNoodle , in I mean it could be right

    ++x;

    damium , (edited )

    The underutilized post pre increment operator.

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