Page 1 of 1

New programming language...

Posted: Fri May 05, 2006 4:33 pm
by Patz QuickBASIC Creations
OK peeps, listen up. I am going to start learning C++ (got a couple books from the public library). Anything I should know before starting? (I know about having to declare ALL your variables, extreme case-sensitivity, etc.)

Don't worry. I won't leave the QB scene. It has too great of a QB-mmunity. :wink:

Posted: Fri May 05, 2006 5:01 pm
by Z!re
C++ sucks,

There.. enjoy learning it...

Posted: Fri May 05, 2006 5:07 pm
by The Awakened
Check out my 2 C++ articles in QB Express. They're sloppy (IMO) but I heard some good things about them.

Posted: Sat May 06, 2006 3:37 pm
by Deleter
um;
there; is; something; that; I; was; going; to say; but; I; forgot; what;

[ERROR: say not right]

;)


(hint: remember those damn semicolons!);

Posted: Sat May 06, 2006 4:20 pm
by {Nathan}
Hmm... I have a C book at my house. It's C Programming Tips & Tricks: The Things they are Hiding from You.

Posted: Sun May 07, 2006 12:28 pm
by BDZ
Whatever you do, don't waste your money on the book "SAMS Teach Yourself C++ in 24 Hours" by Jesse Liberty (c) 2002. In 24 hours they show you all the weird things that C++ can do (and FreeBasic can probably do) without EVER showing you any useful way to apply it. I gave up on C++ after I realized that QuickBasic (or FreeBasic) does everything that I want.

Posted: Tue May 09, 2006 9:33 am
by AlienQB
If you're into used to a static environment, like QB, an approach to an object-oriented language (C++, Java...) can be quite confusing. Learning a new syntax isn't hard, but adjusting how your brain normally thinks is. :)

Posted: Tue May 09, 2006 4:38 pm
by Deleter
BDZ wrote:Whatever you do, don't waste your money on the book "SAMS Teach Yourself C++ in 24 Hours" by Jesse Liberty (c) 2002. In 24 hours they show you all the weird things that C++ can do (and FreeBasic can probably do) without EVER showing you any useful way to apply it. I gave up on C++ after I realized that QuickBasic (or FreeBasic) does everything that I want.
haha, got that book for like $15 after a bunch of sales and markdowns...now i know why >)

Posted: Wed May 10, 2006 12:31 pm
by Zim
ok, I can top that! I gave up on learning C twice!

Oh, and, whatever you do, don't get a book called "C For BASIC Programmers" or something like that. If you're going to learn to code in C you'll end up writing code that looks like BASIC.

I did a little programming in Lisp. Sure enough, they look like BASIC programs!

Posted: Fri May 12, 2006 4:14 pm
by Guest
I don't know why, but C++ was very confusing to me compared to C. C was a piece of cake. Windows Programming was difficult but easier than C++. PHP was easier than C++. Hell, any language is easier to learn than C++ except Java...

My advice: Learn C. It'll save yourself a lot of "um...what?". Then learn Objective C for OOP.

Posted: Sat May 13, 2006 5:55 pm
by PlayerOne
I think Java is probably easier than C++ too. C++ has the problem that it is (more-or-less) an extension of C, and so all the good symbols were already used, and you end up with things like :: all over the place. And using -> all the time is extremely tiresome and typo-prone. It also muddies the cleanliness of C - in C, everything is ultimately an integer, C++ adds proper booleans.

I tend to feel that no-one who can program with any competence should have too much trouble switching between mainstream languages. Most FreeBasic programs can be translated line for line into C, and vice versa, especially if you're using external libraries like SDL. The big issues tend to be:

- Getting started: how do you set up projects, compile things, link to libraries, etc.
- Stepping up from console programs: graphics, IO, Windows.

Knowing C++ doesn't get you anywhere at all in writing a Windows app, you need to know how to compile a Windows exe and use the MFC and you need to understand the API and tedious stuff like that.

Posted: Sat May 13, 2006 9:17 pm
by RyanKelly
I think the difficulty many people encounter when they are introduced to C++ is that there are different flavors to C++ programming. C++, like C, has an interesting division between syntax and standard routines.

Programmers who begin with Basic think less about syntax and more about the use of specific sets of commands. To the basic programmer, the only difference between PRINT and IF or CHR$ and FOR is the way in which they are used. They are all merely keywords used in different ways to accomplish different tasks. This mindset can prove to be a limitation in the long run.

With C, ones encounters an inherent split between keywords for data declaration and flow control versus standard library functions like getc(), printf(), putch(). To use standard functions in C, a programmer not only must learn how to use them but also which header file to include. One finds oneself checking reference material much more often. It takes a while for a beginner to start to "feel" this difference between the different aspects of their code.

C++ pushes this futher by introducing both an extended syntax AND a host of standard objects.

For example,

#inlcude <iostream.h>
void main()
{
cout << "Hello, World!";
return;
};


Although the cout object does embody much of the essence of the "strick C++ way", this bussiness of stream objects can be easily dispensed with if they are not needed. Never the less most general introductions to C++ toss this upon the beginner and leave them with the impression that C++ is wildly different from the sort of programming they have known. In this one example the beginner is shown a mysterious instantiation of a class with an over ridden operator without an introduction to the fundamentals.

I learned C++ from a specific demonstration of a serial port library built from the ground up through data structures, member functions, virtual base classes, etc. In this way each aspect of this "object oriented programming" made sense.