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

Are you sure the second one isn’t just declaring not_found as a stand-in for 404 so the case statement two lines below can refer to business logic rather than a “magic” constant?

I would NOT expect for the line “case not_found:” to reassign the status variable to 404 regardless of what it was before.

I can’t see how or why that would be intended behavior.



It doesn't reassign the 'status' variable, it reassigns the 'not_found" variable.


> Are you sure the second one isn’t just declaring not_found as a stand-in for 404

That's what it looks like, but no, the refactoring really does change an equality test into an assignment.




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

Search: