2
votes
3answers
124 views

How to re-factor a common String comparison

Code below is scattered all over the code base : if (StringUtils.contains(manager.getName, "custom")){ } It just checks if an object attribute contains a predefined String and if it does, enter ...
2
votes
2answers
311 views

Defensive programming in C

I wrote a function (get_last_word_of) that takes a C string and a destination buffer, and then copies the last word into the buffer. The code was originally C++, and was changed into C later. ...