4 ms·
Anybody that doesn't want to introduce crashing/fatal bugs that disrupt productivity? Skipping checks[1] and making assumptions about input[2] is an irresponsib
by pdkl95 8y ago
Anybody that doesn't want to introduce crashing/fatal bugs that disrupt productivity? Skipping checks[1] and making assumptions about input[2] is an irresponsible disregard for basic security.
This is about basic programmer competence, not time a consuming feature that might impact your development costs relative to your competitor. You are not going to make more profit by leaving out the "default:" case to your switch/case statements that skips parsing for unrecognized elements.
[1] https://archive.org/details/The_Science_of_Insecurity_ https://archive.org/details/The_Science_of_Insecurity_
[2] https://media.ccc.de/v/31c3_-_5930_-_en_-_saal_6_-_201412291400_-_funky_file_formats_-_ange_albertini https://media.ccc.de/v/31c3_-_5930_-_en_-_saal_6_-_201412291...
- TeMPOraL 8y ago"Basic programmer competence" is not something you can consistently expect from people in the industry. Be it a bad day, general carelessness, or business pressures - there are many reasons to cut corners.
- caf 8y agoThe problem isn't leaving out the 'default' case. The problem is coding it as default: return DROP_CONNNECTION_AND_BAIL;
- pdkl95 8y agoYes, which is why I really like the idea of proactive enforcement with random expected-to-be-ignored tags/parameters. I'm arguing against the idea that leaving out the last part of this for (item = params->head; item; item = item->next) { switch (item->type) { case KNOWN_PARAM_TYPE_FOO: // do normal stuff break; /* ... etc ... */ IGNORE_KNOWN_PARAM_TYPE_BAR: // fallthrough - BAR explicitly uses default handling default: continue; // skip unknown parameters } } is evidence of incompetence, not a strategy that will "make more profit than your competitor". Also, as the BAR constant suggests, you probably already have code that skips unrelated fields. While the difference in programmer time is almost always trivially small, sometimes it might be zero.
- mathw 8y agoUnfortunately incompetence can sometimes lead to increased profits in the short term. Why else is there so much horrendous software out there?
- namibj 8y agoYou can trust in basic programmer competence when there is a certification the programmer has to loose if he displays incompetence, like done for other engineers and also doctors and lawyers and many more. Until then, you have to make the financial incentives in the short and long term such that they lead to desirable behavior, e.g., producing non-barfing middleware in this case.