From: Sven P. <Sve...@ae...> - 2005-01-10 19:47:04
|
Looking into my mailbox after my holiday, it's surprising to see how many characters of mail were provoked by two tiny parentheses characters... :-) But I don't really understand the trouble here: I've changed configure to switch on "-Wall -pedantic -Werror" (for the non-GCC folks: "die immediately if you find anything slightly obscure") by default for GCCs, and this is an open source project where the use of GCC is very widespread. So anything strange will immediately be found by somebody on a GCC platform, even if M$ VS was happy with it. (Just for the record: The *only* place where I use assignments in conditionals is in C++, where you can actually declare the variable at the same time within the conditional. This helps to make the scope of the variable very clear and small, but the pros and cons of doing so are of course very subjective. Furthermore, I *hate* the saving of { }, even when there is only a single statement in the block. Using it all the time is easy without thinking and most modern IDEs insert them automatically, anyway. Relying on indentation here to make the intention clearer is a bad idea. I've seen tons of bugs in commercial software just because of these minor things...) Cheers, S. |