Page 1 of 1

University Transition from C++ to Visual C++

Posted: Thu Sep 28, 2006 6:22 pm
by waradmin
Alright, I am a first year Computer Science major at the University of Minnesota Duluth, and my first major class is my:

Computer Science 1511: C++

Our text book is straight classic C++ code, however the professor made the class a focus on Visual C++ vs traditional C++ basicly limiting the coding we are learning down to the windows environment.

Any other Computer Science major's now stuck learning Visual C++ and not traditional C++? Seems very strange to me that in a lecture hall of 250+ people, Visual C++ is what we are learning, vs. the cross-platform plain C++ language.

Re: University Transition from C++ to Visual C++

Posted: Thu Sep 28, 2006 6:38 pm
by alex.barylski
waradmin wrote:Alright, I am a first year Computer Science major at the University of Minnesota Duluth, and my first major class is my:

Computer Science 1511: C++

Our text book is straight classic C++ code, however the professor made the class a focus on Visual C++ vs traditional C++ basicly limiting the coding we are learning down to the windows environment.

Any other Computer Science major's now stuck learning Visual C++ and not traditional C++? Seems very strange to me that in a lecture hall of 250+ people, Visual C++ is what we are learning, vs. the cross-platform plain C++ language.
Different and perhaps strange, but a smart move.

Visual C++ is the most popular development language and platform/IDE available today. Yes C# is gaining ground but MC++ exists for a reason, because M$ realized they almost have to support it.

There are literally millions upon million of lines of code written in VC++. Infact something like 90% of Windows based applications are done in Visual C++ and would suggest that M$ themselves use it almost exclusively in all their code (particularly in legacy appllications).

Visual C++ has it down sides from an academic standpoint however.
================================================

1) It hides a lot of SDK detail from you, using high level C++ API's
2) Visual C++ supports non-standard keywords, etc. I'm trying to think of an example, but none come to me at the moment. I have heard however that VC++7 compiler is waaaay more standards compliant, if not 100% compliant. So it depends on your version.

MFC will complicate matters quite a bit when compared to console application code. Working in a event driven environment does change they way you solve problems, as messages need to be mapped to objects and done so preciously (sp?) and other confusing matters such as distinguishing a Windows class from a C++ class (MFC hides most of this from you)

There is little argument that M$ atleast cranks out some of the best IDE's available. So this could be advantageous as a student.

Otherwise, much of what you learn will apply to standard C++. I've easily made the transition from MFC to OWL (actually the reverse) and now into wxWindows and GTK+ for cross platform development.

Most C++ frameworks all base themselves after a MVC architecture and use event handlers similar to each other. Yes there are differences, but once you grasp the concept of the framework, that knowledge transcends nicely into others, I promise you.

It'll atleast make you capable of entering the work force after school, which is a good thing. So many times I've read in forums where a new graduate says he knows C++ but can't navigate his way about the MFC framework, basically making him useless in the real world, as most applications are written in C++ and MFC as the framework.

I suggest visiting http://www.codeproject.com as it's best resource available (IMHO) for anything M$ and especially Visual C++ :)

Cheers :)

Posted: Thu Sep 28, 2006 6:47 pm
by waradmin
Great reply, answered a lot of questions I had, and gave me useful information.

Currently we are only into week 4 of class. Thus far we have done 3 programming projects, however each one was made from my standpoint by a wizard, then we just filled in the blanks.

For example, we start a new Windows Form Project, then we are presented with a blank windows form. We then drag on text boxes, buttons, etc and create event handlers on the buttons etc (for example we made a calculator). However, the only real programming is creating the event handlers, and the automaticly generated code that creates the text boxes on the form is never really explained to us. I feel this may give people who are new to the programming scene the impression that much of programming is draging buttons, textboxes, and drop down menu's on a form then just only coding event handlers for them, which i believe isnt the case.

Posted: Thu Sep 28, 2006 7:01 pm
by alex.barylski
It's a challenge...learning the complexities behind what makes MFC tick and how it wraps the SDK took me years to understand (still I'm no master) and some concepts were completely foriegn and misunderstood until I made the transition into PHP development.

RTTI in a C++ desktop application environment made little sense, but in interpreted languages like PHP or Perl it's quite common.

One suggestion: Start studying the underlying SDK API and how a Windows application is developed using plain C. Learning about message pumps and intercepting of messages will give you better insight into the world of complex Windows application development. Learning the different Windows messages in their raw form will also assist you in understanding and debugging your MFC code or possibly extending it.

MFC as I already said, hides alot from you. It's awesome for quick and dirty applications where you just need to crack out a application in a hurry, but when you want to start doing cooler things like:

1) Modifying the caption bar (not text but drawing on it)
2) Creating custom controls
3) Capturing the screen
4) Developing shell extensions

Basically anything, you'll need a solid understanding of SDK and possibly COM internals (shell extensions, etc)

You will appreciate MFC when you write a similar application using bare bones SDK. :P

Have fun, it's a blast to work with and the feeling of control and power will make you giddy. That and you can trash talk VB developers for being newbies :P Just kidding :)

Posted: Fri Sep 29, 2006 1:31 am
by timvw
waradmin wrote: For example, we start a new Windows Form Project, then we are presented with a blank windows form. We then drag on text boxes, buttons, etc and create event handlers on the buttons etc (for example we made a calculator). However, the only real programming is creating the event handlers, and the automaticly generated code that creates the text boxes on the form is never really explained to us.
Why can't 'real programming' be done with UI interaction? Is writing those semi-english sentences in <insert language here> real programming? Or is it just an interface for dummies that don't know how to talk binary? ;)


These days, the VC++ 8.0 (and 7.0 probably too) compiler can generate standards compliant code too... So you might want to specify which version you're using...

Imho,programming these days is all about (re-)using existing libraries (ui, network, filesystem, database, ...) and from that POV only learning the features of a language alone aren't sufficient to become a real programmer...

Posted: Fri Sep 29, 2006 3:32 pm
by waradmin
We are using the newest Visual Studio on the local systems (i assume 8), and we students can get Visual Studio for a really low price, or just use Visual Studio Express (which is free, and what I use).

And yeah, its nice to use a wizard, but I think it takes away from the learning of what the automaticly generated code does. Ive never been a fan of wizards. Another reason I love this forum, being able to ask how to do something and getting people who answer you saying "use <insert code here> because <insert code here> does this, and will do what you need it to do."

But thus far, we havent had the auto-generated code explained to much of an extent.

And I must say, wow. Wow to the fact that my sem-good understanding of PHP has helped me understand C++ so much easier. And all of the help I have gotten here has also helped my understanding of C++ and my ability to create clean code.

Posted: Fri Sep 29, 2006 3:48 pm
by timvw
It all depends on how you want to start your teaching (Which details are essential, and which ones can wait?)

Do you really want to know that the wizard generates classes X and Y and then calls a static method Z that uses instance of X and Y as parameters because you clicked on the button A? Do you want to know the assembly that will be generated out of this c++ code?

I presume the teacher has decided to give the students an easy-to-use environment and focus on basic things like variables, flow-control, object oriented programming, ... Once the students understand these concepts he should be able to figure out himself to discover how the tool generates code for him, and understand why the tool generates it that way...

The teacher could achieve exactly the same goals with a simple text editor and compilation via the command line. But that would also restrict the students to CLI programs.. So i suppose the availability of a GUI designer (and code generation) allows the student to generate visually more appealing programs.. And might stimulate him to experiment/learn more ;)


(A friend, and former co-worker left yesterday to take on a job as program manager for the visual studio express editions at microsoft ;))

Posted: Fri Sep 29, 2006 4:45 pm
by alex.barylski
I would suggest that learning from the ground up is always best as it's difficult or next to impossible to understand high levels without fully understaning low levels first; one must learn to walk before they can run. ;)

Wizards as a PITA and when something chokes you will have no idea WTF happened.

Your professor is likely using wizards because he realizes that VS is the place to be as far as market value for a programmer...but also realizes he only has 3-4 years to teach you everything. So he'll skip out on the bare bones and get you started at a high level knowing that for everything he'll request won't likely break your code.

Wizard code and filling in the blanks is quite trivial for anyone with basic programming knowledge. Minux pointers and dealing with objects, heap VS stack, etc...

IMHO it has advantages...but takes a long time...learning CPP to a solid level takes about 1-2 years...learning the SDK will take about 1 year...understanding Windows system takes another year...learning MFC and how it all works togather will take another year...

4 years atleast right there...to get to the level of an capable Windows developer. Then another couple years to gain real experience as there many situations which books cannot prepare you for. Developing the ability to debug GDI leaks, etc...although with GC in MC++ i'm not sure thats an issue.

Anyways the point is...determine what you expect out of it...if you plan on being a Windows developer...start reading, as you will no dought need this kind of knowledge...if you plan on just being able to say your a windows developer...just learn MFC as that should get you buy. But when your manager asks you to design a customized listbox control, you might give him a blank stare :P

Cheers :)

Posted: Tue Oct 03, 2006 8:58 pm
by waradmin
Hockey wrote:Your professor is likely using wizards because he realizes that VS is the place to be as far as market value for a programmer...but also realizes he only has 3-4 years to teach you everything. So he'll skip out on the bare bones and get you started at a high level knowing that for everything he'll request won't likely break your code.
Actualy its just a 2 year class then we get into Java, fun stuff.

Posted: Tue Oct 03, 2006 9:22 pm
by d3ad1ysp0rk
waradmin wrote:
Hockey wrote:Your professor is likely using wizards because he realizes that VS is the place to be as far as market value for a programmer...but also realizes he only has 3-4 years to teach you everything. So he'll skip out on the bare bones and get you started at a high level knowing that for everything he'll request won't likely break your code.
Actualy its just a 2 year class then we get into Java, fun stuff.
We start with Java freshman year.

yay

Posted: Tue Oct 03, 2006 10:07 pm
by alex.barylski
waradmin wrote:
Hockey wrote:Your professor is likely using wizards because he realizes that VS is the place to be as far as market value for a programmer...but also realizes he only has 3-4 years to teach you everything. So he'll skip out on the bare bones and get you started at a high level knowing that for everything he'll request won't likely break your code.
Actualy its just a 2 year class then we get into Java, fun stuff.
Hmmmm...well then it's obvious...

In Canada anyways, college is quite different from university...

College is more technical hands on training, teaches you how to solve problems from a practical perspective, whereas Uni, teaches you solving problems from a theoretical perspective.

Uni is typically a 3-4 sometimes 5 year minimum. College is 2 maybe 3 if you suck. :P

Colleges being more "real world" oriented than Uni tend to accelerate your capability to "do something" as opposed to your potential absility to sove problems. If it's the same where you are, I imagine thats why he chose VS...because he's getting you ready for the workforce. ;)

Visual C++ in two years though...maybe...I suppose it's possible...but you certainly won't learn everything...likely just MFC from a client developer angle.

In anycase, have fun...it's a blast!!!