Top "Defensive-programming" questions

Defensive programming is a form of defensive design intended to ensure the continuing function of a piece of software in spite of unforeseeable usage of said software.

When should I use Debug.Assert()?

I've been a professional software engineer for about a year now, having graduated with a CS degree. I've known about …

language-agnostic exception testing assertions defensive-programming
Is it possible that Java String.split can return a null String[]

Is it possible for split to return a null String[]? I am curious as I want to try to be …

java string defensive-programming
What's the purpose of using braces (i.e. {}) for a single-line if or loop?

I'm reading some lecture notes of my C++ lecturer and he wrote the following: Use Indentation // OK Never rely on …

c++ c coding-style curly-braces defensive-programming
Techniques for obscuring sensitive strings in C++

I need to store sensitive information (a symmetric encryption key that I want to keep private) in my C++ application. …

c++ security obfuscation defensive-programming
How to hide strings in a exe or a dll?

I discovered that it is possible to extract the hard-coded strings from a binary. For example the properties view of …

c++ security obfuscation reverse-engineering defensive-programming
C++ always use explicit constructor

After reading the following blog : http://xania.org/200711/ambiguous-overloading I started asking myself "should I not always explicit define my …

c++ constructor explicit defensive-programming
Copy constructors and defensive copying

What is a copy constructor? Can someone share a small example that can be helpful to understand along with defensive …

java defensive-programming
Erlang's let-it-crash philosophy - applicable elsewhere?

Erlang's (or Joe Armstrong's?) advice NOT to use defensive programming and to let processes crash (rather than pollute your code …

java .net erlang defensive-programming
Is this code defensive programming, or bad practice?

I have this debate with my colleague about this piece of code: var y = null; if (x.parent != null) y = …

c# defensive-programming
0xDEADBEEF equivalent for 64-bit development?

For C++ development for 32-bit systems (be it Linux, Mac OS or Windows, PowerPC or x86) I have initialised pointers …

c++ debugging 64-bit defensive-programming