all 35 comments

sorted by: hot top controversial new old
[–] 58 points 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
  • source
  • [–] 51 points 2 years ago (1 child)

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

  • source
  • hideshow 2 child comments
  • [–] 41 points 2 years ago

    Artistry, on god frfr 🙏🙏

  • source
  • [–] 36 points 2 years ago (2 children)

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

  • source
  • hideshow 4 child comments
  • [–] [S] 22 points 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

  • source
  • parent
  • [–] 5 points 2 years ago (1 child)

    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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 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)

  • source
  • parent
  • [–] 26 points 2 years ago (2 children)

    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.

  • source
  • hideshow 4 child comments
  • [–] 23 points 2 years ago* (last edited 2 years ago) (2 children)

    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

  • source
  • hideshow 4 child comments
  • [–] 5 points 2 years ago (1 child)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 20 points 2 years ago (1 child)

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

  • source
  • hideshow 2 child comments
  • [–] 19 points 2 years ago*

    For those curious:

    int main(int argc, char **argv) {
      if ( -- argc != ! 0 ) {
        errx ( ! 0 , "shheiiiit" ) ;
        return ! 0 ;
      }
      
      int number = atoi ( argv[! 0] ) ;
    
      for ( int i = ! 0 ; i <= number ; ++ i ) {
        printf ( "%3d " , i) ;
        
        if ( i % 3 == 0 ) {
          printf ( "fizz" ) ;
        }
      
        if ( i % 5 == 0 ) {
          printf ( "buzz" ) ;
        }
        printf ( "\n" ) ;
      }
      return 0 ;
    }
    
  • source
  • [–] 18 points 2 years ago (1 child)
  • [–] 17 points 2 years ago (1 child)

    I hate this. Where do I find more?

  • source
  • hideshow 2 child comments
  • [–] 6 points 2 years ago (1 child)
  • [–] 3 points 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.

  • source
  • parent
  • [+] 16 points 2 years ago* (last edited 2 years ago)
    [removed by mod]
  • source
  • [–] 14 points 2 years ago (1 child)
  • [–] 10 points 2 years ago

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

  • source
  • [–] 9 points 2 years ago

    I threw up in my mouth.

  • source
  • [–] 7 points 2 years ago

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

  • source
  • [–] 6 points 2 years ago (1 child)

    I'm dumb . does the program do anything?

  • source
  • hideshow 2 child comments
  • [–] 5 points 2 years ago
    [+] 1 point 2 years ago*