|
As response to a question how to learn C++ and become a "pro", "not only using DOS commands, but also MFC"
The following is a roadmap to "Mastering C++" - how I would teach it.
Some people might want to reorder the list which is fine with me - it all
depends on the teacher and the tools.
Chapter (I) Learning the language
- basic language: type system, control structures, functions, scope.
- basic concepts: programming style, structuring your program using
functions, the difference between contract, declaration and implementation - language: pointers.
pointer arithmetic, referencing, dereferencing, pointers vs. references,
pointer to pointer, adress of pointer, allocating raw memory, etc.
If you didn't succeed with (3): learn pointers
If you don't get it the third time, give up. Really. I am serious.* - debugging. assert, trace, using a debugger, distrusting yourself,
acquiring some programming style. - language: Function overloading.
- language: classes. Member functions, constructor, destructor
- concepts: encapsulation, simple object design, encapsulating state
- lanuage: learn exceptions **
- repeat concepts: good programming style, contract vs. declaration
vs. implementation - concepts: inheritance, polymorphy
- concepts: "enhanced" object design with the new knowledge
(exceptions and polymorphy) - language: some refined points
const-correctness, default constructor, copy constructor vs. assignment
operator, how to make a class behave like a built in type (but skip operator
overloading) - language: templates: function templates, class templates, template
specialization, - get an introduction on the STL (standard template library, which
makes the biggest part of the C++ run time library) - language: ok, now, just as sugar, operator overloading, and how to
make types truly act like built-ins - libraries: refine your knowledge on the STL
NOW you are ready to leave the console window
Chapter (II) ...but also MFC
- Windows API basics: This helps understanding some of the
mumbo-jumbo and awkwardnesses in the MFC much better
Event Driven Programming, Windows, Window Handles, Window Messages
(you can omit *creating* windows here, since this is a painful task made much
easier by frameworks - but the rest is important to understand and makes
working with the MFC easier).
GDI, standard controls etc. - Do the MFC "Scribble" tutorial, just following the main path (up to
"printing" or so). Don't try to understand everything, just get a feeling for
the "flow". - Do the "Scribble" tutorial again, this time exploring the background
explanations etc.
Chapter (II) Become a Pro
- Notice that, once you are here, you are the last remaining person on earth
doing MFC - Learn enhanced concepts: Exception Safety, Patterns etc. and all the fine
parts I have forgotten above - Learn "Industry Power" stuff: Automated Tests, Version Control,
Finalizing, and everything that belongs to running a larger project.
<b>Warning:</b> this course is a pain. In the ass, in the back, in your
fingers, everywhere. Yet, it's IMO one of the shorter routes to a pro. To be
true, you could start with th MFC stuff pretty much after (I)-(j), but this
makes you only half-a-programmer, and you might acquire some misfeats that are
hard to get rid of later.
The order of the list itself clearly shows some drawbacks of the C++ language,
namely, the position of exceptions, and especially the STLBoth are standard
tools that should be introduced much earlier, but require good understanding of
the basic language features.
*) I pretty much agree with the thought that understanding pointers
needs a certain "wiring" of the brain. All other stuff in C++ can be learned
by a decently intelligent person. Pointers are different, you either get them,
or you don't. If you can't do pointers, C++ will be a pain all the
time.
**) that's really late, to late. They are an important tool for error
handling - and people should learn it as early as possible. However, it
doesn't make much sense wihtout a good grasp on scope and code flow. I would
do exceptions right after (b), but books/courses don't do it without classes.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
lol ,Peter is tired of being called "Mr. Chen",I suggest that you take a chinese name,just like chen pite
BTW,thank you for sharing your article, i'm learning MFC
|
|
|
|
|
Imagine you are on the holiday trip of your life - south italy, just across Sicily. Your'e in a bar, there's this incredible girl with piercing black eyes, and you don't know if she just smiles at your veiled attempts to explain the bartender what you'd like to drink, or just smiles at you.
To break the ice, you scratch together your last italian, and say something to her.
In that moment, the whole bustling location freezes. Eyes either turn to you, or away. The bartender slowly puts down the bottle of whatever you did not want to order, but finally agreed on. A young italian boy, slender, moving like quicksilver, dark, angry eyes, turns around and asks you (in unintelligible italian, of course):
"What did you just say to my little kid sister?"
THIS is the kid sister rule.
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
5! To funny
|
|
|
|
|
Since it crops up frequently:
a) VC7 : makes the CStringT template available for both ATL and MFC projects
b) WTL (clickety[^]) : provides a 1:1 CString clone for ATL/WTL projects under VC6. The ATL/WTL framework emphasizes "link on demand", so you could basically create a raw Win32 application/library with CString
c) On Codeguru you'll find a macro that extracts the CString sources from your MFC library, so oyu can add them to any other project
d) there are some CString clones[^]. However, with the availability of WTL, there's rarely a need, unless you need to be portable
e) finally, you can "rip out" the WTL CString class. All that CString needs from the framework is the Ressource HINSTANCE for implementing LoadString and similar functions. (IIRC there are some more system-dependent elements, which can be easily replaced)
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
"Have you tried Jesus?"
"Jesus? Oh, that guy. Tried to take the load of others, and couldn't even carry his own. He lived a life of agony and pain, and he died a horrible death. Now how can I load my own pain on the back of this guy!
Do you really think he was happy here? Look around. People are a pain. Everybody has one or two or a dozen who make all this bearable, but the rest - not that I dislike them, but I would miss their number, not them individually. Now imagine you walk around to get them all smiling, at once. And everytime five or six of them do, someone behind your back breaks into a curse.
I bet he found peace and his daddy only when sitting under an olive tree, watching an ant, and a stone, just be. This is where all that salvation and better afterlife comes from: HE just couldn't bear this life. If we wouldn't have killed him, he would have probably done this himself.
Do you know the scene, where Judas doubts his own plan, and doesn't want to go to Kaiphas? Jesus sees this and tells him his, Judas', task is harder than his own: carrying the burden of the traitor, rather than die for your fight. But to find an end, we need the traitor as much as the redeemer.
Who am I to burden this man with the dirt of my own? We went a few miles of our road together, but where he goes I cannot follow."
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen
|
|
|
|
|
The only thing i know now is that i can learn a lot of knowledge from you but i surely can not get Peace! My dear Mr. Chen!
God Bless.
i'm sorry i'm a little agitated.
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
i admit you are a genius,satan is too,isn't it? when he begins to doubt God.
i'm just a very little ,little boy,and so weak! i can't control my life! the only thing i can do is just making mistakes. until i met Jesus Christ!
Maybe He is that guy as you said " Tried to take the load of others, and couldn't even carry his own."
Luk 23:34 Then said Jesus, Father, forgive them; for they know not what they do. And they parted his raiment, and cast lots.
i learn from Jesus what real Courage is: that's knowing he is going to die and insist on it; what real Patience is: that's maybe he died for those who will never understand but he insist on it; what real Love is: that's He loved people so much even those who hated Him and put Him die on the cross.
now i have the courage and i dare to talk to you golden genius member,i have patience to keep on talking because God taught me to love.
Jhn 3:16 For God so loved the world, that he gave his only begotten Son, that whosoever believeth in him should not perish, but have everlasting life.
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
.. Tried to take the load of others, and couldn't even carry his own // i suggest we don't use human's viewpoint, Jesus has indeeded conquered the world and risen from the death,it's a fact not relying on whether we believe or not.
.. He lived a life of agony and pain, and he died a horrible death. // that's true. But also He brought us Hope and Joy! Carried our burden, that's why He died on cross for.
.. Now how can I load my own pain on the back of this guy! // if you really Believe! don't be a stupid man who carried 200 kg load on the train himself cos be afraid of hurting the choochoo.
.. Do you really think he was happy here? Look around. People are a pain.// of course God is not pleased for people who didn't believe in Him. He is so sad about this! if we really can feel God's heart! He gave us free will to choose, but the only thing i do is just disobeying Him, and accusing Him: "god,why did you create so many disasters?why did you bring us so many pains?"
Gen 3:16 Unto the woman he said, I will greatly multiply thy sorrow and thy conception; in sorrow thou shalt bring forth children; and thy desire [shall be] to thy husband, and he shall rule over thee.
Gen 3:17 And unto Adam he said, Because thou hast hearkened unto the voice of thy wife, and hast eaten of the tree, of which I commanded thee, saying, Thou shalt not eat of it: cursed [is] the ground for thy sake; in sorrow shalt thou eat [of] it all the days of thy life;
All these begins,since we didn't believe in God. Isn't it?
We human beings are so proud of ourselves,our intelligence. we are clever enough to have a war and killing others on our own purpose,we can be happy while hurting others, we can achieve goals without our faith.
Please forgive us ! Lord! i'm living having no meaning, without You!
God Bless.
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
Please allow me not to comment - except one thing: please be careful with what you read here.
This is what I am writing, this is not necessarily me. I haven't written this to question, nor to strengthen your belief. I wrote this because I had to write it down. This is what I write, not more: this isn't me, not the truth, not a voice I hear.
I am not christian, not a satanist, not agnostic, certainly not atheist. Classic analysis shows me closest to paganism, but that's juzst a label I can live with, not more.
Live your life, and I live mine, but keep telling me about yours, and I'll keep telling about mine.
we are here to help each other get through this thing, whatever it is Vonnegut jr. boost your code || Fold With Us! || sighist | doxygen
|
|
|
|
|
You're so kind.(reasonable) very scientific. it's my honor to be here. Thank God! There are so many things to learn!
Enjoy the life Have good everyday.
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
i do appreciate what you are doing for the world,doctors should be admired!
i want to express my own feeling: as you said, " Maybe all of this effort is in vain ..." but we're still trying,right? we're trying to make a better world. no pain,no sick.
but now when i look around, there are so many healthy people (physically) living in a sick way. They don't know their life purposes, they are struggling in the world, be willing to be the servant of money,power...
Life is not in our own hand. Who knowns there will be not another cancer(like AIDS)?
Jhn 14:6 Jesus saith unto him, I am the way, the truth, and the life: no man cometh unto the Father, but by me.
i am not a good man. i don't care about others ( even my closest friends,relations). i will not be like you taking so many efforts to save people from death.
But God really saved me! He changed my life! i now find how we need Him! as you said,i can't do anything,that's our status. i think God is pleased with our realizing ourseleves.
Mat 11:28 Come unto me, all [ye] that labour and are heavy laden, and I will give you rest.
God Bless you all!
---------------------------
You will when you believe!
------------------------
|
|
|
|
|
Note: these are the raw images, i.e. they are BIG. I don't know how much bandwidth I have, so someone might want to nirror them
Welcome to London![^]
The rounds have started[^] - guess who was just in time for the order?
Reinforcements[^] (not that we actually would have needed them, but it's nice to know)
OK, then there was this "Colin on a Pole" thing. Since the many "are you Mr. Obwo Mbgangu" questions had a tendency to disturb the flow, we (pluralis majestis) suggested to rob Colin of his Jacket and stick him on a pole so we are recognized correctly. Repeated intimidation made him work out a compromise -
Colin shows off[^]
(hint: colinonapole.com isn't taken yet - grab it before someone else does!)
CPians in the wild[^] - they don't live on pizza *only*!
roger@foodplace-1.lon[^]
My (pale) side and Caspar[^] who was renamed to Jedidjibdjib quickly, since this was much easier than his real first name.
Meg even brought along non-CPian reserves!! All Hail Meg![^]
While the others visit the science museum, Jonathan and I got stuck in the
Oriental Collages - special exhibit[^]
food place 2[^] everyone seemed to have made the better choice. Well, you don't go to England for the food, they say...
The Globe - but what is missing?[^]
THIS![^]
OK, much better[^]
You are in a small hall. You see five exits.[^]
now, a little bit about me -
You are here *[^]
(somewhere)
Temptations Temptations...[^]
ok ok, I promised, you get.
WARNING - ADULT CONTENT -
Meg & Brandon in hot live action[^] (hot hot hot drunk chick with stud!)
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
|
I've been searching him, and when I found him, we didn't have anything to say to each other.
I'm not disappointed, he made this world (or part of), and he seems to have good intentions. It is almost as if I don't mind. To me he's like a neighbor you never meet, you sometimes hear weird noises from over there, sometimes you wonder if he's a lunatic whacko, but most of the time you're ok with him.
His son of course - but that's a different story.
It's a weird night. And I wonder how god came into it.
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
Fathers always keep the accolades at a minimum for their sons. Part of making them a man or some such rubbish. Be hard on him, it will toughen him. Poor guy, big boots to fill.
regards,
Paul Watson
Bluegrass
South Africa
Chris Maunder wrote:
"I'd rather cover myself in honey and lie on an ant's nest than commit myself to it publicly."
Jon Sagara replied:
"I think we've all been in that situation before."
Crikey! ain't life grand?
|
|
|
|
|
|
peterchen wrote:
It begins online, but it ends in real life.
Nice, What happend that you think about this?
Mazy
"A bank is a place that will lend you money if you can prove that you don't need it." - Bob Hope
|
|
|
|
|
Actually I read it on a forum, with the positive meaning that "though we started online, it doesn't need to stop there". But it matches some experiences, (both mine and others)
Flirt harder, I'm a Coder
mlog || Agile Programming | doxygen
|
|
|
|
|
|
How to provide a C API for a C++ class / implementation
#ifdef __cplusplus // compiled as C++ ==>
class CFoo
{
public:
int Foo() { return ... };
static CFoo * CreateInstance() { return new CFoo; }
};
#endif // <== compiled as C++
#ifdef __cplusplus
extern "C" {
#endif
void * FooCreate();
int FoFoo(void *);
#ifdef __cplusplus
}
#endif
extern "C" void * FooCreate() { return (void *) CFoo::CreateInstance(); }
extern "C" int FooFoo(void * f) { return ((CFoo *)f)->Foo(); }
Cool!
I'm not sure if this is a VC6 only thing - but that shouldn't hurt me much
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
[pre scriptum]
I've thought about removing these posts multiple times - because I consider it not good for some people that started to "find" me here. Yet, I cannot unwrite, nor undo these things, and deleting feels like cheating myself.
So if you know me personally, and stumbled in here: read if you like. But keep in mind that by reading on you are going to see me naked. Cheesy white belly and all.
[/pre scriptum]
ok paul you asked but I'm not writing this for oyu - just for me, so to say
Something weird happened to me, about a month ago.
I was at a reading, Dostoyevsky's "Crocodile", rather unusual for him and his time, reminding of the (much later) "Metamorphosis" by Kafka. There were these two redhead girls, one slender, with her rich strawberry blonde eyelashes, full-yet-pale lips, and those huge shiny freckles on her white writs. The other one - larger, someone to hold, to touch, with a wild red mane. I was lost. I couldn't have decided if they asked "which one"? I suppose my attempts to keep my eyes with me were in vain, but the slender one seemed to appreciate it. Or was it just giggling about a madly grinning how-old-is-this-guy-anyway?
Two days later, the memories of the pair'o'Circes still fresh, I wondered: which one I'd like to wake up besides?
Anna. The thought was just there, clear and simple, no surprise, no "struck by lightning". The realization came slowly, like Wile E Coyote running over the edge of a cliff, and now falling freely.
Anna. Who is almost my total opposite. The one I know since ten years ago. "For ten years" would not be appropriate: she's never alone for a long time, and we rarely meet when she's not. Yet the time we spent was always something special.
Anna. Who always throws a big party when she's looking for a new man. I've been there often enough, and it wasn't the first one I helped prepare a few days before.
Being a friend has the great advantage of hearing the name of her new desire for a week, rising in occurence, then, I think when she made the decision that it is him, she changes to the last name fo a few days, before it is "My insert first name here". Being a friend has the great advantage of getting progress updates rather immediately, and I could have known pretty well in advance that her openness would squeeze my heart like a lemon.
I wish I could have told her, but before I got myself sorted out, we slipped into the "meet rarely" phase, we keep contact by mobile, but lately this is more my initiative - which is unusual for me, and a pain in any way. I simply can't tell someone "I know you have someone but I love you", much less when she, working to much and tired, takes a one hour detour to say "Hi" before falling to sleep.
She throws her birthday party on Friday, and I'll be there. Grinning madly and clouding my thoughts, as I've always done.
[edit]Being a friend has the great advantage of getting a "we did it" update within 8 hours. She just called me at work, to say "hi" - and slip it out.[/edit]
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
mlog || Agile Programming | doxygen
|
|
|
|
|
>slender, with her rich strawberry blonde eyelashes, full-yet-pale lips, and those huge shiny freckles on her white writs.
mama mia!
Being a friend can be torture, I hope she wakes up and SMSs you "Lets do it" soon!
regards,
Paul Watson
Bluegrass
South Africa
Brian Welsch wrote:
"blah blah blah, maybe a potato?" while translating my Afrikaans.
Crikey! ain't life grand?
|
|
|
|
|
It's weird, it's a pain, and the worst thing: I feel like I can't talk with my friends about it, not even with the two guys I considered "can talk about everything".
Because I know things about Anna that I shouldn't know even when not being fallen for her, that would make every decent heady guy shun away from her, things that don't fit my friends (beautiful nice almost-perfect)worlds - compared to the stuff I usually find myself in.
Dammit Anna. You don't fit into my life, and who the hell let you sneak in?
Flirt harder, I'm a coder.
mlog || Agile Programming | doxygen
|
|
|
|
|
Would she be Anna without these picadilos? Would you want her to change and conform to the standards of your rosey cheeked social circle?
And remember, nobody is even almost perfect, everybody has their picadilos hiding inside, even your perfect friends
regards,
Paul Watson
Bluegrass
South Africa
Christopher Duncan quoted:
"...that would require my explaining Einstein's Fear of Relatives"
Crikey! ain't life grand?
Einstein says...
|
|
|
|
|