this post was submitted on 28 Mar 2024
3 points (100.0% liked)

Programmer Humor

19471 readers
1315 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
top 11 comments
sorted by: hot top controversial new old
[–] Claudio@programming.dev 2 points 7 months ago

Probably still better than bool a; bool b; int c;...

[–] MostlyBlindGamer@rblind.com 2 points 7 months ago

Self-documenting code, high contrast… Carry on.

[–] zaphod@feddit.de 1 points 7 months ago (1 children)

ThisCommentsMakeItSoThatYouHateMeForWritingLikeThisSeriouslyICanNotStopPleaseSendHelp

[–] MostlyBlindGamer@rblind.com 0 points 7 months ago (1 children)

Would you like a snake to replace your camel?

[–] zaphod@feddit.de 0 points 7 months ago

Best I can do instead is calling it x.

[–] Enoril@jlai.lu 0 points 7 months ago* (last edited 7 months ago) (1 children)

I don’t see the benefit of this long naming convention...

It still allow bug to exist... like the fact that, with this code, the player can still play with 0 Hp.

Should have been better to put a "if(health <= 0)" instead of "< 0"

[–] nikscha@feddit.de 0 points 7 months ago

Came scrolling for this ^^

[–] Hupf@feddit.de 0 points 7 months ago (1 children)
[–] mectag@feddit.de 0 points 7 months ago* (last edited 7 months ago)

It’s an unwritten rule that there‘s always a fitting xkcd post

[–] xep@fedia.io 0 points 7 months ago (1 children)

This has likely been done intentionally for humour's sake, but take a look at some of the names in Apple's AppKit framework, like https://developer.apple.com/documentation/appkit/nspreviewrepresentingactivityitem

[–] BombOmOm@lemmy.world 1 points 7 months ago* (last edited 7 months ago)

I'm still annoyed with how verbose Objective-C is. Just check out what one has to do to create and concatenate a string. Madness:

    NSString * test = [[NSString alloc] initWithString:@"This is a test string."];
    NSString * test2 = [test stringByAppendingString:@" This value is appended."];

And god forbid you want to concatenate two things to a string:

    NSString * test3 = [test1 stringByAppendingString:[test2 stringByAppendingString:@" Adding a third value."]];