• @[email protected]OP
      link
      fedilink
      221 year 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
      English
      51 year 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
        41 year 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
    261 year 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.

  • @[email protected]
    link
    fedilink
    23
    edit-2
    1 year 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
      51 year 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
        51 year 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
    19
    edit-2
    1 year 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 ;
    }
    
    • @[email protected]
      link
      fedilink
      41 year ago

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

  • @[email protected]
    link
    fedilink
    English
    101 year ago

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

  • Jax
    link
    fedilink
    71 year ago

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