3 ms·
It'll certainly confuse people, but only those who aren't qualified to be doing anything with the code anyway. "complex" is subjective. It reminds me of stupid
by userbinator 10y ago
It'll certainly confuse people, but only those who aren't qualified to be doing anything with the code anyway.
"complex" is subjective. It reminds me of stupid "rules" like "don't use the ternary operator", "every function must be less than 20 lines" (I am not exaggerating --- this was on a Java project, however); and you could easily extend that to "every statement must have a maximum of one operator", "you must not use parentheses", "you must not use more than one level of indirection", etc. Where do you stop? To borrow a saying from UI, "if you write code that even an idiot can understand, only idiots will want to work on it." I don't think we should be forcing programmers to dumb-down code at all.
That said, I'm not advocating for overly complex solutions, and will definitely prefer a simpler solution, but you should know and use the language fully to your benefit.
- fnj 10y ago"if you write code that even an idiot can understand, only idiots will want to work on it." To me, that makes about as much sense as when Ricky Bobby in Talladega Nights says "If you ain't first, you're last."
- CamperBob2 10y agoIt'll certainly confuse people, but only those who aren't qualified to be doing anything with the code anyway. And people wonder why there are so many broken C programs out there...
- yitchelle 10y ago>> It'll certainly confuse people, but only those who aren't qualified to be doing anything with the code anyway. If the complexity can be avoided, why not avoid it. Removing complexity is not the same as dumb-downing code. It will improve readability and maintainability. This mindset is defintitely applicable to declaration as well as code construct. edit: clarity.
- userbinator 10y agoNote the last sentence of my comment. I am not advocating unwarranted complexity at all, but just saying that there are cases where an increase in local complexity can reduce overall complexity of the system, and you should not be afraid of using the language to the best of your ability.