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

By naming the variable ID it is crystal clear what the value is. Most of the time an explicit type only adds cognitive load to the reader, and limits the universality of the code. At an high abstraction level, most of the time a type is from a program logic point of view an irrelevant machine implementation detail. If a specific duck is required it is explicitly tested. This makes code very clear when the duck type is important and when not.


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

Search: