• nous@programming.dev
    link
    fedilink
    English
    arrow-up
    8
    ·
    10 days ago

    My favourite: The code does not work. You make a change, it breaks more. You undo that mistake: it now works.

  • AceOnTrack@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    6
    ·
    10 days ago

    “I can’t select the proper option in the dropbox, it doesn’t exist anymore” -> sends me a screenshot of the missing item

    get on website, the item is right there for me to select

    log into database, there’s nothing wrong, everything is as should be

    recieve new message: “I can select it now, thanks for your prompt fix!”

    thanks man, I did nothing

      • Thorry@feddit.org
        link
        fedilink
        arrow-up
        1
        ·
        edit-2
        9 days ago

        Often this is because some part of either the IDE or the build chain failed to clear some part that needed to be cleared. Especially for large projects and on older machines, compiling takes a while. Usually only small changes are made during programming, so to optimize the work flow it tries to only re-compile what absolutely needs to be recompiled. This speeds up the process, allowing for iterative development without waiting a long time.

        I remember working with Java on my old Pentium 1 system and it taking easily 45 mins to compile something. That’s where the xkcd 303 got its origins. https://xkcd.com/303/

        But sometimes this fails in some way, which can lead to very bizarre results. Often causing headscratches figuring out what went wrong, assuming the fault to be in what the developer did. A quick way to check is to simply delete the intermediate compiler result (often the obj or bin dir, or both) and do a whole fresh compile. Sometimes it’s enough to simply compile again, often when the error was caused by some race condition in the build process. For example something being flagged as needing cleanup, but the build being done before the cleanup was done. A recompile at that point will probably work as the cleanup has most likely happened.

        Sometimes shit’s just cursed and there is no explanation, probably angered some coding god somewhere. Perform the proper ritual and you’re good to go.

  • Lovable Sidekick@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    9 days ago

    “The problem just went away.”

    As a fellow dev used to say, “Any problem that goes away by itself can come back by itself.”

  • kamen@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    9 days ago

    On a serious note, if you can’t look at the diff and make sense of it, you’re doing something wrong.

  • iocase@lemmy.zip
    link
    fedilink
    arrow-up
    1
    ·
    9 days ago

    I’ve literally experienced the “I changed/edited/deleted this comment and now my code works” before and it floored me. I can’t for the life of me remember what happened specifically I just remember being scared. It shouldn’t do that, and since it did something I deeply don’t understand happened behind the scenes.

    • Traister101@lemmy.today
      link
      fedilink
      arrow-up
      2
      ·
      9 days ago

      That’s usually (in toolchians that aren’t broken) a caching issue. IE what you see in your editor isn’t what actually got ran, even if you told it to recompile.

  • kehet@sopuli.xyz
    link
    fedilink
    arrow-up
    1
    ·
    10 days ago

    Nowadays the answer is probably a 5,000-word essay that no one has (or will) read

  • atopi@piefed.blahaj.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    9 days ago

    a while ago, during a game jam, while i was making some of the worst gdscript i have ever seen, i have encountered a bug

    after adding a print to see the value of a variable, the bug disappeared. Confused, i commented out the line i just added. The bug was still fixed

    i removed the comment. The bug reappeared

    • Willem@kutsuya.dev
      link
      fedilink
      arrow-up
      2
      ·
      9 days ago

      printing to a console could enforce a flush, sync thread or other shenanigans.

      usually setting a breakpoint would have the same effect and gives me the suggestion of a threading issue.

  • Harold@feddit.nl
    link
    fedilink
    English
    arrow-up
    0
    ·
    10 days ago

    I have never met an expert programmer with this particular issue.

    Git gud.