User forums > General (but related to Code::Blocks)

Too dumb to get started?

<< < (7/9) > >>

marfig:
I don't think you are really listening to what everyone is trying to tell you from the very beginning of this thread. And that is simply, you need to understand the language before you can hope code for windows. It is really simple as that.

Just, please, learn C++. In the console. Learn about variables, types, functions, references, pointers, the STL library, classes, templates, exceptions,....

Only when you do this, only when you have learnt the fundamentals of the language, only when you have done this in the console and feel somewhat secure you know what there is to know of C++, only then, only at this point, only here... will you be able to make any sense of Win32 books and tutorials. Only then will you realize why some choices were made concerning the order by which things are being taught to you, and only then will you actually learn anything valuable.


--- Quote ---As my first project, to learn by doing, I´ve picked the idea, I want to write a simple chatserver where clients can connect to exchange messages,
--- End quote ---

Wrong. Bad, bad choice. You will not learn anything. You will quit learning C++ if you try to do this because you will feel frustrated. You use the word simple to describe this project, but I can tell you right here and now it will not be simple. If you think this is the best way to learn C++, I'm sorry to say in 1 or two months you will be looking back at this post and wondering I was right. You will quit, my friend. Mark my words.

Concentrate instead on the language features. Concentrate on learning how to program in C++. Not on how to do things with C++.

Remember your objectives:

Right now your objective is to learn C++, not to code a chatserver.

Newbie0815:
well, on this part i might be a bit different from everyone else
first of all, reading a book or tutorial without an actual project to realize is THAT boring for me, i never get past page 2 (or i skip through 90% of the text)

beginning with the C64 in 1985 I´ve ALWAYS learned by doing, my very first program was an assembler code for C64 which was capable to copy ANY file from disk to tape
In PHP I learned the basics over night, took a complete multiplayer strategy browser game as my FIRST goal, realized the first beta within 3 months and a functional version within 6 months, containing some 4MB of php code in over 300 (object oriented) scripts and some 60MB graphics

Object oriented programming isn´t new to me, one of the first things I´ve done while collecting the pieces for my project was to put every piece into a new function and mess around with them until they were perfectly interacting, I´ve already overloaded it with so many functions, separating even the smallest pieces of repeated code, just to understand perfectly how a functions works
I still don´t like the idea of global and local variables, but I do understand the concept
I don´t like the concept of define before first use, making protofunctions and other stuff neccessary, but I understand the concept
And if you´ve seen what I´ve written above, I HAVE the client and server ready already, the only thing missing is the connection
When I say "I´m stuck" there, that means no more than I´ve spent 2 hours or so and haven´t had success yet, but you may bet, I will solve it on my own if I have to, asking around in here is just ment to be a shortcut to save me some time

killerbot:
@Newbie0815

Well I agree with all the others learn first, but on the other hand you are no plain newbie ;-)

Let me ask you a few questions :
1) did you use inheritance ?

if so :
  2) is the destructor of your base class virtual ?
  3) why inheritance ?


4) hopefully no public variables ?
5) did you use RAII ?

Just a few simple questions ;-)

Cheers.

Newbie0815:
well, I sure am a newbie, maybe not that bloody anymore, still I wouldn´t dare to publish any of my products, I´m by far not out of a stage of messing around with it, just to learn

now let me see whether I can pass your test

1 and 3) I ran into inheritance in a few of the tutorials, I even coded an example from one tutorial just to see how it works
So I know what it is about, I know specially in win32 applications theres a LOT of inherited stuff from the libraries, but other than that I´m not using it in my current project (yet) because while learning I like to see what I´m doing within every function, without I have to lookup from where it came, I´m busy enough to remember (or look up) the unavoidable ones
I know it would give a faster application, but with this mini program speed is my last concern

2) More by chance I was using virtual destructors from start, by the time when I discovered the reason in a sidenote of a tutorial I was already used to it

4) should I rather use 100s of get´s? From php I´m so much used to have all variables available at all times throughout a complete script, I like my little notepad file aside where I write down all variables I´m using
5) no, I think I´ve seen something about it, something about easy cleanup, but I guess cleaning up I can do after I´m done messing up

killerbot:

--- Quote from: Newbie0815 on August 01, 2006, 11:50:19 pm ---2) More by chance I was using virtual destructors from start, by the time when I discovered the reason in a sidenote of a tutorial I was already used to it

--- End quote ---

cool


--- Quote from: Newbie0815 on August 01, 2006, 11:50:19 pm ---4) should I rather use 100s of get´s? From php I´m so much used to have all variables available at all times throughout a complete script, I like my little notepad file aside where I write down all variables I´m using

--- End quote ---

yes !!  Information hiding/maintenance/reusability : interfaces are the things you work with and exchange with other parts of the code
Note : a class should have not to many members, if it does this hints your class it doing to much things.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version