Author Topic: Too dumb to get started?  (Read 17588 times)

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 59
Too dumb to get started?
« on: July 29, 2006, 02:51:59 am »
This is about my 100s attempt to get started in programming, the previous 99 all ended the same way, I keep trying 2 or 3 days and I give up because I get nowhere, and I donīt understand why this should be so unbelievable complicated
As you can see, I havenīt totally given up yet, I always get back to it a week later or so, but you may still call me the bloodiest noob youīve ever met, so forgive me for asking the dumbest questions

Iīm not absolute new to programming, I know some basics in php/mysql
Iīve searched for online tutorials for beginners in C/C++, found some, and managed to write my first Hello World program to run in a DOS box
After that most beginner tutorials explain some basics about definig variables, get input, calculate and output, loops and stuff, that part isnīt new to me, a bit different syntax, but basicly the same as in php
After that, there comes the transformation of the Hello World program into a win32 application, sounds very easy, even the explanation looks very easy, but this is the point where Iīm getting stuck
All the tutorials I found say something about the difference in code, like I have to use windows.h instead of iostream, but none of them mentions with a single word, that upon opening a new project and choose win32 application I get a main.cpp containing a whole bunch of code already where I have not the slightest clue WHERE to fit in the Hello World

Other tutorials I found are way too advanced for me, I donīt get a single word there
I keep searching, but I wonder, isnīt there an easy tutorial somewhere on the web which doesnīt explain what I already know and then either ends or jumps to a point where I donīt get a word?
Iīd be willing to buy a book, but after this experience I almost expect it would be the same thing, either its about basics I know already or it begins at a point where I donīt understand anything at all

Can someone help me out? An easy tutorial for dummies, titled from web-programming to real programming or something like that?

sethjackson

  • Guest
Re: Too dumb to get started?
« Reply #1 on: July 29, 2006, 02:56:43 am »
This is about my 100s attempt to get started in programming, the previous 99 all ended the same way, I keep trying 2 or 3 days and I give up because I get nowhere, and I donīt understand why this should be so unbelievable complicated
As you can see, I havenīt totally given up yet, I always get back to it a week later or so, but you may still call me the bloodiest noob youīve ever met, so forgive me for asking the dumbest questions

Iīm not absolute new to programming, I know some basics in php/mysql
Iīve searched for online tutorials for beginners in C/C++, found some, and managed to write my first Hello World program to run in a DOS box
After that most beginner tutorials explain some basics about definig variables, get input, calculate and output, loops and stuff, that part isnīt new to me, a bit different syntax, but basicly the same as in php
After that, there comes the transformation of the Hello World program into a win32 application, sounds very easy, even the explanation looks very easy, but this is the point where Iīm getting stuck
All the tutorials I found say something about the difference in code, like I have to use windows.h instead of iostream, but none of them mentions with a single word, that upon opening a new project and choose win32 application I get a main.cpp containing a whole bunch of code already where I have not the slightest clue WHERE to fit in the Hello World

Other tutorials I found are way too advanced for me, I donīt get a single word there
I keep searching, but I wonder, isnīt there an easy tutorial somewhere on the web which doesnīt explain what I already know and then either ends or jumps to a point where I donīt get a word?
Iīd be willing to buy a book, but after this experience I almost expect it would be the same thing, either its about basics I know already or it begins at a point where I donīt understand anything at all

Can someone help me out? An easy tutorial for dummies, titled from web-programming to real programming or something like that?

I'm assuming you want to know how to code Win32 GUI programs right? I think this tutorial is the de facto standard for the Win32 API. :)

http://winprog.org/tutorial/

EDIT:

BTW here is the Win32 API Hello World program. :)

Code: C++
  1. #include <windows.h>
  2.  
  3. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
  4.                    LPSTR lpCmdLine, int nCmdShow)
  5. {
  6.     MessageBox(0, "Hello World!", "Note", MB_OK);
  7.  
  8.     return 0;
  9. }
  10.  
« Last Edit: July 29, 2006, 02:58:24 am by sethjackson »

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Too dumb to get started?
« Reply #2 on: July 29, 2006, 03:06:30 am »
thanks for the quick answer, Iīll give it a try (and Iīm sure Iīll be back soon)

Edit:

yeah, back already, didnīt even make it through chapter 1 of Getting Started

Quote:
If you don't know what a macro or a typedef are, or how a switch() statement works, then turn back now and read a good book or tutorial on the C language first.

I guess I need that good book or tutorial first
« Last Edit: July 29, 2006, 03:12:04 am by Newbie0815 »

Offline kidmosey

  • Multiple posting newcomer
  • *
  • Posts: 95
    • MUSITU International
Re: Too dumb to get started?
« Reply #3 on: July 29, 2006, 09:01:09 am »
http://kpest.musitu.org/

Check out the C/C++ Tutorials section.

I'm not spamming, honest!  These are the links I used when I got started with programming soooo many years ago.  Most of the links still seem good, too.

[edit]
If I were you, I'd skip down to the Coronado Enterprises Tutorials.  I probably should have placed them first.
[/edit]
« Last Edit: July 29, 2006, 09:04:10 am by kidmosey »
3 years until google knows more than god.

sethjackson

  • Guest
Re: Too dumb to get started?
« Reply #4 on: July 29, 2006, 03:02:13 pm »
thanks for the quick answer, Iīll give it a try (and Iīm sure Iīll be back soon)

Edit:

yeah, back already, didnīt even make it through chapter 1 of Getting Started

Quote:
If you don't know what a macro or a typedef are, or how a switch() statement works, then turn back now and read a good book or tutorial on the C language first.

I guess I need that good book or tutorial first

You don't need a book. Just a good C++ tutorial. :) I didn't know what that stuff was either when I started. :)

http://www.cplusplus.com/doc/tutorial/

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Too dumb to get started?
« Reply #5 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

sethjackson

  • Guest
Re: Too dumb to get started?
« Reply #6 on: July 29, 2006, 06:31:18 pm »
Well a switch statement is like an if else-if. It is (I have been told) faster, and sometimes more efficient to use a switch.

Here is an example.

Code: C++
  1. int main()
  2. {
  3.     int a = 0;
  4.  
  5.     if (a == 0)
  6.         //....
  7.  
  8.     else if (a == 1)
  9.         //....
  10.  
  11.     else if (a == 2)
  12.         //....
  13.  
  14.     else if (a == 3)
  15.        //....
  16.    
  17.     else
  18.         //....
  19.  
  20.     return 0;
  21. }
  22.  

Code: C++
  1. int main()
  2. {
  3.     int a = 0;
  4.  
  5.     switch (a)
  6.     {
  7.         case 1:
  8.             //....
  9.         break;
  10.  
  11.         case 2:
  12.             //....
  13.         break;
  14.  
  15.         case 3:
  16.             //....
  17.         break;
  18.  
  19.         default:
  20.             //....
  21.         break;          
  22.     }
  23.  
  24.     return 0;
  25. }
  26.  

Do you follow that?

EDIT:

Sometimes the easiest way to do something isn't the easiest way to do something else. ;)

Like  10 * 3 = 30. Or 10 + 10 + 10 = 30. Ok not a good example, but I think you get the idea. :) 
« Last Edit: July 29, 2006, 06:34:03 pm by sethjackson »

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Too dumb to get started?
« Reply #7 on: July 29, 2006, 06:40:19 pm »
of course I get the idea, if I know how to do something and then I discover an easier way to do it, great, Iīd love to learn the easier way, but as long as I donīt know ANY way to do something, why should I learn 2 differnt ways simultanous? Thats twice the work on start, maybe helpful later on when it comes to complex programs, but on start its boring stuff, taking twice as long to learn the basics and at least for me, investing so many hours in learning a dozen different ways to do the SAME thing doesnīt show much progress towards the general goal and the slower the progress, the more often the idea pops into my mind, at THIS speed I wonīt get anywhere within my lifetime

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Too dumb to get started?
« Reply #8 on: July 29, 2006, 07:04:56 pm »
Well I have to disagree here. If you want to program in c++ you have to know the language !!!
As the above raised example of switch and if/else. You can NEARLY do the same thing with both, but here's such thing as readability and maintenance of code. Code which is hard to read is BAD code.

Excessive if/else can make code hard to read and understand where in several situations the switch is much easer to read and understand. And for simple tests an if/else is better to read then a switch. The number of language constructs in c++ are not that many.

Next what's easy, what's not.
Character arrays are easy :
  char szTest[] = "This is a test".
Or maybe they are not, concatenation, terminating zero, size issues, allocation, deallocation. Headaches, memor leaks, crashes, ...
Well then STL's string class is easy, no need to worry about those allocation and size problems (well there's the performance level), but hey let's have a look at that string class declaration. Damn that's not so easy anymore : trait's , allocators, templates. Huh, well duh.

Programming in c++ should be taken seriously, I have seen to much stupid, erronous and awfull code because people didn't know the (entire) language.

The same with loops : while() , do while(), for () : many times you can convert one to the other, but sometimes one is much clearer to use in certain circumstances.

It's overtime one get's the feeling which constructs are to be used when and where.

Hey let's even take it more simple :
  int x = 0;
  x = x +5;
    OR
 x += 5;
Well why two ways, come on, why, why, why ? Performance, the latter one is faster. But we need the first one, yes we do : as in : x = y +5;

Ruling out options in the beginning is not wise, get to know all your cards and you will play a better game.

[EDIT] there are probably tutorials how work by means of examples and add language constructs as they go. It's just how the "theory" and "practice" is divided. When I learned driving I first had to learn all traffic signs and rules. And to be honest during my first drive I surely did not came across all those signs. ;-)
« Last Edit: July 29, 2006, 07:08:37 pm by killerbot »

Offline marfig

  • Multiple posting newcomer
  • *
  • Posts: 36
Re: Too dumb to get started?
« Reply #9 on: July 29, 2006, 07:46:54 pm »
You realy cannot learn C++ programming based on tutorials only. You will need to buy a book eventually.

Tutorials make for a good startup. However they have to be generalistic in nature (they wouldn't be tutorials otherwise). The concepts therein are presented lightly and the examples hardly ever have much meaning in real life computing. They are poweful tools though, in the sense they provide an understanding of some of the language features; what are they and how they are used. But, again, they do this at the expense of depthness.

Books, on the other hand, have a lot more space to go into depth about the language features. And that is probably what you are missing. I strongly suggest you buy either Accelerated C++ or C++ Primer.

There is another problem with tutorials. Most of them are amateurish. There are fine tutorials out there, but there are others that do a very bad job at teaching C++. In fact they will only add to the confusion (I guess this is true of some books too). The preciseness of language choices when writing tutorials or books is fundamental when one wants to teach a programming language like C++. There is a big difference between a pointer to an array and an array of pointers, and yet many authors chose to confuse readers by choosing terms like "a pointer array", which can mean both or none at all. Once C++ is understood this choice is no longer a problem. We know what it means from the context surrounding it, but for someone learning the language, the author didn't provide him a good service. Another example is not applying correctly words like "definition", "initialization", "declaration".

Learning C++ can be a frustrating experience already without these problems adding to it. What I strongly suggest you is to follow a few guidelines:

- Concentrate on the programming language first. Learn the language. Get yourself one of those two books above (my personal favorite is C++ Primer) and read them carefully. Experiment a lot. Even if what is being explained to you seems obvious, write the code to prove what the book is saying nonetheless. Read, code, read, code... ad aeternum.

- Write code that intentionally explores the bad practices the book is telling you not to use. See what kind of compilation errors you get. Try to remember them for the future. More important, try to understand why it is a bad practice. For example, when learning about dynamic memory and memory leaks, purposedly provoke memory leaks in your code. Write cout statements inside the object destructor to see if it was ran or not and when it was ran. Explore everything! What you should do and what you shouldn't do. Half of the way to understand C++ is to understand about what you shouldn't do with C++.

- Learn your debugger. This is probably one of the most important things. You absolutely, utterly, without any doubt whatsoever, need to learn how to debug. You are not going anywhere if you don't learn how to debug. It's not complicated, you need to learn mostly about breakpoints and watches. At least for now.

- Learn your debugger. I've put it here again to stress this out ;)

- Do not, I repeat, do not try to write a complete program without having gone through the book at least once. This is important because most people try to put the wagon in front of the horses, only to find out later they they will need to code a feature they haven't learned about yet. Then they go on to read hastily about it, implement it in some bad way, and not gain a clear, in depth, knowledge of it. The reasult is that they think they know how to use it, when in fact, more often then not, they have only scratched the surface. Do not try to write a full program before you are done with the book at least once.

- Be patient and be veeeery slow. Learn everything slow. Be sluggish in your learning of C++. You are not going anywhere and the language will not puff away. Understand that it takes around 2 years to be proficient in C++ and maybe a couple more to feel totally at ease with it. The important thing, what you should concentrate most is understanding that first you need to know what the language provides and how it provides it (C++ features and syntax) and only then you should concentrate on how to effectively use those features. Don't plan your learning process, don't set yourself deadlines. Be patient, slow and sluggish.
« Last Edit: July 29, 2006, 07:52:28 pm by marfig »

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 59
Re: Too dumb to get started?
« Reply #10 on: July 29, 2006, 07:49:00 pm »
for a good part I can agree there, of course it is important to learn the whole language, but before anyone can learn it all, he has to get started
if you cannot get started, because the plain mass of information to learn exceeds your learning capabilities within the first two chapters, you never make it to chapter 3, or in other words, you end up like me, giving up right after "Hello World"
how am I supposed to learn the basics, if the "Hello World" program as the simplest of all programs already uses 2/3 of the page to show alternate ways of reaching the same goal?
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
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

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

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5179
Re: Too dumb to get started?
« Reply #11 on: July 29, 2006, 08:20:07 pm »
I also advice : Accelerated C++

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Too dumb to get started?
« Reply #12 on: July 29, 2006, 09:51:10 pm »
I never really read a C or C++ book. I learned it all by reading various things on the web, but it took me a lot longer to learn. That wasn't really a problem though, since I just mess around for fun.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~

sethjackson

  • Guest
Re: Too dumb to get started?
« Reply #13 on: July 29, 2006, 10:52:19 pm »
I read a few C++ books. They were aweful.  :lol: I learned more by reading good tutorials on the internet. :) I would reccommend one book in particular though. It is called "The C++ Programming Language" (third edition) it was written by Bjarne Stroustrup who made the language. It is thick, and can be overwhelming at times, but it is an invaluable reference. :)

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: Too dumb to get started?
« Reply #14 on: July 29, 2006, 11:08:42 pm »
I have browsed through some books and I find it dissapointing at times when authors like to take the shortcuts around difficult things to explain and give you some really bad placeholder methods to do things, with some excuse like "it's beyond the scope of this book", and then never mention where to turn to find more info.  :?
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~