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

This is ridiculous. You can assume that you know what language you are reviewing/working in (sorry, I forgot to mention that the example is in Python). I can remember cases when I was not sure what [human] language I thinking in, but I don't remember a single case when there was a confusion what programming language I'm working in (it is not a factor in cognitive load).

filter is a builtin name in Python. There is no confusion here in practice. Static checker such as ruff will tell you if you attempt it accidentally. It is the first rule: A001 builtin-variable-shadowing.

If you are a noob the second variant may be easier to grasp. The first variant has less moving parts.



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

Search: