Defensive programming: Difference between revisions

Content deleted Content added
m Other techniques: Copyedit, made "data" plurality match rest of section
Line 55:
;Overly defensive programming
<syntaxhighlight lang="c">
const char* trafficlight_colorname(enum trafficlight_colortraffic_light_color c) {
switch (c) {
case TRAFFICLIGHT_RED: return "red";
Line 67:
;Offensive programming
<syntaxhighlight lang="c">
const char* trafficlight_colorname(enum trafficlight_colortraffic_light_color c) {
switch (c) {
case TRAFFICLIGHT_RED: return "red";