this post was submitted on 08 Nov 2023
56 points (93.8% liked)
Asklemmy
43891 readers
809 users here now
A loosely moderated place to ask open-ended questions
Search asklemmy ๐
If your post meets the following criteria, it's welcome here!
- Open-ended question
- Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
- Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
- Not ad nauseam inducing: please make sure it is a question that would be new to most members
- An actual topic of discussion
Looking for support?
Looking for a community?
- Lemmyverse: community search
- sub.rehab: maps old subreddits to fediverse options, marks official as such
- [email protected]: a community for finding communities
~Icon~ ~by~ ~@Double_[email protected]~
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
It's a simple function definition that's equivalent to:
Not the most original punchline; I'm sure you've seen it before. We were just baffled to actually see it in the wild.
Judging from the way this function was used, there no evidence to suggest it ever contained extra logic that was refactored out over time. I'm wholly convinced someone wrote this as-is and thought it was okay. I also knew that there's no way this was extracted for DRY purposes, as it was only called in one place, and the rest of the codebase was extremely allergic to DRY.
It was also formatted like complete garbage. Indentation level was not consistent line by line. And, presumably due to some carelessness handling line endings, the entire code file developed double-spacing. Somehow it was checked into version control in that state.
All these little nits, from the code's utter uselessness to its appalling formatting, compelled us to preserve it. It was like the entire rest of the shitty codebase in microcosm.
That's... incredible. If people who write code like that can get programming jobs, maybe I shouldn't be quite so worried about my own skills.
It's not usually where the big bucks are, but there is a nonzero amount of money in bad code.