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

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 61
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: cpp
#include <windows.h>

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   LPSTR lpCmdLine, int nCmdShow)
{
    MessageBox(0, "Hello World!", "Note", MB_OK);

    return 0;
}
« Last Edit: July 29, 2006, 02:58:24 am by sethjackson »

Offline Newbie0815

  • Multiple posting newcomer
  • *
  • Posts: 61
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: 61
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: cpp
int main()
{
    int a = 0;

    if (a == 0)
        //....

    else if (a == 1)
        //....

    else if (a == 2)
        //....

    else if (a == 3)
       //....
   
    else
        //....

    return 0;
}

Code: cpp
int main()
{
    int a = 0;

    switch (a)
    {
        case 1:
            //....
        break;

        case 2:
            //....
        break;

        case 3:
            //....
        break;

        default:
            //....
        break;         
    }

    return 0;
}

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: 61
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: 5490
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 »

marfig

  • Guest
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: 61
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: 5490
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~