Click to See Complete Forum and Search --> : Planning the route to being a c++ expert


DanielJPayne
October 3rd, 2004, 09:22 AM
I didn't really know where to post these questions but seeing as I have Visual C++ 6 I thought I should post it here.
Hi, I've been buggering about with programming for about a year now, starting with using some of the BASIC languages to program little games but I have since got intrested in learning c++. I like the way visual c++ works so at the moment I'm learning using this, but I don't know where to start or if there is a better tool.

1. Should I learn c++ or .net which one is better for a beginner and could I learn one then easily pick up another.

2. In the far, far distant future I would love to program my own software as a professional, especially windows shells and games so is c++ or .net the right way to go assuming I learn one of them in depth (in the distant future).

3. Which books and references should I learn from if I want to learn c++. I heard a lot about MFC and win32 but don't understand the difference and the reasons why you should use one for one project then for a different one the other one is more suitable. Which is more flexible. I basically want to know this because many books Ive looked at look at either one or the other and don't explain both of them.

Thankyou very much for reading this hope someone can point me in the right direction.

Daniel

TheCPUWizard
October 3rd, 2004, 09:42 AM
Daniel,

Depending on where you ask this question you are sure to get lots of different answers. :D

More often people ask C++ or VB or C#...but that is another question (and there are many threads here on CodeGuru in different forums).

C++.NET IS C++ with a number of addition (extensions) that enable a programmer to interact with the "Managed" environment that is part of the Common Language Runtime (CLR) which is the basis of Microsoft's .NET platform.

As a result it is IMPOSSIBLE to learn C++.NET without learning C++!

C++ is a general portable language, and as such does not "know" how to interact with a specific operating system such as windows. As a result, you need to use an external set of routines (typically a libary) to do such things as create a window, display text boxes, interact with the mouse.

There are many ways to do this. On a Windows system, the lowest level is to make direct calls into routines withing the Operating System [Win32API]. Since this is a very low level interface, the programmer (YOU), has to do alot of work!.

To provide and Object Oriented way of performing THE SAMES FUNCTIONS, Microsoft developed the Microsoft Framework Classes [MFC]. While there is often heated discussion on how good these classes are, they are a defacto standard for interacting with a Windows system from an OO point of view [of course they do not exist on other platforms such as linux]

Hope this helps!

DanielJPayne
October 3rd, 2004, 09:53 AM
So, C++ needs to be learnt before c++ .net and programming in win32 is harder because you have to program every little detail whereas MFC already sets up all the things you don't need to worry about. But does this mean MFC is less flexible?
Thankyou for clearing up what these things are
Daniel

TheCPUWizard
October 3rd, 2004, 10:09 AM
That basically sums it up (there are details, exceptions and opinions that can be discussed for days).

On the issue of flexability...

If you wanted to build a house, you could do one of the following:

1) Go to a lumber yard and order all of the material you need.....

or

2) Buy a few acres of forrest, an axe, a small mine (for iron ore), and a few other items and make everything from scratch


While the latter might be more interesting and flexable, the former is certainaly more practical.

DanielJPayne
October 3rd, 2004, 10:17 AM
Ok, but can I still make MFC do anything I want. So what about learning visual c++, I've read parts of sams teach yourself visual c++ in 21 days but lacks some of the things I want to know ( it doesn't tell you how c++ works, how it reads the source code =, what classes and such are. So is there a better book which I can learn c++ as well as learning how to use the visual c++ program.
Thankyou
Daniel

TheCPUWizard
October 3rd, 2004, 10:40 AM
re: teach yourself visual c++ in 21 days [Sams]

1) it doesn't tell you how c++ works That is an advanced topic on complier design! it has nothing to do with usage.

2) how it reads the source code See #1

3) what classes and such are This is covered in depth, and is the basis of most of the book!

4) learning how to use the visual c++ program LEarning C++ has little to do with which compiler is actually being used. If you wanted to learn how to write a novel, it really would not matter which wordprocessor (or typewriter, or piece of paper) you wrote it on...

5) So is there a better book which I can learn c++. Actually I will admit bias here. I was the Technical Editor on the forthcoming fifth edition of this book! [The author himself is active on this forum too!!!!]

Andreas Masur
October 3rd, 2004, 11:25 AM
[ Moved thread ]

gstercken
October 3rd, 2004, 11:26 AM
So, C++ needs to be learnt before c++ .net and programming in win32 is harder because you have to program every little detail whereas MFC already sets up all the things you don't need to worry about. But does this mean MFC is less flexible?Just to quickly comment on this point only: No, not at all. You can deliberately mix MFC code and direct calls to the Win32 API. Actually, most real-world MFC apps are built that way. MFC-code, with direct Win32 calls in the areas not covered by MFC.

TheCPUWizard
October 3rd, 2004, 11:30 AM
...and you can even mix Managed C++ extensions with MFC, ot Managed Extensions with WINAPI calls....

Of course the more environments you mix together, the more responsibility you take on for coordinating the effects....