TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Geo
from: John Beckett
date: 2004-10-23 09:33:02
subject: Re: Organizing source code

From: John Beckett 

"Geo"  wrote in message
news::
> Yeah I can see that too, but there is other stuff that bothers me about the
> language. For example there are times when you have to say something is =2.0
> instead of =2 but when it cout's a double number with no output
> specification the default is to just output 2 not 2.0. It's kinda like the
> machine doesn't have to play by the same rules the programmer has to play
> by..

I confess that I gave up on cout some time ago. I tried a couple of times
to break my old "printf" habits, but in practice the only
programs I write that need cout or printf are Q&D tests, so I decided
not to master all the weird rules of cout formatting.

Lest I pollute your mind, I should point out that cout is a fantastic
concept since you can write your own classes and provide them with methods
to read input or write output using the standard input or output streams.
Very elegant.

At any rate, C/C++ makes you think about exactly what you type. There is a
big difference between 2 and 2.0. Also, beware of leading zeros. For
example, 012 is octal 12 (decimal 10).

While I'm at it, here are some others:
    = is assignment while == is equality
    & is bitwise and while && is logical and
    "2" is a string while '2' is a character
    4/5 is 0 while 4./5. is 0.8

John

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 396/45 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

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™.