I'm absolutely shocked that someone can defend this code example. OK, you say it's readable for an experienced C programmer which I'm not. But is that really the best practice you want to teach other programmers? Fourfold inline computation? Cryptic variable names like nvtab.nval? No curly braces around a block where they are optional but prone to error if missing? Comments that use deep local jargon (what is nameval, what is nvtab)?
Defend it all you will (and also downvote just because you disagree, why thank you), I stand by what I said: The Practice of Programming is a harmful book and cannot be compared to Code Complete which is much more thoughtful and has unspeakably more attention to detail in naming, syntax, logic, programmer's psychology, project scope, everything.
isn't any different from memmove(blah blah, blah blah, blah blah) if you program in C. Introducing unnecessary noise doesn't contribute to code clarity.
> Cryptic variable names like nvtab.nval?
Suggest a better name. name_value_table.number_values? And give me one good reason how is this better?
There is a whole camp up in arms against abbreviating `count` as `cnt`. Though they never told me what issue they have understanding that `cnt` means `count`.
The only issues I have with abbreviations is they might introduce typos if you choose confusing ones. nval, nvtab etc aren't confusing, not by a mile. If you are confused by them, expanding them isn't going to help you either.
> Comments that use deep local jargon (what is nameval, what is nvtab)?
A localized code snippet uses local jargon. If you disagree, I would love to see your suggestions on improving them.
> Defend it all you will (and also downvote just because you disagree, why thank you), I stand by what I said:
Apart from standing by, show us how do you make it more readable. Your complains so far are fluffs.
> The Practice of Programming is a harmful book and cannot be compared to Code Complete which is much more thoughtful and has unspeakably more attention to detail in naming, syntax, logic, programmer's psychology, project scope, everything.
Sounds like Code Complete is programming for people who can't program.
Defend it all you will (and also downvote just because you disagree, why thank you), I stand by what I said: The Practice of Programming is a harmful book and cannot be compared to Code Complete which is much more thoughtful and has unspeakably more attention to detail in naming, syntax, logic, programmer's psychology, project scope, everything.