3 ms·
He follows this up with: > Don’t code “your way”. Just follow the coding standards. This stuff is already figured out. Make your code predictable and easy to r
by haswell 10y ago
He follows this up with:
> Don’t code “your way”. Just follow the coding standards. This stuff is already figured out. Make your code predictable and easy to read by coding the way people expect.
I'm not a C dev, but is "(null != thing)" still a convention? (Based on your comment it sounds like yes). If yes, it seems to me like he's saying: keep doing that!
Nowhere does he claim that his advice about this convention applies to every language (this would be silly) and not writing C should not preclude someone from giving programming advice.
The "generally applicable" advice that he does give is exactly that: general. Is it possible to write a blog post about code quality/complexity/insert-thing-here that applies to all circumstances? I don't believe it is. It doesn't mean that there is no value to be gained from exploring concepts that may apply.
- MaulingMonkey 10y ago> I'm not a C dev, but is "(null != thing)" still a convention? Configuring the warning your compiler gives for 'if (x=y)' to generate an error instead is a vastly better convention that completely supersedes Yoda style, IMO. 'if ((x=y))' remains available for those who really want to assign in conditionals.
- Ace17 10y ago> I'm not a C dev, but is "(null != thing)" still a convention? (Based on your comment it sounds like yes) I'd rather call it a trend than a convention.