r/badcode • u/TheNightSkyDude • Apr 12 '23
c Doing my university project. I thought these would be more comfortable than a bunch of "temp"s.
708
Upvotes
r/badcode • u/TheNightSkyDude • Apr 12 '23
149
u/Corrupted_Link Apr 12 '23
What is a cuaddy Is it some new version of daddy?
45
u/Character_Regular440 Apr 12 '23
that's kinda scary... can i ask what the project is about?
11
u/moomoomoo309 Apr 13 '23
This is a perfect example of how not to name variables - it is literally what the variable is, but has no semantic meaning (it doesn't tell you what the hell that means or why it's used how it is)
18
u/Micha_Saengy Apr 12 '23
It's not just that they arent locally scoped, but also the names .. you can write out what they mean.
2
u/bartekltg Apr 18 '23
As soon as your professor sees it, you will be hired as a FORTRAN programmer to maintain the ancient numerical code.
224
u/Illustrious-Macaron2 Apr 12 '23
Ok I will start using temps Jesus Christ
16
u/squidwardnixon Apr 13 '23
Lol it's literally lengthening exponentially. Like you can draw the curve.
6
u/NickSicilianu Apr 12 '23
Wtf 😬 And why are some of them pointers of pointers 😂 RIP performance on accessing those 😂
6
u/MurdoMaclachlan public boolean isInt(int i) { return true; } Apr 13 '23
Image Transcription: Code
I'm a human volunteer content transcriber and you could be too! If you'd like more information on what we do and why we do it, click here!
2
u/lazywulf09009 Apr 30 '23
“Ok… fine… (reads last line) what the actual fu-“
1
u/_begovic_ Apr 13 '23
Only absolute chads use 1-2 letter variables with vague meanings
1
u/earthwormjimwow Apr 13 '23
Needs some hungarian notation, how am I supposed to know what data type these are?!
1
u/No-Adeptness5810 Apr 23 '23
that's a nice exponential variable assignment :))
1
u/IamStupid42069 May 13 '23
c'mon and you didn't even initialize them to nullptr? haha :3
-2
u/Haaxor1689 Apr 13 '23
Naming aside, declare variables where you actually need the first. I'm getting stack overflow flashbacks from this.
0
u/[deleted] Apr 13 '23
[deleted] — view deleted comment