Software Engineering discussion
Code Complete
>
Defensive Programming
date
newest »
newest »
I have not used assertions as postcondition checks, but that's a great idea. It almost seems like using nunit to make test cases.The ancedote about the unprofessional debug messages hits home too. I had some coworkers do that, but our customers were not amused when the found the debug messages.
Aside: My computer crashed, so I'm very far behind the group in reading this book.
I liked the discussion on Debugging Aids and Defensive Programming in Production and Development code. For some reason I’ve never thought about the difference between production and development code or mode as described in this chapter. Writing debug code takes time, and it makes sense to activate or deactivate it as needed using tools that already available like preprocessor or source control. I need to research if my IDE already supports some DEBUG directives for debugging.


The idea of barricades was new to me, and it seems like a good strategy for secure coding, where a "trust no one" mentality prevales.