Go to content Go to navigation Go to search


Browse

RSS / Atom

All Articles

Code!

Coding, bro · 2009-04-16 17:02

I'm having fun at work for the first time in ages. Today I got to use stream iterators!. God I love C++. When one can see what one's written and it looks beautiful and elegant, when it just flows without trying - that's big time job satisfaction!

There are always concessions to be made, however. Especially when working in a team.

Example: yesterday a guy at work replaced a do..while loop I had written with an infinite for loop and a break.



do {
   statements;
} while (condition);


Replaced with


for (;;) {
   statements;
   if (!condition) 
       break;
}


No reason given, he just hates do while loops! I've managed not to use any so far, it certainly makes for a more interesting challenge! And I reckon his way is ugly - using break statements to get out of any loop is akin to using goto IMHO. So the challenge becomes to think outside the loop.

Oh all right then, I'm also a proponent of single point of return

Did I ever get you a book called Godel Escher Bach? I seem to remember ages ago for a birthday or something, but am not sure and don’t want to buy you the same present twice out of forgetfulness!

Glad your new work is interesting…


dave    2009-04-16 22:20    #

No, sounds pretty interesting though!


Matt    2009-04-17 14:51    #

Could have swore I did! Next big present event then you can count on it! :)


dave    2009-04-18 20:31    #

Commenting is closed for this article.

Back to work Apple Keyboard