Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 2 years ago

no cap

lemmy.ml

message-square
33
fedilink
632

no cap

lemmy.ml

@[email protected] to Programmer [email protected] • 2 years ago
message-square
33
fedilink
alert-triangle
You must log in or register to comment.
  • @[email protected]
    link
    fedilink
    14•2 years ago

    i am seething with rage

    • @[email protected]
      link
      fedilink
      4•2 years ago

      I’m not a C programmer (is this code even C?), but I anticipated seeing comments like this. 😂

  • @[email protected]
    link
    fedilink
    20•2 years ago

    Reminds me of Rockstar. The example also implements Fizz Buzz.

    • @[email protected]
      link
      fedilink
      4•2 years ago

      That’s my favorite esoteric programming language!

  • @[email protected]
    link
    fedilink
    57•2 years ago

    Reminds me of lolcode:

    HAI 1.2
    CAN HAS STDIO?
    PLZ OPEN FILE "LOLCATS.TXT"?
        AWSUM THX
            VISIBLE FILE
        O NOES
            INVISIBLE "ERROR!"
    KTHXBYE
    
  • NegativeLookBehind
    link
    fedilink
    18•2 years ago

    My eyes are bleeding

    • @[email protected]OP
      link
      fedilink
      23•2 years ago

      The path to salvation is filled with terrors and temptation

      no cap

  • @[email protected]
    link
    fedilink
    23•
    edit-2
    2 years ago

    Does it make me a bad person that I like this?

    Edit: wait… return ! 0 ; wtf

    Edit 2: idc still like it frfr no cap

    • @[email protected]
      link
      fedilink
      5•2 years ago

      Edit: wait… return ! 0 ; wtf

      I mean, returning non-zero exit status on error is just good practice. It even managed to evaluate to the same numerical value as EXIT_FAILURE when I tested it on my machine (gcc 11.4.0 linux x86-64), although I’m not sure if that’s always the case or if it’s undefined behavior.

      This cursed code is quite well-written.

      • @[email protected]
        link
        fedilink
        5•2 years ago

        !0 is defined as 1, that’s how argv [ no cap ] works, that and the ridiculous argc check stood out as a bit off, but works

    • @[email protected]
      link
      fedilink
      1•2 years ago

      Yes.

  • @[email protected]
    link
    fedilink
    English
    50•2 years ago

    And that’s how rappers became the top programmers in the industry

    • @[email protected]OP
      link
      fedilink
      24•2 years ago

      Can’t wait to see Lil Yachty around work

  • Lilium (She/Her)
    link
    fedilink
    41•2 years ago

    Artistry, on god frfr 🙏🙏

  • @[email protected]
    link
    fedilink
    36•2 years ago

    I have to say, I like the substitution of yeet for return. No cap.

    • @[email protected]OP
      link
      fedilink
      23•2 years ago

      All of my returns are going to be yeet from now on

      My code reviewers will respond to my commits with on god 🙏

      My manager will do girl math to determine my next raise

      #zoom

    • Kevin
      link
      fedilink
      English
      5•2 years ago

      Rust has an RFC that wants to consider yeet as a keyword for throwing an exception, I think they’re currently keeping it as a placeholder just in case

      • @[email protected]
        link
        fedilink
        4•2 years ago

        AFAIK they’re not seriously considering it as a keyword, but they agreed that in all discussion about the semantics of exceptions they will use “yeet” as a placeholder for the keyword, so people will actually discuss the semantics and not whether the keyword is gonna be “raise”, “throw”, “except” or whatever (so-called Bikeshed Effect)

  • @[email protected]
    link
    fedilink
    17•2 years ago

    I hate this. Where do I find more?

    • @[email protected]
      link
      fedilink
      6•2 years ago

      https://duckduckgo.com/?q=abuse+of+the+c+preprocessor

      • @[email protected]
        link
        fedilink
        3•2 years ago

        Holy unholiness, Batman!

        I did expect those kinds of tricks would cause syntax error in #defines, but instead looks like everything is allowed… Some day someone #defines a such abomination that it creates universe wide black hole -like vacuum and everything ceases to exist.

  • Jax
    link
    fedilink
    7•2 years ago

    I was going to suggest ALL CAPS in response, but then I remembered COBOL already exists.

  • @[email protected]
    link
    fedilink
    English
    17•
    edit-2
    2 years ago

    removed by mod

  • @[email protected]
    link
    fedilink
    7•2 years ago

    I’m dumb . does the program do anything?

    • @[email protected]
      link
      fedilink
      14•2 years ago

      This is FizzBuzz.

  • @[email protected]
    link
    fedilink
    English
    10•2 years ago

    It’s like watching a car crash in slow motion trying to read it. I can’t look away…

  • Mr Reach
    link
    fedilink
    9•2 years ago

    I threw up in my mouth.

  • @[email protected]
    link
    fedilink
    25•2 years ago

    Pro tip: the arguments to main() don’t have to be named argc and argv.

    Also, you forgot to #define an alias for atoi, and number, n, and i could’ve been named something more on fleek.

    • darcy
      link
      fedilink
      2•2 years ago

      number is a variable i think

      • @[email protected]
        link
        fedilink
        5•2 years ago

        Yes, as are n and i. Do they not deserve ‘fleekness?’

        • darcy
          link
          fedilink
          1•2 years ago

          sorry i misread. i thought u meant number was not #define’d

    • @[email protected]
      link
      fedilink
      7•
      edit-2
      2 years ago

      Also could have takin out mains return type and used sus chief

Programmer [email protected]

[email protected]
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: [email protected]

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.
  • 9 users / day
  • 90 users / week
  • 365 users / month
  • 1.54K users / 6 months
  • 4 subscribers
  • 1.83K Posts
  • 38.7K Comments
  • Modlog
  • mods:
  • @[email protected]
  • @[email protected]
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org