Qbasicnews.com

Full Version: quick question 4 C programmers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4 5 6
what is the best version of C to start learning?
i would like to branch out past QB
What do you mean by "version"? Do you mean "what compiler"? C doesn't really have versions...

BTW if you're on Windows, I suggest using MinGW as your compiler and Code::Blocks as your IDE, or VC++ 2005.

And I wouldn't learn C first. Learn C++ first, that way you'll be able to understand OOP better than if you learn C first. Plus, C++ has the Standard Library that will make your life a lot easier when you are learning.

Good luck!
ok thats what i realy ment!
weither i should use C,C++ or Visual C,ect.
thanks
C++ doesn't teach good OOP, mainy 'cause its implementation of OOP is dirty, bloated and ugly. I'd rather learn OOP with a proper (pure) OOP language such as Java. Then, when concepts are clear, I'd go to C++.
Quote:dirty, bloated and ugly

The smallest c++ program i seem to be able to compile with gcc is 260Kb. god knows how bloated a real program will be. That's really put me off c++
stripping symbols from your executable, use vc etc. etc. depending on what you use ( std::cin, std::cout etc. ) you'll get a lot of uneccessary stuff linked in if you don't care for stripping stuff. but of course deciding against a language due to it's exe size is of course more reasonable then deciding against it due to features and mechansims...
test.cpp:
[syntax="C"]
#include <cstdio>

int main(int argc, char** argv)
{
printf("Hello, world.\n");
return 0;
}
[/syntax]

Code:
chris@apex:~/Sandbox> g++ test.cpp -o test
chris@apex:~/Sandbox> ls -hal test
-rwxr-xr-x  1 chris users 7.0K 2006-02-06 12:54 test
chris@apex:~/Sandbox> strip test
chris@apex:~/Sandbox> ls -hal test
-rwxr-xr-x  1 chris users 3.3K 2006-02-06 12:54 test
chris@apex:~/Sandbox>


test2.cpp:
[syntax="C"]
#include <iostream>

int main(int argc, char** argv)
{
std::cout << "Hello, world." << std::endl;
return 0;
}
[/syntax]

Code:
chris@apex:~/Sandbox> g++ test2.cpp -o test2
chris@apex:~/Sandbox> ls -hal test2
-rwxr-xr-x  1 chris users 8.6K 2006-02-06 12:56 test2
chris@apex:~/Sandbox> strip test2
chris@apex:~/Sandbox> ls -hal test2
-rwxr-xr-x  1 chris users 4.3K 2006-02-06 12:56 test2
chris@apex:~/Sandbox>

So basically, just because your C++ compiler sucks (okay, MinGW/g++ is nice, but... for some reason, the output is huge with iostreams), doesn't mean you should hate C++. It's a wonderful language (just not as beautiful as Java).
Learn C before you learn C++. C++ has a wicked learning curve, C is much more relaxed and far better if you come from a BASIC background since both are procedural and you don't have to get your hands dirty with OOP when you code C. C also tends to be way more portable than C++, so the code you write in C is generally reusable without changes across many compilers and platforms. That way, you can try out several compilers and find the one thats best suited for you, then move on to C++ with it when you're ready for the challenge. Also, don't let people fool you...C++ isn't nearly as portable as people like to hype it up to be.
Quote: ... (just not as beautiful as Java).

you filthy filthy java whore! may i make you remember 1.4 with no generics?
I never wanted to say that C++ is a bad language (although I don't like it at all), just that it is not very didactic. To learn OOP, it's better to have a pure OO language such as Java. C++ allows a lot of non-OO dirty stuff which should be avoided when learning. Then, there comes the hacks.

It's like GOTO in BASIC Big Grin
Pages: 1 2 3 4 5 6