I don't know what exactly you would have to unlearn, considering C++ is just an extension of C.
What people actually mean to say when they mention something like this is that C and C++ are different programming models. C is functional whereas C++ is object-oriented. While you
can write functional-style code in C++, it can be a serious mistake to do so.
It's not that you'll have to "unlearn" functional programming to do object-oriented programming correctly. It's simply that the two models are very dissimilar, and it's generally not worth learning how to do the former if what you ultimately intend to use is the latter. This is especially true for graphical userspace application developers; it's rare to need functional programming techniques in this area. On the other hand, if one intends to become a systems programmer (developing a kernel or a low-level library, for instance) it may be extremely helpful to know functional programming.
C++ is fairly often criticized for allowing the mix-and-matching of the functional and object-oriented paradigms, especially by developers who come from languages that don't permit it (these include Java, C#, modern VB, and quite a few others). It's uncommon to find these kinds of points being raised by developers using Python and Pascal derivatives because their languages were architected to be flexible, just as C++ was.
Can´t a beginners tutorial be restricted to the easiest way to do something?
The easiest way is not necessarily a good way. Programming tutorials are not written to show people how to do quick fixes -- you really shouldn't be writing programs if your goal is the most hackish, fastest possible solution. A well-written tutorial (or book) will inspire, at the very least, decent programming practices. Then, when your program has grown from 2,000 lines to 20,000 (or even 200,000), you won't be stuck with a nightmarish quagmire.
I can understand, there are differences for advanced users, I´m sure there are things which can be done easier or faster by "switch" than by "if-else", or something like that, but for someone like me who wants to learn from scratch, when I find 2 different ways to do the exact same, I start reading the chapter until I find out it wasn´t even neccessary to learn this sh*t, because I already know a much easier way to do the same
The If...Else construct is much easier than Switch? Sure, if you only have a few values to enumerate. With win32, there's a ridiculous number of window messages (WM_*), and sometimes you need to catch more than a few. In any case, Switch is pretty simple. So long as you remember to use the break statement properly, it behaves just as If...Else would -- except the code is cleaner.
this effect multiplies with every further chapter, there is maybe one tiny little detail per page which is new, the entire rest the author spends on explainig how many different ways this new detail now offers in order to adchieve the same goal, or in other words, the part where I learn something new is reduced to a tiny little fraction of the time invested, the progress I make in learning is < 1% of my working time and I spend 99% of my time reaching the same goal from all possible directions
If 99% of your time is spent doing nothing of significance, there's two things to consider:
a.) is this tutorial/book/teacher any good?
b.) am I actually trying to study or learn from the material to the best of my ability, including studying and modifying the provided source?
I´m not saying its wrong, I´m not saying its bad, I´m not saying its not neccessary, I´m saying this bothers me so much on start, that I never even get started because I give up before I get anywhere due lack of progress
GUI programming,
particularly using win32, is tedious. That's all there is to that. The win32 API is almost entirely C, and thus if you intend to use it directly you will have to do things the functional way. That means creating and initializing a bunch of structure instances, and calling a lot of functions directly one after another. Win32
is not fun, there's no doubt about that. I would never recommend someone begin learning programming by building straight win32 programs.
As some wise guy once said (not sure who it was) "If you want to learn how to fly, you first have to learn how to walk"
These tutorials are teaching walk and fly simultanous
Since it's quite impossible to learn how to fly from walking, that's some horrible advice. I think perhaps your analogy is supposed to reference walking and running, no? In any case, it's not an apt comparison -- with something like the If...Else and Switch constructs, it's two separate means of branching. Neither is dependent on the other; you could learn either first and it is most certainly possible to effectively learn both at once. The difference is all syntax, nothing more.
Now, to introduce branching mechanisms before describing statements, types, and the basic operators -- that would be foolish.
max, for one, you got me, there is a good part of I "have to" in my wish to learn it
its something like, through my web-programming in php, I got to a point where I want to develop something which cannot be done in php
I´d love to do it, but if I want to do it, I have to learn C/C++ first
C and C++ are not the only programming languages on Earth. If you weren't aware, you can access C libraries from essentially any language (a programming language that can't interface with C is rarely worth using for application development). The vast majority of win32 consists of C libraries -- hence if you want to use win32 you can do it from whatever language is most comfortable.
C++ libraries are a different matter. Only a handful of languages can access them properly, because 1.) the C++ ABI is not as stable as C's and 2.) C++ is a much more complicated language, period. Python is a good example of a language that interfaces very well with C++; you might consider it if you need a C++ library like wxWidgets or Qt. A language like Object Pascal, on the other hand, requires an additional interface layer (whose purpose is to essentially translate the C++ interface to a usable C interface).
I like the first 2 pages in the http://winprog.org/tutorial/
First page the hello world program as a win32 application, 2nd page the easiest possible window, including explanations how it is setup and what all the code means
but from 3rd page on I´m lost
The code snippets in theForger's tutorial can become confusing. You really
must examine the full source to see how the code fits into context.
Other than that, what's so confusing? Handling messages is a very basic part of win32 programming, and it's absolutely essential. He didn't stick it into the third section just to annoy people.
If you're getting sidetracked by the ridiculous number of typedefs, that's normal. Microsoft decided, for whatever asinine reason, to create about a thousand 'distinct' types which are actually all typedefs of standard types (mostly integers). Furthermore, they decided to name them all with pure caps -- a convention normally reserved for constants. It's one of numerous problems with win32, and has nothing to do with C++ or any other libraries.
I've tried downloading the source code he provides, but thats totally different from the tutorial, because he is using borland and makefile which isn´t mentioned by a single word in the entire tutorial
The compiler is highly irrelevant to C code. In terms of software, the C standards are ancient. Any Windows C compiler can build that code.
By the way, DSP files are provided for each of the code samples. These are Visual Studio projects, that can be built very easily. Borland's toolchain is not required, although you could use it to easily build everything at once.
In any case, these applications are so simple that they can be built from the console with a single command. Consult your compiler documentation if necessary. For those that use win32 resource scripts, you have to use a resource compiler like
GoRC to turn the script (*.rc) file into a compiled resource (*.res) which can easily be linked into the final application.
Thats the point where I really wonder, is it absolute neccessary to understand resource files, object oriented programming, all types of variables and 100s of other things to pop up a simple dialog box? Wouldn´t it be MUCH easier for a newbie to explain FIRST how to popup a dialog box, SECOND how to modify properties of it and LAST how to implement it into a resource file?
What does object-orientation have to do with win32? The win32 API is functional (or procedural, if you prefer that term).
It's not necessary to learn how to use resource scripts initially. That's why theForger's tutorial doesn't use them initially; it's section five that introduces them. Without resource scripts, you can't intelligently build any halfway complicated dialog with win32. You certainly won't get to building any serious application with pure code driving your windows, unless you want to deal with pure hell.
Modifying dialog properties doesn't belong in a separate section from the basic concepts. One, it's quite simple itself -- changing the value of a single structure's field, generally. Two, without modifying any of the default values, you won't be building anything the least bit useful (or interesting, for that matter).
To learn how to use a dialog box, there is no resource file needed at all, it could easy be implemented into main, explain how to work with it and AFTER thats clear explain how to put it into a resource file and how to include the resource into main
The MessageBox function, a basic window, and messages are all introduced before resource scripts. I'm wondering what order you think would be comprehensible, if this isn't?