BUILDING PHILOSOPHY LIFESTYLE HABITS ADVICE CAREERS BUSINESS ENTERPRISE SELLING

<
#93
>


Is becoming a lazy programmer evolving?

Show me any tool and I'll show you a horrible use of that tool. That doesn't make the tool horrible.

ELSE statements don't kill. Drunk programmers kill.

This reminds me of something I once ran into:

Junior Programmer:

if (m==1){Month="January")}

if (m==2){Month="February")}

if (m==3){Month="March")}

if (m==4){Month="April")}

if (m==5){Month="May")}

if (m==6){Month="June")}

if (m==7){Month="July")}

if (m==8){Month="August")}

if (m==9){Month="September")}

if (m==10){Month="October")}

if (m==11){Month="November")}

if (m==12){Month="December")}

Senior Programmer:

switch(m)

{

case 1:

Month = "January"

break;

case 2:

Month = "February"

break;

case 3:

Month = "March"

break;

case 4:

Month = "April"

break;

case 5:

Month = "May"

break;

case 6:

Month = "June"

break;

case 7:

Month = "July"

break;

case 8:

Month = "August"

break;

case 9:

Month = "September"

break;

case 10:

Month = "October"

break;

case 11:

Month = "November"

break;

case 12:

Month = "December"

break;

default:

Month = "unknown"

}

Lazy Programmer:

MonthNames == ["","January","February","March",...]

Month = MonthNames[m]

Tech books make you Good.  People books make you Better...
and
coming
fall
2017...
 
LERN
HOW
TOO
RITE
dont let bad riting hold u back
50 Documents
Every Programmer
Must Be Able to Write
ED WEISSMAN

All email answered.  edw519 at gmail
Copyright © 2017 Ed Weissman