multiple declaration statements

  • Thread starter Thread starter Tim923
  • Start date Start date
T

Tim923

I developed a habit of using multiple declaration statements without
being aware of it, maybe from Pascal. Is that style no longer taught
or used?

decimal decTotalCost = 0M, decTotalDiscount = 0M,
decTotalExtendedPrice = 0M;

or

decimal decTotalCost = 0M;
decimal decTotalDiscount = 0M;
decimal decTotalExtendedPrice = 0M;

-
http://mysite.verizon.net/vze8adrh/news.html (profile) --Tim923 My email is valid.
 
Tim923 said:
I developed a habit of using multiple declaration statements without
being aware of it, maybe from Pascal. Is that style no longer taught
or used?

decimal decTotalCost = 0M, decTotalDiscount = 0M,
decTotalExtendedPrice = 0M;

or

decimal decTotalCost = 0M;
decimal decTotalDiscount = 0M;
decimal decTotalExtendedPrice = 0M;

The latter is clearer, IMO, and certainly allows for simpler
documentation. (I wouldn't use the Hungarian notation though.)
 
Back
Top