12 sats \ 2 replies \ @029fd47a78 29 Sep 2023 \ parent \ on: The Legacy of Feinstein bitcoin
The voices of the very old should still be heard though. They have a perspective we will never have and grew up in a very different world to today's youth.
Should they be running things? Probably not.
Should they have a say to some extent in government? I'd say yes.
Obviously they are heavily over-represented at the moment while other age ranges have barely any representation (where are the 20yo senators!)
Here are some things that are not necessarily always bad but that I think smell:
-
No unit tests: The first thing I do in a new codebase is open the tests folder. A good set of tests should basically be API documentation for your code, showing me what it typically does, how it could go wrong, and what mitigations have been put in place.
-
Excessive use of mocks in tests: It's fine, and helpful, to mock out a few http requests, etc. but when your mocking code becomes as complex as the code under test, you have to wonder what is even being tested. Also, the source code becomes difficult to change: want to change one line? Now all of the tests fail because the mocks don't make sense any more and you have to spend much longer fixing up the mocks than it took to make the original code change.
-
No readme (or some useless, generic one that has nothing to do with this particular bit of code): I don't have time to analyze all of your code. Tell me what it does and how to test/package/run it.
-
Magic numbers: e.g. retry(5). What is that? Retry in 5 seconds? Retry 5 times? If the latter, then why not MAX_RETRIES = 5 or something then retry(MAX_RETRIES)?
-
Main/handler functions that basically do everything with no smaller functions. Impossible to test properly and difficult to add functionality.
-
Functions that take too many arguments: This is normally a sign that your functions have too many responsibilities or that you are passing data around in your code unnecessarily.
-
Singleton classes that exist solely to serve as a namespace. Especially annoying in something like Python where the file is a namespace.
-
Files or directories named "utils": these normally end up containing a bunch of misc. stuff because devs were too lazy to figure out where things should actually go because that might involve a little bit of refactoring and tidying up
-
Lack of type annotations (if the language supports them). Running a static type checker can eliminate a whole class of bugs. Annotations also help with code readability.
Stuff that is implemented twice
I agree, this is annoying most of the time.
But the thing I run into a lot and really can't stand is premature abstraction: "These 2 things look the same. Let's build a package with some base class so that everything is DRY"
Some time later, it turns out that the 2 things aren't remotely the same. Meanwhile, layers upon layers of crap have been built with this package as a dependency and I've got to trawl through it, tease the 2 things apart, refactor anything that uses the package, and/or convince other teams/users that they need to do the same in their code. Not fun
For me, the fact that we seem to be on the verge of destroying ourselves and the planet makes me think that if we do manage to turn it around, then we will have to have grown into something much better than what we are at the moment. I'm banking on us turning it around since humans are pretty good at survival
GENESIS