3 ms·
The worst code: - Duplicates large, dumb patterns in slightly different ways throughout - Lacks coherent naming or compartmentalization: it's just a pile of s
by 1letterunixname 4y ago
The worst code:
- Duplicates large, dumb patterns in slightly different ways throughout
- Lacks coherent naming or compartmentalization: it's just a pile of shit (statements or expressions)
- Lacks testing
- Is difficult and unpleasant to read
- Is ugly: not formatted, inconsistently formatted, and lacks any sort of regularity
- Combines many functions into god objects and god functions without clear intent. Who knows what any of that crap is supposed to do, or if it's even doing anything correctly
- If not lacking comments, contains useless boilerplate comments that take up visual real estate
- Verbosely reinvent low-level constructs poorly
- Live as numerous, fragile, interdependent pieces scattered across many files and time (runtime)
- Are configured in unclear and confusing ways that create incompatible states that break
- Includes code that is never used
- Contains fragments of experiments that were never discarded
- Combined and abstracts over opaque units of other junk that doesn't behave properly
- Doesn't sanitize untrusted input
- Doesn't give the user sensible feedback
- Makes the user do unnecessary steps themselves
- Acts in unpredictable ways
- Tries to solve a problem that never needed solving to begin with
- Prematurely optimizes the previous
- marginalia_nu 4y agoHmm, a third of these points are subjective value judgements about the aesthetics of the code.
- ajkjk 4y ago"Subjective" doesn't mean "wrong". Do you only want people to post things they have, like, data for?
- marginalia_nu 4y agoA measuring stick that is of different lengths depending on who wields it is not a good measuring stick. Different people may use the same list to arrive at contradictory conclusions about the same code. You, following your preferences and customs, may look at your code and think it is great. I, having different aesthetic preferences and being accustomed to different paradigms, may look at it and think it is the worst code.
- ajkjk 4y agoPointing out that subjectivity _can_ be wrong is unhelpful and uninteresting. What about the actual list they posted? Do you think it is wrong? Then criticize it in substance, not in principle.
- 1letterunixname 4y agoWhich? What specific point are you making? Usable aesthetics matter for reduction of cognitive load. If lengthy lines of semi-similar code aren't aligned to visually see they are correct, that's less maintainable code.