I don't quite understand your point, wololo. I don't understand your supposed examples either because they make no sense. I can also make your code make look like nonsense, look:
Code: Select all
for (i = 0; i < sizeof(memids)/sizeof(u32)++; i)
Unfortunate typo. Makes sense? No it doesn't. I still don't get your point. Do you want to make me look bad or ridiculize me? Because that's what it seems. We're here to discuss the best way to do it, not put nonsense to make own code look better.
Wololo wrote:When code is shorter, we have less bugs.
When code is harder to read, we have more bugs and don't find them. I can code that for loop shorter:
Code: Select all
for (i = 0; i < sizeof(memids)/4; ++i)
Is this better? Of course it's not.
Wololo wrote:It doesn't make the code any more readable
If you mean that
Code: Select all
int num_memids = sizeof(memids)/sizeof(u32);
for (i = 0; i < num_memids; ++i)
is not more readable than
Code: Select all
for(i = 0; i < sizeof(memids)/sizeof(u32); i++)
then I have nothing more to talk about. Really, you're approaching nonsense here.
Wololo wrote:I'm the first one to admit when my code is incorrect, but this time, it's the best possible solution, so I don't like being insulted for doing the right thing
I don't want to argue over the "I'm the first one to admit when my code is incorrect" thing, but from that to say you've been insulted, I think you're going toooo far fetched. That code is ugly and less readable, like it or not it's a fact. Also I said I'm not going to discuss about this because it's a very very minor issue, just a side comment, but you jumped on it like it's the most important thing we're discussing here.
I'm done with this useless discussion, code it as you want.
Advertising