It may seem obvious, but clear, concise code benefits everyone in the process. This sample chapter from Exceptional C++ Style explains in detail how clear code enhances productivity at every step of the way, not just for programmers and debuggers.
It may seem obvious, but clear, concise code benefits everyone in the process. This sample chapter from Exceptional C++ Style explains in detail how clear code enhances productivity at every step of the way, not just for programmers and debuggers.
this might help the debian project out so they can one day release sarge.
It may seem obvious, but clear, concise code benefits everyone in the process.
I think that about sums it up…
On the one hand, this article does well: I like his ideas about simplicity and clear variable naming, etc.
On the other hand, it fails: too many iterators, stl classes, containers and concepts.
I have just spent the last 6 months cleaning up a disaster of a codebase which used this guy’s conventions. Now, it’s easy to maintain and about 4 times faster.
By all means, keep coding this way. Then, I’ll always have jobs cleaning up your messes.
<blockquote>I have just spent the last 6 months cleaning up a disaster of a codebase which used this guy’s conventions. Now, it’s easy to maintain and about 4 times faster.</blockquote>This guy’s conventions? Do you know who Herb Sutter is?
Hint: It’s possible to write unclear and inefficient code in any convention.
This whole thing seems like a big mess to me, and I consider myself a fairly experienced C++ coder.
I quickly skimmed over the examples, and I admit that I did not study the code in detail. But I believe that one should at least have a basic idea of what this piece of code tries to perform. And honestly, I don’t know
-Richard
Well, it doesn’t help that the indentation seems to have been lost during the transfer to HTML…
If you read the ‘guru question’, you’ll realise that the code is there as an example of flawed code. You’d also read exactly what the code does: ‘The following code presents an interesting and genuinely useful idiom for creating index tables into existing containers.’ That’s pretty clear to me.
> useful idiom for creating index tables into existing
> containers.
Explain this to someone who has now idea of computer programming. I’d be surprised, if you succeed.
That doesn’t mean I think that general programming concepts have to be understandable by mere mortals, but it certainly helps.
I’m asking again: What useful and obvious thing does this code?
The article is not aimed at someone who has no idea of computer programming – it’s aimed at programmers who already know enough about data structures to understand it. An index works a lot like the index of a book, it’s a means to quickly locate a element in a data structure. Which is very useful.
I don’t know about obvious, but I’m not sure why you expect it be anyway. By the way, when did you ask the first time?
> By the way, when did you ask the first time?
I complained earlier that it’s not obvious.
So propably it is indeed useful. I just wanted to point out that I cannot agree that this code is clear and concise, although this is what the author claimed it is.