Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/02/07 18:58
Read: times


 
Msg Score: +2
 +2 Good Answer/Helpful
#141421 - operator precedence
Responding to: ???'s previous message
Chris Kelly said:
Andy Peters said:
use parentheses liberally

I choose this one section from your post to illustrate a counter-example.

If you always "use parentheses liberally" then what happens is that, over time, you begin to forget the rules of operator precedence.


Chris, I completely agree with your assertion that you forget the rules of operator precedence.

IMHO, that's not a bad thing. Why?

Because I do C, VHDL and Verilog and I can't keep track of who's on first and what's on second when I switch between them.

Verilog especially will bite you in the ass. While some claim that it's "C-like," it's different enough to cause heartburn and worse.

So in the interest of preserving my own sanity, I prefer to avoid statements such as
if(a & 0x01 && b & 0x80) { ... }
.

-a

List of 36 messages in thread
TopicAuthorDate
Mini quiz for Friday            01/01/70 00:00      
   a classic            01/01/70 00:00      
   Non kosher C            01/01/70 00:00      
      Please Explain            01/01/70 00:00      
         The reason            01/01/70 00:00      
            The real reason???            01/01/70 00:00      
               welcome to the club            01/01/70 00:00      
            Worse than "implementation dependent"            01/01/70 00:00      
               Can you clarify this point?            01/01/70 00:00      
                  splint gives a (very) detailed warning:            01/01/70 00:00      
                     Interesting ...            01/01/70 00:00      
                        Sequence point            01/01/70 00:00      
   Lesson complete            01/01/70 00:00      
      The weird part            01/01/70 00:00      
      There's a fine line            01/01/70 00:00      
         Problem            01/01/70 00:00      
            operator precedence            01/01/70 00:00      
               I second the motion            01/01/70 00:00      
                  As I said            01/01/70 00:00      
                     re: As I said            01/01/70 00:00      
                        Productivity?            01/01/70 00:00      
                           wrong comment            01/01/70 00:00      
                           re: Productivity            01/01/70 00:00      
                        that's IT            01/01/70 00:00      
                           Then again ...            01/01/70 00:00      
                              OK, is this better ?            01/01/70 00:00      
                                 12 year olds are smarter            01/01/70 00:00      
                                    Sorry but            01/01/70 00:00      
                                       Order of operations            01/01/70 00:00      
                                       I know            01/01/70 00:00      
                                    How about ...            01/01/70 00:00      
                                       Wrong?            01/01/70 00:00      
                                          point proven            01/01/70 00:00      
         Real Work vs. Fooling Around            01/01/70 00:00      
            I got caught out recently            01/01/70 00:00      
               re: I got caught out recently            01/01/70 00:00      

Back to Subject List