Beehaw
  • Communities
  • Create Post
  • search
    Search
  • Login
  • Sign Up
anders ( anders@rytter.me )  to Programmer Humor@lemmy.ml · 3 years ago

When your code works, but you don't know how

rytter.me

message-square
13
link
fedilink
262

When your code works, but you don't know how

rytter.me

anders ( anders@rytter.me )  to Programmer Humor@lemmy.ml · 3 years ago
message-square
13
link
fedilink

When your code works, but you don’t know how
@programmerhumor

alert-triangle
You must log in or # to comment.
  • 𝘋𝘪𝘳𝘬 ( Dirk@lemmy.ml ) 
    link
    fedilink
    arrow-up
    14
    ·
    3 years ago

    Just containerize the dev environment and ship that to the customer.

    • TheHalc ( TheHalc@sopuli.xyz ) 
      link
      fedilink
      arrow-up
      13
      ·
      3 years ago

      Just make sure to add comments like

      //Magic, do not touch
      

      To make sure no-one accidentally breaks the spell.

      • 𝘋𝘪𝘳𝘬 ( Dirk@lemmy.ml ) 
        link
        fedilink
        arrow-up
        7
        ·
        3 years ago
        // Do not delete! Yes, it's not used anywhere in the code, but if it is removed
        // the application crashes and the error code is useless for debugging.
        let f = 'a';
        
      • echo ( echo@lemmy.ml ) 
        link
        fedilink
        arrow-up
        4
        ·
        3 years ago

        If you even know which line of random bullshit you changed that made it work, that is

  • MyNameIsRichard ( MyNameIsRichard@lemmy.ml ) 
    link
    fedilink
    arrow-up
    9
    ·
    3 years ago

    I solved one of these once upon a time.

    There was a function that wasn’t called from anywhere in the project which if deleted caused the whole system to fail in test and (presumably) production at runtime. It turned out to be scripts for a cron job that were only on the servers. I moved them in to the project and thus version control. Mystery solved.

  • fckreddit ( fckreddit@lemmy.ml ) 
    link
    fedilink
    arrow-up
    6
    ·
    3 years ago

    I know why it works. Because it was copied from stack overflow…

    • anders ( anders@rytter.me ) OP
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      @fckreddit
      Haha yeah so some other random dude made it work 😄

  • StudioLE ( StudioLE@programming.dev ) 
    link
    fedilink
    arrow-up
    5
    ·
    3 years ago

    The answer is usually that I’ve pushed to the dev environment but I’m looking at staging.

  • VicFic! ( vicfic@iusearchlinux.fyi ) 
    link
    fedilink
    arrow-up
    5
    ·
    3 years ago

    Well you can’t call the code generated by chat gpt as YOURS.

    • AstralWeekends ( AstralWeekends@lemm.ee ) 
      link
      fedilink
      arrow-up
      1
      ·
      3 years ago

      The way I see, if chatgpt can steal our art, then we can steal its science.

  • sin_free_for_00_days ( sin_free_for_00_days@lemmy.one ) 
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    3 years ago

    Going back to the most famous code comment in Unix history You are not expected to understand this.

    • anders ( anders@rytter.me ) OP
      link
      fedilink
      arrow-up
      2
      ·
      3 years ago

      @sin_free_for_00_days or “# The code is documentation enough”

  • terrorismchord ( terrorismchord@beehaw.org ) 
    link
    fedilink
    arrow-up
    1
    ·
    3 years ago

    @moto x3m omg, that…

Programmer Humor@lemmy.ml

programmerhumor@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmerhumor@lemmy.ml

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

  • Posts must be relevant to programming, programmers, or computer science.
  • No NSFW content.
  • Jokes must be in good taste. No hate speech, bigotry, etc.
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1 user / day
  • 8 users / week
  • 337 users / month
  • 1.81K users / 6 months
  • 871 local subscribers
  • 43.7K subscribers
  • 1.25K Posts
  • 10.2K Comments
  • Modlog
  • mods:
  • AgreeableLandscape ( AgreeableLandscape@lemmy.ml ) 
  • cat_programmer ( cat_programmer@lemmy.ml ) 
  • BE: 0.19.15
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code