Code Style Evolution : // Newbie

SHARE

Code style evolution : // newbie, 11 lines public string getsex (int num) { if (num==0) { return "female" ; } else { return "male" ; } } // 1 year later, 6 lines public string getsex (int num) { if (num==0) { return "female" ; } return "male"; } // 2 years later + lazy writing, 3 lines public string getsex (int num) { return num == 0 ? "female " : "male" ; }

SHARE