TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: AARE TALI
from: DANIEL JONES
date: 1997-08-02 10:03:00
subject: Sunir ventures into C++

AT>  > References are quite powerful.  I suspect that once
AT>  > you get used to them
AT>  > and really start using classes, you'll come to
AT>  > appreciate them as well.
AT>    It is more like syntax sugar to me. Instead of writing  *va
Really?  Please sketch me a class definition for an I/O stream which
doesn't use references and allows this:
cout << "I have " << Number << " apples.";
AT>  > As for declarations, why shouldn't I be able to
AT>  > declare a variable where
AT>  > I use it?  I especially like for(int i = 0; i < 100;
AT>  > i++) type
AT>  > declarations.  It makes it quite clear that i is
AT>  > simply a placeholder.
AT>    I don't like the idea too much. When you find some variable in th
AT> the program, you can't find declaration in few logical steps (the co
I'm not sure I follow you here.  When you find a variable, the
declaration should be right there.  No steps are necessary.  No paging
back to the top of the page or function. 
AT> statement where this line was in, then the compound statement where
AT> compound statement was in, and so on, you have to scan backwards to
AT> beginning of the function, 
You must scan backwards to the beginning of the function (or at least
the beginning of the block) in C because all variables must be declared
there. In C++, you shouldn't have to scan back at all.
AT>                            and the for (int i...) is not so obvious 
AT> to be noticed at the first pass.
I suppose that's a matter of what you're used to.  I find it quite
obvious.
Regards,
Daniel              ddjones@pinn.net
---
 þ RM 1.31 1604 þ "Whom are you?" said he, for he had been to night school.
---------------
* Origin: Selective Source Virginia Beach, VA (757)471-6776 (1:275/102)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.