View Full Version: Is C++ the right language to learn?

C++ Learning Community > C++ in General > Is C++ the right language to learn?


Title: Is C++ the right language to learn?


Bishop - August 24, 2003 03:31 AM (GMT)
I haven't coded a line since pascal about 12 years ago and I'm looking to pick up a language that I can use to make little utilities for a windows system (eventually incorporating web activities, although that won't be for some time). I know C++ is versatile and powerful, but is it the best tool for the job considering the fact that I want to keep compiled aps VERY small?

Dragon - August 24, 2003 05:59 AM (GMT)
C++ is very good for creating Windows applications. You can check some of them out in the C++ Creations forum. As for compiled size, that will depend on your compiler. Some compilers creates executables smaller than others.

Bishop - August 24, 2003 08:21 AM (GMT)
Thanks for the response.
So what is the best compiler for keeping it small? I've got institutional access to Codewarrior, so say that one. :)

ih8censorship - August 24, 2003 01:54 PM (GMT)
well, i have noticed that visual c++ 5.0 makes programs that are quite a bit smaller than dev c++ (which uses the mingw compiler).i never tryed codewarrior. if you want to keep your programs as small as humanly possible youll have to learn assembly language, and then find the best assembler-- i tryed that before but all it did was make myhead hurt. what size of program are you thinking of? but if you were into pascal, you should pick up c++ pretty good. anyway to sum it all up if you want to learn a language for a large amount of time but have the smallest exe, learn assembly. if you want to spend a smaller time learning and have an exe thats a little bigger learn c++.


isnt if funny how in computing you often have to comprimise one thing for another?

dr voodoo - August 24, 2003 05:31 PM (GMT)
Correct me if I'm wrong but isn't "Codewarrior" Mac? :blink:

Anyway if you want small file sizes and a free compiler the Borland commandline compiler isn't bad (if you know how to use *.bat files that is...)

But for learning DevC++ isn't bad. Execution speed and size aren't very good but it's simple to use and if you are honest when learning speed and size of exes don't matter.

A good C/C++ compiler produces about the smallest file sizes a compiler can. But if you really need very small files, low level ASM is the only choice. A base app is around 5 kb. (50 kb for the borland compiler)

But you should learn (the basics of) C/C++ before ASM simply because Win32 is documented for C/C++ (and very rarly for ASM) and once you understand it porting your knowlege to ASM isn't very hard.

QUOTE
for a large amount of time

Depends on how much knowlege you have from other languages. (PS:I program in it since around a week and can do most of which I can do in C++, as I already said knowlege can easily be ported, especialy Win32)

Shadow of the Moon - August 24, 2003 06:27 PM (GMT)
Codewarrior is about the only choice for Mac, and I've heard good things about the Windows version, too. I would use it if it was available. As Dr. Voodoo suggested, Borland is good as well. Mingw produces larger compiled apps, but they aren't really that big. There are ways to get them smaller anyway.

dr voodoo - August 24, 2003 07:59 PM (GMT)
I thought it was Mac only. ;)

TheHawgMaster - August 24, 2003 10:42 PM (GMT)
QUOTE
A base app is around 5 kb. (50 kb for the borland compiler)
I use VC++ 4 for C++ and my min size is 15KB; and I use MASM32 8 for assembler, and that has a min size of 1.5KB. You can get MASM32 for free and I got VC++ 4 for 20 USD off of ebay.

dr voodoo - August 25, 2003 08:02 AM (GMT)
QUOTE
I use MASM32 8 for assembler

Roxasm PE are noramly smaller because you don't need to link any libs or include any headers.
QUOTE
I use VC++ 4 for C++ and my min size is 15KB

Do you mean the absolute min size or the size of a base app?

Bishop - August 25, 2003 12:26 PM (GMT)
all good...
the reason for wanting the ultimate product small is so i can incorporate it into a smartcard with a 128K cap (some of that going to biometric data and private keys)
assembly is definitely in the plan for the future, but i'd like to keep the code as efficient as possible even before that

mikawo - August 26, 2003 11:14 AM (GMT)
I'm no expert, but in my experience, C produces smaller files than C++.

Haxor - September 9, 2003 11:41 PM (GMT)
Codewarrior is very nice ... probably the only compiler I'd say is as good or better as VC++ in terms of the IDE.

And, the filesize of C++ programs will indeed vary on compilers .. but not that much. The big comparison is against other languages. I know Delphi produces large files, with a minimum at like 100k for just a DLL. C++ is probably the choice to produce the smallest possible executable.

The difference in size between compilers isn't much, so I wouldn't worry about it. The thing that'll shoot up the filesize is the use of MFC in VC++, though.

TheHawgMaster - September 10, 2003 01:50 AM (GMT)
QUOTE
Roxasm PE are noramly smaller because you don't need to link any libs or include any headers.
Actually, includes don't make any diffence as long as you dont use any macros in them or call any of the functions in the lib associated with them. And libs don't make any difference as long as you do not use the functions in them.
QUOTE
Do you mean the absolute min size or the size of a base app?
No, I actually mean for a statically linked program with inlines expanded, structure padding, and all that fun stuff. It's not too bad.

Sorry about neglecting this topic, but I thought it was long dead ;) .




* Hosted for free by InvisionFree