3 ms·
“Instead of falling into that trap, he just used parentheses.” That’s my conclusion too. Especially when I deal with several languages at the same time I don’t
by Ididntdothis 7y ago
“Instead of falling into that trap, he just used parentheses.”
That’s my conclusion too. Especially when I deal with several languages at the same time I don’t want to spend time on thinking about these details. Makes my code a little more verbose but I think it adds clarity.
- perl4ever 7y agoBut where do you stop? Some languages may have boolean types, where others evaluate non-boolean types as true/false. So do you say "if myflag" or "if myflag=true" to make sure it's valid? And some languages don't have short circuit operators, which I find annoying, but have learned to work around. Should I then write C or whatever that way, when I do have short circuit and/or?
- kazinator 7y ago> But where do you stop? The moment you catch yourself adding parentheses to other people's code to be able to understand it, and then having to "git checkout --patch" to flip it back the way it was.
- Ididntdothis 7y agoI try to be reasonable. There is probably no hard rule (a lot of people seem to want that) but you have to see where things are causing problems and then addressing them.
- TomMarius 7y agoIf (myFlag===true) ...