I’m having such a great time dealing with lazy code. Check out these gems I’ve found just today …
Why format something that with no parameters? I changed the code to this:
Here’s another good one:
Let’s completely avoid the format specifiers and convert everything to strings manually. I changed it to this:
What I’m finding really frustrating is that I know the developer who wrote this code, and he’s a smart guy who writes good code most of the time.
Upon reflection, I’d suggest that this code is less important for the actual errors, and more as a reminder that we all can make those errors, even (or especially) those of us who think we’re pretty good at what we do.