unboiled.info
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
hoch@lemmy.world to Programmer Humor@lemmy.ml · 9 months ago

More code = more better

lemmy.ml

external-link
message-square
9
link
fedilink
50
external-link

More code = more better

lemmy.ml

hoch@lemmy.world to Programmer Humor@lemmy.ml · 9 months ago
message-square
9
link
fedilink
alert-triangle
You must log in or register to comment.
  • davel [he/him]@lemmy.ml
    link
    fedilink
    English
    arrow-up
    6
    ·
    9 months ago

    x = λs. λz. s (s (s (s (s (s (s (s (s (s z)))))))))

  • mcv@lemmy.zip
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    What the hell kind of magic number is this? Define that stuff in an environment variable, and write a singleton to make the value transparently available where you need it.

    • anton@lemmy.blahaj.zone
      link
      fedilink
      arrow-up
      1
      ·
      9 months ago

      Exactly, you never know when you want to change the base for printing out from under someone.

  • hddsx@lemmy.ca
    link
    fedilink
    arrow-up
    2
    ·
    9 months ago

    Do you work for Musk?

  • ferric_carcinization@lemmy.ml
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    9 months ago

    The compiler should be able to optimize all of them to the same machine code.

    1. This is already good.
    2. Easily optimized by constant folding.
    3. This one depends on the semantics of signed underflow, so it may not do what you want.
    4. The loop can only exit if x==10, so as long as the nextInt() method doesn’t have side effects, the loop should be eliminated. But, again, language semantics can affect this.

    Edit: Very wrong for 3 & 4, see replies.

    • ryannathans@aussie.zone
      link
      fedilink
      arrow-up
      3
      ·
      9 months ago

      I’d be shocked if 4 got optimised out

      • Mio@feddit.nu
        link
        fedilink
        arrow-up
        1
        ·
        9 months ago
        1. It is used to warm up the house.
  • sepi@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 months ago

    Genius MIT Hacker

  • billwashere@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    9 months ago

    And now this will be in someone’s vibe coded project…

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
  • 1 user / week
  • 1 user / month
  • 897 users / 6 months
  • 1 local subscriber
  • 42.9K subscribers
  • 1.79K Posts
  • 30K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.mldeleted by creator
  • cat_programmer@lemmy.ml
  • UI: unknown version
  • BE: 0.19.20
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org