Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
acprog42
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
acprog42
7y ago
But killing an ant with a nuclear bomb is moar funnier! Don't stop the fun!
2.
▲
by
acprog42
8y ago
Which brings us back full circle to the point I was originally trying to convey: if a coding standard forces you to write more convoluted and harder-to-read code just to work around some of its rules, that is a clear failure of said sta
3.
▲
by
acprog42
8y ago
Yeah, seems like it actually allows my second example which is good! :)
4.
▲
by
acprog42
8y ago
Sure, that would pass the `grep -r goto ` test, but is just a more convoluted way of doing the same thing.
5.
▲
by
acprog42
8y ago
> Most Misra software is embedded without dynamic allocation though True, but I've seen enough MISRA code bases plagued with the "Christmas tree" layout even if dynamic memory allocation isn't allowed. This was just a
6.
▲
by
acprog42
8y ago
True, it would be kind of analogue to try/except/finally if you do that.
7.
▲
by
acprog42
8y ago
Too little karma to edit and fix indentation. Anyway given the above functions, think about adding support for only returning the buffer if the file contains a specific word. While certainly doable in both cases I would at least feel more
8.
▲
by
acprog42
8y ago
> You can have 100% MISRA conformant spaghetti. IMHO some of MISRA rules lead directly to hard to read/maintain code. Consider a function that: 1. opens a file 2. allocates enough memory to store the whole file 3. reads the file 4.