Re: Win32 and C++
- From: Le Chaud Lapin <jaibuduvin@xxxxxxxxx>
- Date: 15 May 2007 13:02:37 -0700
On May 14, 12:46 pm, "Vadivel Kumar"
<vadi...@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
Friends,
I am a newbie to Win32 and C++. But, I have around 4yrs of working
experience with VB and then with C#. I recently started studying Win32 due
to some interest. Once i started reading Petzold's book, I started realizing
that how hard it is to print a text in a window and started getting a
respect even on small apps like notepad etc., :) because I really felt it is
very hard to write a program like calculator or notepad in C++ even after a
3 weeks of learning. I took about a week to understand how the scrollbar
works and the WM_PAINT works (and sucks) etc., Most of the time spent in
understanding arthimetic titbits like how to calculate of number of lines to
be printed in the scrolled area etc.,
I would like to ask only one question here:
What is the best way to learn Win32/C++/STL etc.,
Is there anything you experts can advice me?
All of the sentiments that you have are correct.
It is, indeed, very tedious (sometimes downright disgusting) to write
applications on Windows. And no, Microsoft is not planning on fixing
it, withing the context of the native API anytime soon. As you might
have guessed, MFC is only marginally better than the native API. And
yes, you really should learn C++. :)
There have been many attempts by independent authors to write cross-
platform GUI frame works. See:
http://www.geocities.com/SiliconValley/Vista/7184/guitool.html
I cannot recommend any of them, as I have no experience using any of
them, but I have had communications with the author of Ultimate++, and
in my opinion, he at least has the right mindset about them importance
of good engineering practices:
http://www.ultimatepp.org/examples$Days.html
Beyond that, I would learn C++ using GUI applications as examples.
The model in Windows (MFC, etc), are simply too poorly engineered. In
fact, most frameworks under Windows using C++ are poorly engineered.
This is one of the reason that some programmers migrate to C#, etc -
they make no distinction between the language proper and frameworks
within the language, and arguably, a Java or C# framework for GUI
development is not as ugly as MFC.
The best way to learn C++/Win32/STL is, in my opinion, separately. In
fact, I purposely avoided learning anything about Win32 until I was
very deep into C++ so as not to contaminate perspective. I still
don't know how to use STL, and it has not hurt any, which brings up
the following point:
C++ is not like these other languages. The scope of C++ is much
broader. The abstraction ladder of C++ starts at the very bottom
(with the _asm keyword) and runs as high as the human imagination will
allow. The other languages finds a segment of the ladder in the
middle, and confines the programmer to that region, more or less. The
point is that, if you want to learn C++ well, you have to earn your
battle scars. That means using the language as would a designer/
architect. A good place to start is to make a non-trivial reusable C+
+ class such as map<>, on your own, without cheating (simply wrapping
STL):
It should have
1. default constructor()
2. assignment
3. copy constructor()
4. serialization
5. all member functions you might imagine
Be sure to use recursion, templates, virtual functions, function
overloading, exceptions, enums, ...basically every element of C++ you
can think of. In other words, focus on this one class while building
your knowledge bank of C++.
This might seem to be tedious and slow, but it will go a long way in
teaching you the mechanics of the language. After you have done this,
you can move on to libraries, and the experience you have gained
within context of one class will transfer laterally into an
essentially infinite number of other scenarios.
-Le Chaud Lapin-
.
- Follow-Ups:
- Re: Win32 and C++
- From: Ben Voigt [C++ MVP]
- Re: Win32 and C++
- From: Vadivel Kumar
- Re: Win32 and C++
- From: Vadivel Kumar
- Re: Win32 and C++
- References:
- Win32 and C++
- From: Vadivel Kumar
- Win32 and C++
- Prev by Date: Re: Hiding un-owned window, but keep it in task bar
- Next by Date: Re: Custom non-client area and minimize and close buttons
- Previous by thread: Win32 and C++
- Next by thread: Re: Win32 and C++
- Index(es):
Relevant Pages
|