Lemmy.one
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
anders@rytter.me to Programmer Humor@lemmy.ml · 2 年前

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

rytter.me

message-square
21
fedilink
479

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

rytter.me

anders@rytter.me to Programmer Humor@lemmy.ml · 2 年前
message-square
21
fedilink

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

  • TheHalc@sopuli.xyz
    link
    fedilink
    arrow-up
    17
    ·
    2 年前

    Just make sure to add comments like

    //Magic, do not touch
    

    To make sure no-one accidentally breaks the spell.

    • 𝘋𝘪𝘳𝘬@lemmy.ml
      link
      fedilink
      arrow-up
      11
      ·
      2 年前
      // 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';
      
      • kamenLady.@lemmy.world
        link
        fedilink
        arrow-up
        6
        ·
        2 年前

        if ( “a” == “a” ) { // i swear i saw this somewhere }

        • 𝘋𝘪𝘳𝘬@lemmy.ml
          link
          fedilink
          arrow-up
          7
          ·
          2 年前

          I once did const theNumber = 4 in a function (and then took a second, actually random, number and compared it to theNumber).

          In the comment to the function I actually referenced https://xkcd.com/221/.

    • echo@lemmy.ml
      link
      fedilink
      arrow-up
      5
      ·
      2 年前

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

    • demonsword@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      2 年前

      //HERE BE DRAGONS

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.

  • 719 users / day
  • 1.24K users / week
  • 2.86K users / month
  • 9.51K users / 6 months
  • 441 local subscribers
  • 37.2K subscribers
  • 1.81K Posts
  • 38.5K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • BE: 0.19.7
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org