Yes, those are examples of bad code - I've written it, and in a code review (y'all do those, via reading pull requests or some other method, right? Your new hires don't just start shoving commits into master, right?), the senior developers pointed out my mistakes, and showed me the correct way to do things. Once I became a somewhat better developer, it was my turn to do the same thing for those who know less than I do - or even for those who maybe just got a bad night's sleep, and aren't at their best that day.
It is fucking frightening that this blog post needs to be written.