Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I still remember one of my first teachers of programming softly shaming me for writing a condition like

if (something == true)

I haven't done so ever since (1997), and thus I avoid the contrary (with == false) as well, using ! instead. But I would be a lot less ashamed if I knew that there are such conditions in production software.

I would also never guess that the problem described in the article may occur...

 help



Buy your teacher a drink! I went into university with the baggage of ten years of programming experience, mentored by my industry-experienced father. One of our profs had the exact reverse point of view (i.e. "foo == true" was according to him "good practice"), and I wisely chose to disregard his opinions on coding practices from that point on.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: