"Samsung's printer technology must really be something," writes Tim, "A black and white printer able to output a full color photo?! Who knew!"
We pick on date handling code a lot here, simply because there are so many ways to mess up date related code (because dates are hard). In a way, it’s almost like we’re cheating. Even smart programmers could mess that up. What about basic conditional logic? How hard could that be to mess up?
Well Jan L. came across this solution to a simple boundary check- if
telegramType is between 100 and 199, it is a payment type telegram.
Today's snippet needs very little introduction. In the words of the submitter:
[My predecessor] is what I would consider, among the worst programmers in the world. While his programs actually do work and do what they should, his techniques and programming decisions are very questionable. The [below] code snippet is from a program he wrote after he spend about a year at this company.
Will, his boss Rita, and Nick from HR huddled around a conference room speakerphone, listening to their new marching orders from the giant company that’d just bought out their small 100-person shop. Big changes would be avalanching down from Corporate over the next several months. For the moment, they were going over the modifications required to be complaint with their new overlords’ IT policies.
Design patterns are more than just useless interview questions that waste everyone’s time and annoy developers. They’re also a set of approaches to solving common software problems, while at the same time, being a great way to introduce new problems, but enough about Spring.
For those of us that really want global variables back in our object oriented languages, the Singleton pattern is our go-to approach. Since it’s the easiest design pattern to understand and implement, those new to design patterns tend to throw it in everywhere, whether or not it fits.
Jim’s mail client dinged and announced a new message with the subject, “Assigned to you: TICKET #8271”. “Not this again,” he muttered.
Ticket #8271 was ancient. For over a year now, Initech’s employees had tossed the ticket around like kids playing hot potato. Due to general incompetence and rigid management policies, it never got fixed.