NerdHouse Social
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
Destide@feddit.uk to Programmer Humor@lemmy.mlEnglish · 1 day ago

Infallible Code

lemmy.ml

message-square
150
fedilink
418

Infallible Code

lemmy.ml

Destide@feddit.uk to Programmer Humor@lemmy.mlEnglish · 1 day ago
message-square
150
fedilink
alert-triangle
You must log in or # to comment.
  • Kuma@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    25 minutes ago

    I am more amazed that he didn’t stop at 10 and think “damn this is tiresome isn’t there a one liner i could do?”. I want to know how far he went. His stubbornness is amazing but also scary. I haven’t seen this kind of code since back in school lol lol lol

  • keepcarrot [she/her]@hexbear.net
    link
    fedilink
    English
    arrow-up
    2
    ·
    2 hours ago

    I want to assess coders by lines written! The more the better!

  • JackbyDev@programming.dev
    link
    fedilink
    English
    arrow-up
    29
    ·
    7 hours ago

    This is why this code is good. Opens MS paint. When I worked at Blizzard-

    • benjaminb@discuss.tchncs.de
      link
      fedilink
      English
      arrow-up
      4
      ·
      2 hours ago

      And he has Whatever+ years of experience in the game industry…

      • onlooker@lemmy.ml
        link
        fedilink
        arrow-up
        1
        ·
        31 minutes ago

        Which sounds impressive until you realize a janitor who worked there for the same amount of time could claim the same.

  • Treczoks@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    6 hours ago

    Good if you are rated by an AI that pays for LOCs.

  • 6stringringer@lemmy.zip
    link
    fedilink
    arrow-up
    2
    ·
    6 hours ago

    Thanks to goodness, finally. A (giggle & snort) solid algorithm. There ya’s go set yer clocks & go get a haircut.

  • kreskin@lemmy.world
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    7 hours ago

    no unit tests huh.

    /s

  • Drunk & Root@sh.itjust.works
    link
    fedilink
    arrow-up
    1
    ·
    7 hours ago

    this is like the making chess one

  • Valmond@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    7 hours ago

    private?

  • sik0fewl@lemmy.ca
    link
    fedilink
    arrow-up
    8
    arrow-down
    1
    ·
    12 hours ago

    This code would run a lot faster as a hash table look up.

    • PieMePlenty@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      7 hours ago

      I agree. Just need a table of even numbers. Oh and a table of odd numbers, of course, else you cant return the false… duh.

    • Valmond@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      7 hours ago

      In a Juliana tree, or a dictionary tree if you want. For speed.

  • redxef@feddit.org
    link
    fedilink
    arrow-up
    31
    ·
    16 hours ago
    def is_even(n: int) -> bool:
        if n < 0:
            return is_even(-n)
        r = True
        for _ in range(n):
            r = not r
        return r
    
    • dragonlobster@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 hours ago

      He loves me, he loves me not

    • vandsjov@feddit.dk
      link
      fedilink
      arrow-up
      1
      ·
      8 hours ago

      No, no, I would convert the number to a string and just check the last char to see if it was even or not.

  • Patches@ttrpg.network
    link
    fedilink
    arrow-up
    13
    ·
    15 hours ago

    Y’all laugh but this man has amazing code coverage numbers.

  • Clbull@lemmy.world
    link
    fedilink
    arrow-up
    20
    ·
    17 hours ago

    This is YandereDev levels of bad.

    • lime!@feddit.nu
      link
      fedilink
      English
      arrow-up
      6
      ·
      14 hours ago

      this is yanderedev.

      • Clbull@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        13 hours ago

        Nah, this is yanderedev

        • lime!@feddit.nu
          link
          fedilink
          English
          arrow-up
          4
          ·
          7 hours ago

          no the code is

  • thatradomguy@lemmy.world
    link
    fedilink
    arrow-up
    7
    ·
    14 hours ago

    Can you imagine being a TA and having to grade somebody’s hw and you get this first thing? lmao

  • kamen@lemmy.world
    link
    fedilink
    arrow-up
    19
    ·
    18 hours ago

    Plot twist: they used a script to generate that code.

  • segfault11 [any]@hexbear.net
    link
    fedilink
    English
    arrow-up
    18
    ·
    18 hours ago

    pro hacker tip: you can optimize this by using “num” for the variable name instead of “number”

    • Patches@ttrpg.network
      link
      fedilink
      arrow-up
      4
      ·
      15 hours ago

      I prefer the cryptic each variable gets a single letter of the alphabet.

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.

  • 997 users / day
  • 1.49K users / week
  • 3.13K users / month
  • 9.86K users / 6 months
  • 1 local subscriber
  • 37.2K subscribers
  • 1.82K Posts
  • 38.8K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.ml
  • cat_programmer@lemmy.ml
  • UI: 0.19.7
  • BE: 0.19.11
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org