Re: A89: ASM Mentoring
Re: A89: ASM Mentoring
There is no reason that
cout << "Some text.";
should produce any more code than
though I've never tested it. If anything, I believe printf() should produce
more, assuming the C++ compiler/linker is reasonably well implemented. Why?
Consider all the different things printf has to know how to deal with:
strings, chars, int, short, long, float, double, long double, pointers, not
to mention all the formatting options. Of course this assumes that printf()
handles all these things by itself, without making any function calls, which
would be a stupid way to implement it.
The C++ statement makes only one function call, to the
ostream::operator<<(char *) function, and that function only needs to be
able to deal with strings. There is no reason that any other ostream
functions (other than a constructor, which doesn't need to do much) would
need to be linked. Of course this all depends on the implementation.
The fact of the matter is that most of the claims about C++ being too big
and too slow are completely unfounded. Yes, it has certain features that can
slow it down and make the code larger, but it's not necessary to use them.
From: Michael Cowart <firstname.lastname@example.org>
To: email@example.com <firstname.lastname@example.org>
Date: Friday, September 15, 2000 10:07 AM
Subject: Re: A89: ASM Mentoring
>The much larger code thing - Most C++ people want to use
>cout << "Your text here"
>printf("Your text here")
>(Zeljko's oft repeated (and true) example of why C++ on the calc would not
>That results in much larger code. Most of the C++ extensions are that way.
>agree, you could code the exact same way in C++ as you would in C, but it
>would make the extraneous C++ useless.
>>From: "Olle Hedman" <email@example.com>
>>Subject: Re: A89: ASM Mentoring
>>Date: Fri, 15 Sep 2000 11:45:40 +0200
>>From: "Michael Cowart" <firstname.lastname@example.org>
>> > I am pretty good in C (C++ is not supported, the main reason being it
>> > produces MUCH larger code). My ASM skills are severely lacking, but if
>> > motivation (like a group getting together to do Zelda =), I would go
>> > extra mile. Any one want to start a group? We'd need someone to do a
>> > (my skills lack sadly in that field). I have the time (college is
>> > really work on something.
>>No. C++ doesn't really produce larger code. What is large is the standard
>>objects you often use when you program C++ for a PC. Bu you wouldn't do
>>on a ti89.
>>The main reason as I can see, is that there isn't really much point in
>>useing C++ on such a small/simple platform. You wouldn't code much
>>then you would in C anyway.
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
>Share information about yourself, create your own public profile at