User forums > General (but related to Code::Blocks)
Too dumb to get started?
killerbot:
If you want to read good books about c++ (advanced) which do not turn their head for serious issues and good techniques I can advice you the books of (just check addison wesley or amazon) :
- Scott Meyers
- Herb Sutter
- Andrei Alexandrescu
- Josuttis
Those will teach you real (advanced) C++ !!!
mdelfede:
--- Quote from: Newbie0815 on July 29, 2006, 06:19:52 pm ---well, that tutorial at cpluplus.com is quite nice
I actually got a few steps further than usual, still I´m getting to the same point
example:
in the chapter control structures there is a paragraph about "switch" which has an exact equivalent in "if-else"
both do the exact same thing and I really don´t get, for what shall a real bloody newbie learn 2 different things which do the exact same?
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
Can´t a beginners tutorial be restricted to the easiest way to do something?
Why would it be important to a newbie, whether his very first miniature program requires 10 times more processing power? Whats the fortune of learning about the difference between local and global variables while the entire program I´m writing requires a total of 2 variables
Why should I learn how to pass variables through functions, while my entire experience is restricted to printing "Hello World!" to the screen?"
Hell I´m not writing a new OS as my first program
I can find several different ways to get from paris to rome, but if I don´t have a map and no clue where rome is located, why should I learn the route by car and by plane at same time? My goal is to get there and unless I know already how to get there by plane, I´m not interested at all in the fortunes of getting there by car, for a firsttimer the easiest explanation is the best, regardeless whether or not thats the best way to do it for a pro
However, these things make me bypass the rest of a chapter, furthermore makes me suspicious of several further duplicated ways to do the same, making me skip more and more, just to grab the easy way, which obvioulsy leads to the problem, I don´t get a word anymore in following chapters, because the author of the tutorial expects that I have learned ALL options to do the same thing, rather than the easiest one
--- End quote ---
uhmmm... from what you say, it seems to me that you "HAVE TO" learn programming, not "LIKE TO" do it...
That's the same problem in every field : if you don't like what you do, no matter how hard you try, you'll never do it well.
That's my humble opinion, of course.
If you really want to learn programming, reading a tutorial and finding 5 ways to do the same thing, the right question woul be : "mhhh, nice thing, let's see if I can use it to make my code work better !" and not "another boring way to do the same stuff"...
Sorry to say that, but if you find "boring and useless" the explanation of difference from local and global variables, or the way to pass parameters in functions, better you choose another job (or hobby).
When you'll reach classes, pointers and templates you'll be sleeping since long...
Ciao
Max
Newbie0815:
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
For the rest, you got me wrong there, I don´t thing differences between global and local variables are useless, I just think it not neccessary to explain it in the very first chapter for newbies
I don´t think passing parameters through functions is boring, I just think for a real newbie, learning what a function is and how the synatx of an entirely empty function look is way more important
Of course, if I want to develop something good, I will have to learn it all, and I´m aware it will take its time, I just think packing all options for every tiny detail into the first appearance of it in a plain beginners course is way off target
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 author doesn´t bother anymore to mention WHERE in the code the next piece should be added every other paragraph says: "IF you don´t understand what this means, don´t worry, its not important for now" and I end up with 100s of compiler errors, because I can´t figure out what belongs where
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
However, I managed to figure most of it out after a while, but I was about to give up, when a piece of code he has on the "Dialogs" page to display a dialog box brings up a simple "Syntax error"
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?
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
mdelfede:
--- Quote from: Newbie0815 on July 30, 2006, 12:40:01 am ---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
--- End quote ---
I don't understand even the simplest line of PHP, not 'cause I think is too difficult, just because I find it boring and I have absolutely no interest on it. Even so for the web-programming.... I do program for hobby, sometimes (very few) for money, but my job is other thing.
I learned programming starting with basic and assembler (apple II), then pascal, then c, fortran, c++.
I did something in Perl because I needed it, but I can scarcely write a 10 lines perl program, and I avoid to do it if I can.
I think that if you must learn some C++ for a single part of a web project, it's better you ask somebody to do the job for you... You'll spend less time and at the end less money for the same job.
If you think you'll need c++ from now forever, that's another question.
--- Quote from: Newbie0815 on July 30, 2006, 12:40:01 am ---For the rest, you got me wrong there, I don´t thing differences between global and local variables are useless, I just think it not neccessary to explain it in the very first chapter for newbies
I don´t think passing parameters through functions is boring, I just think for a real newbie, learning what a function is and how the synatx of an entirely empty function look is way more important
--- End quote ---
here I think you're wrong. As I said, I don't know PHP at all, so I can't know if it has local/global variables (I think it has), nor if it has function calls, switches, and so on.
The problem is that in c++ those are fundamental parts of the language. If you don't understand what is a function parameter, how is it passed to a function, you can only cut-and-paste some lines of code and pry that it goes, and 99% of the times it will not go.
When you write a line that looks like this one :
MsgBoxA("SomeText");
You know that "SomeText" will appear on screen in a message box you can change "SomeText" whith "Another text", but that's all. Maybe, reading a bit more, you can write :
char *msg = "SomeText" ;
MsgBoxA(msg);
And here you already have a variable (local or global is unimportant here), and a function call with a parameter.
But then you have also a pointer variable. If you'll want to add some more things to your program, you may try something like that :
char *msg1 = "Some";
char *msg2 = "Text";
char *msg = msg1+msg2; <--- WRONG !!!!
MsgBoxA(msg);
And that'll not work, because you don't know the difference between strings and pointers of chars; as you see, even the most trivial thing like concatenating 2 strings of text requires a lot of knowledge.
Whorse than that, windows works mostly with pointers of data; if you don't know what a pointer is, what are 'new' and 'delete' operators, what's a pointer ownership, you simply can't do anthing with windows.
--- Quote from: Newbie0815 on July 30, 2006, 12:40:01 am ---Of course, if I want to develop something good, I will have to learn it all, and I´m aware it will take its time, I just think packing all options for every tiny detail into the first appearance of it in a plain beginners course is way off target
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 author doesn´t bother anymore to mention WHERE in the code the next piece should be added every other paragraph says: "IF you don´t understand what this means, don´t worry, its not important for now" and I end up with 100s of compiler errors, because I can´t figure out what belongs where
--- End quote ---
That may be a tutorial fault (if they say "don't worry, it's not important for now" is it indeed a tutorial fault) or you may have chosen the bad tutorial.
BTW, if you want to learn how to program a GUI, you must know BEFORE all the basis of the language.
--- Quote from: Newbie0815 on July 30, 2006, 12:40:01 am ---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
--- End quote ---
I did use Borland tools and they used to be quite good. They're even a good starting point to learn c++ because they give many code examples, from the simple one to the complex one. You could download a trial version of c++builder and try some examples. BTW, they use some extension of c++ that, even IMHO they should be added to c++ standard (__property construct is one of the best things they added to c++), they're NOT c++ standard, so you may get a bit confused.
Of course, if you try to compile a sample from borland cbuilder using VCL with gcc or vc, you'll get tons of syntax errors because of those extensions.
--- Quote from: Newbie0815 on July 30, 2006, 12:40:01 am ---However, I managed to figure most of it out after a while, but I was about to give up, when a piece of code he has on the "Dialogs" page to display a dialog box brings up a simple "Syntax error"
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?
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
--- End quote ---
Is I said before, if you JUST want to make a dialogbox, that's not needed. But you'll understand that a dialogbox is not a complete program and, as I did show you, to add even trivial things you must know the language.
What I can say to you is : choose your operating environment at first, then try some examples from it (about all integrated environments comes with many samples), and try to understand what code does.
If you use borland, they have some good tutorials. I think also VC has good tutorials. When you don't understand, look before in help, than search with google, or have a c++ book near you.
Ciao
Max
kidmosey:
It seems the primary difference between tutorials and books is that tutorials give you a program and describe each part in turn, whereas a book is a bit more dry and just tells you the constructs of the language. So it really depends on your style of learning.
I learned C through tutorials, but C++ was much easier to learn by reading a book ("The C++ Programming Language" (third edition), Byarne Straustrup).
IMO, you should stay away from C++ until you have a firm grip on C. Some people, namely Java programmers, will say that it isn't necessary (and it isn't), but in the long run it will give you a better idea how everything is working. If you already know PHP, then you are halfway there (depending on your PHP coding style). They have many of the same constructs.
I would also suggest not jumping right into Win32 GUI programming if you don't know the basics of C, yet; it is a quick way to get discouraged. Most windows API tutorials assume prior knowledge of C, and sometimes C++. It is not necessary to know C++ to program for windows.
The reason tutorials don't just give you a dialog in WinMain is because that is not how Windows applications work. So how do windows applications work? It depends on the application. In general, they register a callback function for events, attach a window(s) to that callback, and then start an event grabbing loop. The callback procedure can be seen as the "main" function for a given window, so that is usually where all of the "hello world" code will be.
In addition, using resources for dialogs and such is MUCH easier that creating them in code (for most people).
Anyhow, I'm a bit tired, so I don't know how much of this actually made sense or hasn't already been said; but good luck.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version