r/shittyprogramming • u/deathmetal27 • Sep 26 '18
What does "code smell" smell like?
The guy reviewing my code says that he has observed a lot of code smells. But I donβt smell anything. Makes me think he's messing with me. I am pretty sure that I have not lost my sense of smell.
150
Upvotes
86
u/souldeux Sep 26 '18 edited Sep 26 '18
It depends.
Some code, written at the start of a project when hope is high and abstraction is higher, doesn't smell bad at all. Flowery and damp, like the second or third week of spring. It's fresh, and it speaks of things to come. But there's still a note of manure underneath. A little stink of shit, a smelly little omen.
Some code smells dusty, choking, acrid - code marked with comments like
WARNING: MAGICorDO NOT REFACTOR. Dried-up husks of what might've once been bugs lie here and there, commented out but never truly deleted, untouched for years and doomed to lie untouched for many more.Some code smells plasticine, industrialized - code with method names that include words like "Factory" and "Generator." There is often a slightly rotten smell near this type code, which you can trace to the accompanying documentation that has drifted badly out of date.
Some code smells like the wet musk of hot, frothy sex. It only smells good while you're writing it - leave the room for an hour or so, and you'll find the stank unbearable when you return.
Some code smells like pineapple. Python's
lambdastatements have a strong whiff of this. Sweet and tart in a nice way for a while, but too much can be irritating.Some code smells like Irish coffee. A fresh mug of a nice pick-me-up with a secret sauce hidden inside. This is the hardcoded magic number three thousand lines deep in some data parser just beneath the comment saying
fuck it.11
u/PM_ME_YOUR_HIGHFIVE Sep 26 '18
it smells like decaf coffee
8
u/[deleted] Sep 26 '18
Badly burnt pineapple strudel with a dash of fresh dog turd.
8
u/pimanac Sep 26 '18
like r/shittyprogramming
5
u/jarfil Sep 27 '18 edited Dec 02 '23
CENSORED
4
u/glorygeek Sep 26 '18
It smells if'fy
4
u/morphotomy Sep 27 '18
It smells like shit.
3
u/KazDragon Sep 26 '18
Exactly like bacon doesn't.
3
u/OrbDeceptionist Sep 26 '18
Team spirit
3
u/AngelOfLight Sep 26 '18
You know how you crush a lavender petal to get that smell? Now, imagine you were crushing a human spirit...
2
u/hajamieli Sep 26 '18
Usually like matcha, which is what I believe is the main cause of smelly code.
2
u/nemec Sep 27 '18
Walk into a university computer lab at 5AM during finals - it'll hit you.
1
u/[deleted] Sep 26 '18
Rancid spaghetti in a giant ball of mud.
1
u/plankmeister Sep 26 '18
Smells like the little hollow between your scrotum and thigh after not showering for a few days.
1
u/RasterTragedy Sep 26 '18
π©
1
u/HashtagFour20 Sep 27 '18
it smells like updog
1
u/green_meklar Sep 27 '18
Freshly cooked spaghetti.
1
u/spazza360 Sep 27 '18
Smells like synesthesia.
1
u/slappingpenguins Sep 27 '18
Anytime he scratches his head or hrmphs. that's the smell.
0
u/[deleted] Sep 26 '18
[deleted] β view deleted comment