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

Either choice doesn't really look like the sane language anymore


When you have dynamically typed languages, whether to coerce or not is a design decision with usability trade-offs. Javascript exhibits pretty similar behavior with switch statements for exactly the same reason: it also has two types of equality comparisons.

Also, PHP allows you to add explicit type casting to case statements. e.g.,

    case (string) 1:




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

Search: