Code reuse is one of the key steps to maintainability. There are many ways a developer might make their code reusable. For example, Steve’s co-worker wrote this block, which generates 1000 log entries:
Adam worked for a moving company. When he joined up, it was a regional enterprise with several locations and a surprisingly large fleet of trucks. One day, he came to work to learn that he now worked for a much larger, national company, called ConHugeCo. Nobody was getting fired, but now Adam had to get their data integrated with ConHugeCo’s.
“Hey, can you give me a hand? This computer I built won’t boot.”
Comments are a vital part of making code readable, but they’re more than just documentation. They’re communication between one developer and another. They tell us what the code does, but also how we feel about it.
Data-driven applications need to generate SQL from time to time. Usually, we leverage things like stored procedures or ORM tools
to keep our code sane, but from time to time, we might hard code our SQL statements. You sacrifice some flexibility for some transparency into what your code actually does to the database.
There was nothing unusual about an unusual ticket. Matt worked helldesk at an assembly plant, and not a week went by without some confusing brain-bender from his users. He didn’t blink when he received this ticket: