OrcasEnjoyingYachts
  • Communities
  • Create Post
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
gpw@lemmy.ml to Programmer Humor@lemmy.ml · 3 年前

no cap

lemmy.ml

message-square
33
link
fedilink
602

no cap

lemmy.ml

gpw@lemmy.ml to Programmer Humor@lemmy.ml · 3 年前
message-square
33
link
fedilink
alert-triangle
You must log in or register to comment.
  • JuxtaposedJaguar@lemmy.ml
    link
    fedilink
    arrow-up
    58
    ·
    3 年前

    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
    link
    fedilink
    English
    arrow-up
    51
    ·
    3 年前

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

    • gpw@lemmy.mlOP
      link
      fedilink
      arrow-up
      25
      ·
      3 年前

      Can’t wait to see Lil Yachty around work

  • Lilium (She/Her)@lemmy.blahaj.zone
    link
    fedilink
    arrow-up
    41
    ·
    3 年前

    Artistry, on god frfr 🙏🙏

  • aseriesoftubes@lemmy.world
    link
    fedilink
    arrow-up
    36
    ·
    3 年前

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

    • gpw@lemmy.mlOP
      link
      fedilink
      arrow-up
      23
      arrow-down
      1
      ·
      3 年前

      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@programming.dev
      link
      fedilink
      English
      arrow-up
      5
      ·
      3 年前

      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
        link
        fedilink
        arrow-up
        4
        ·
        3 年前

        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
    link
    fedilink
    arrow-up
    26
    ·
    3 年前

    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
      link
      fedilink
      arrow-up
      7
      arrow-down
      1
      ·
      edit-2
      3 年前

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

    • darcy@sh.itjust.works
      link
      fedilink
      arrow-up
      2
      ·
      3 年前

      number is a variable i think

      • grue@lemmy.ml
        link
        fedilink
        arrow-up
        5
        ·
        3 年前

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

        • darcy@sh.itjust.works
          link
          fedilink
          arrow-up
          1
          ·
          3 年前

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

  • db2@sopuli.xyz
    link
    fedilink
    arrow-up
    23
    ·
    edit-2
    3 年前

    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
      link
      fedilink
      arrow-up
      5
      ·
      3 年前

      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
        link
        fedilink
        arrow-up
        5
        ·
        3 年前

        !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
      link
      fedilink
      arrow-up
      1
      ·
      3 年前

      Yes.

  • MrNoodleBox@lemm.ee
    link
    fedilink
    arrow-up
    20
    ·
    3 年前

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

    • rt136us@sh.itjust.works
      link
      fedilink
      arrow-up
      4
      ·
      3 年前

      That’s my favorite esoteric programming language!

  • bronzle@lemm.ee
    link
    fedilink
    arrow-up
    19
    ·
    3 年前

    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 ;
    }
    
  • NegativeLookBehind@kbin.social
    link
    fedilink
    arrow-up
    18
    ·
    3 年前

    My eyes are bleeding

    • gpw@lemmy.mlOP
      link
      fedilink
      arrow-up
      24
      ·
      3 年前

      The path to salvation is filled with terrors and temptation

      no cap

  • BleatingZombie@lemmy.world
    link
    fedilink
    arrow-up
    17
    ·
    3 年前

    I hate this. Where do I find more?

    • grue@lemmy.ml
      link
      fedilink
      arrow-up
      6
      ·
      3 年前

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

      • Zucca@sopuli.xyz
        link
        fedilink
        arrow-up
        3
        ·
        3 年前

        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.

  • OniiFam@lemmy.blahaj.zoneBanned
    link
    fedilink
    English
    arrow-up
    17
    arrow-down
    1
    ·
    edit-2
    3 年前

    Removed by mod

  • RickyRigatoni@lemmy.ml
    link
    fedilink
    arrow-up
    14
    ·
    3 年前

    i am seething with rage

    • Zucca@sopuli.xyz
      link
      fedilink
      arrow-up
      4
      ·
      3 年前

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

  • blackluster117@possumpat.io
    link
    fedilink
    English
    arrow-up
    10
    ·
    3 年前

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

  • Mr Reach @lemmy.world
    link
    fedilink
    arrow-up
    9
    ·
    3 年前

    I threw up in my mouth.

  • Jax@kbin.social
    link
    fedilink
    arrow-up
    7
    ·
    3 年前

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

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.

  • 18 users / day
  • 388 users / week
  • 3.55K users / month
  • 8.89K users / 6 months
  • 1 local subscriber
  • 43.6K subscribers
  • 2.03K Posts
  • 39.9K Comments
  • Modlog
  • mods:
  • AgreeableLandscape@lemmy.mldeleted by creator
  • cat_programmer@lemmy.ml
  • BE: 0.19.20
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org