no cap

564 points · 33 comments · view on lemmy.world

33 Comments

JuxtaposedJaguar@lemmy.ml · 53 pts · 3y

Reminds me of lolcode:

HAI 1.2
CAN HAS STDIO?
PLZ OPEN FILE "LOLCATS.TXT"?
    AWSUM THX
        VISIBLE FILE
    O NOES
        INVISIBLE "ERROR!"
KTHXBYE
fluxion@lemmy.world · 51 pts · 3y (1 reply)

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

gpw@lemmy.ml · 25 pts · 3y

Can't wait to see Lil Yachty around work

Lilium@lemmy.blahaj.zone · 39 pts · 3y

Artistry, on god frfr ๐Ÿ™๐Ÿ™

aseriesoftubes@lemmy.world · 35 pts · 3y (3 replies)

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

gpw@lemmy.ml · 21 pts · 3y

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

technohacker@programming.dev · 4 pts · 3y (1 reply)

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

vanZuider@feddit.de · 4 pts · 3y

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)

grue@lemmy.ml · 25 pts · 3y (4 replies)

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.

bronzle@lemm.ee · 5 pts · 3y

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

darcy@sh.itjust.works · 2 pts · 3y (2 replies)

number is a variable i think

grue@lemmy.ml · 5 pts · 3y (1 reply)

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

darcy@sh.itjust.works · 1 pts · 3y

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

db2@sopuli.xyz · 21 pts · 3y (3 replies)

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

grue@lemmy.ml · 5 pts · 3y (1 reply)

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.

bronzle@lemm.ee · 5 pts · 3y

!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

SnowdenHeroOfOurTime@unilem.org · 1 pts · 3y

Yes.

MrNoodleBox@lemm.ee · 18 pts · 3y (1 reply)

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

rt136us@sh.itjust.works · 4 pts · 3y

That's my favorite esoteric programming language!

BleatingZombie@lemmy.world · 18 pts · 3y (2 replies)

I hate this. Where do I find more?

grue@lemmy.ml · 6 pts · 3y (1 reply)
Zucca@sopuli.xyz · 3 pts · 3y

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.

NegativeLookBehind@kbin.social · 18 pts · 3y (1 reply)

My eyes are bleeding

gpw@lemmy.ml · 23 pts · 3y

The path to salvation is filled with terrors and temptation

no cap

bronzle@lemm.ee · 17 pts · 3y

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 ;
}
OniiFam@lemmy.blahaj.zone · 15 pts · 3y
[ removed ]
RickyRigatoni@lemmy.ml · 13 pts · 3y (1 reply)

i am seething with rage

Zucca@sopuli.xyz · 4 pts · 3y

I'm not a C programmer (is this code even C?), but I anticipated seeing comments like this. ๐Ÿ˜‚

Mr_Reach@lemmy.world · 10 pts · 3y

I threw up in my mouth.

blackluster117@possumpat.io · 9 pts · 3y

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

Jax@kbin.social · 7 pts · 3y

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

quinkin@lemmy.world · 5 pts · 3y

frfr

Stinkypete@lemmy.ml · 3 pts · 3y (1 reply)

I'm dumb . does the program do anything?

Starry@lemmy.world · 14 pts · 3y

This is FizzBuzz.

bronzle@lemm.ee · 1 pts · 3y
[ removed ]