I found a very nice and free C++ tutorial (which kind of looks like a huge electronic book to me).
I find the section 7.9 — The stack and the heap particularly well written. The author uses simple analogies (e.g. the plate and the mailbox analogy) to explain how the stack and heap works. I always liked this kind of approach when learning new stuff. Unfortunately not many book authors use them in their works. Too bad!
1:0 for the free electronic book.
Tuesday, February 2, 2010
Monday, February 1, 2010
Can call myself a C++ programmer now!
Yeah, I've finally finished the "C++ from the ground up" book today (including the last appendix).
The author himself calls everyone who managed to go through all the chapters of the book a C++ programmer. I guess he is right. I totally feel like I am able to not only understand but also code some pretty advanced apps in this language. Of course, advanced does not mean perfect and bug free in this case. Every newbie has to start with some shitty code to become a master. The important point is to write the junk code at home and not contribute it to latest version of the application produced together with your colleges at work.
The book is really awesome and I highly recommend it to everyone willing to learn Standard C++.
The dark side of the book was that it did not cover some of the subjects commonly seen in the professionally written C++ applications. The author suggests his other book (isn't it funny? "... to know more about XXX refer to MY other book ...") to learn about e.g. "function objects" or some advanced STL data types and algorithms. Also, the author does not give any hints about how the C++ app should be structured (the ".h" files, dir structure of a project, dll's (or so's), etc.) which I think is a pity. I would expect at least a small, mini chapter covering this topic. I guess the book is good if you are willing to learn a new language (and only the language), but not the way to use it efficiently when building a large application.
Well, I am happy that I've read this book and will probably come back to it from time to time to refresh my knowledge on some certain language specific subjects.
Hmm... and maybe I will buy Herbert's second book "C++ The Complete Reference" to make sure I did not miss anything important. The templates, I definitely need to refresh my knowledge on templates right now! :-)
The author himself calls everyone who managed to go through all the chapters of the book a C++ programmer. I guess he is right. I totally feel like I am able to not only understand but also code some pretty advanced apps in this language. Of course, advanced does not mean perfect and bug free in this case. Every newbie has to start with some shitty code to become a master. The important point is to write the junk code at home and not contribute it to latest version of the application produced together with your colleges at work.
The book is really awesome and I highly recommend it to everyone willing to learn Standard C++.
The dark side of the book was that it did not cover some of the subjects commonly seen in the professionally written C++ applications. The author suggests his other book (isn't it funny? "... to know more about XXX refer to MY other book ...") to learn about e.g. "function objects" or some advanced STL data types and algorithms. Also, the author does not give any hints about how the C++ app should be structured (the ".h" files, dir structure of a project, dll's (or so's), etc.) which I think is a pity. I would expect at least a small, mini chapter covering this topic. I guess the book is good if you are willing to learn a new language (and only the language), but not the way to use it efficiently when building a large application.
Well, I am happy that I've read this book and will probably come back to it from time to time to refresh my knowledge on some certain language specific subjects.
Hmm... and maybe I will buy Herbert's second book "C++ The Complete Reference" to make sure I did not miss anything important. The templates, I definitely need to refresh my knowledge on templates right now! :-)
Wednesday, January 27, 2010
Coming back to the book
Well, I've had a small break from reading my C++ book. I was kind of "blocked" by some other tasks which required my attention.
Now I am back again and just finished reading about C++ I/0. It is nothing new, not very exciting either. The fact of adding some classes to C++ in order to make the standard C I/O methods "look better" was a good idea though. After few minutes of "playing" with the samples I was quite familiar with all the basics (and most useful) functionalities. The standard C I/O is not too bad as well but I will stick to the new OO implementation as I can already see how easy it is to write reusable components using the Standard C++ streams.
Next week I will continue with Run-Time Type ID and the Casting Operators. Now, it's time to go to Austria to snowboard a little ;-)
Now I am back again and just finished reading about C++ I/0. It is nothing new, not very exciting either. The fact of adding some classes to C++ in order to make the standard C I/O methods "look better" was a good idea though. After few minutes of "playing" with the samples I was quite familiar with all the basics (and most useful) functionalities. The standard C I/O is not too bad as well but I will stick to the new OO implementation as I can already see how easy it is to write reusable components using the Standard C++ streams.
Next week I will continue with Run-Time Type ID and the Casting Operators. Now, it's time to go to Austria to snowboard a little ;-)
Wednesday, January 20, 2010
Half way through
Today I've reached page 300 of the great "C++ from the ground up" book. What can I say? Maybe "Java makes programmer's life easy, C++ does not!" would be a good summary sentence.
The concept of passing objects as parameters, returning or initializing them is much, much simpler in Java. Everything is passed by reference. C++, gives more flexibility on this subject, but it all comes with an enormous price - complex and bug-prone code! It feels like an overkill to implement a custom copy constructor everywhere the memory is dynamically allocated for the class members. It is however necessary, otherwise a serious errors may (and probably will) occur. Errors which are both, hard to find and not obvious for the beginners.
So what happens if you work in a team? Some guys are good, the other just regular. There is only one thing that come to my mind - buggy and ugly code full of memory leaks made by incompetent developers. Oh.. there is a second thing that comes to my mind now. Outsourcing your C++ project to India or somewhere else may be a really bad decision.
Also, all this makes me think that people at the university should not start with C++ as their primary language. It's far too complex. To be able to build a bug free apps with it is nearly impossible. How can you become a programmer if you never build a good and working app? Even a teacher may have problems with detecting those little bugs which may not scream "here I am" during every execution of the program.
Moreover, an average, professional programmer is typically a lazy, not-really-responsible human being. (Since a human is not a machine and may make mistakes, she will probably do that.) No, no, C++ is not a toy, it is a heavy weapon for which reading the manual is simply a must... which is actually good for me :-) I have some time to do that now. (Which probably won't stop me from writing a shitty, bug code in the future... just like all the other do.)
Oh my.
The concept of passing objects as parameters, returning or initializing them is much, much simpler in Java. Everything is passed by reference. C++, gives more flexibility on this subject, but it all comes with an enormous price - complex and bug-prone code! It feels like an overkill to implement a custom copy constructor everywhere the memory is dynamically allocated for the class members. It is however necessary, otherwise a serious errors may (and probably will) occur. Errors which are both, hard to find and not obvious for the beginners.
So what happens if you work in a team? Some guys are good, the other just regular. There is only one thing that come to my mind - buggy and ugly code full of memory leaks made by incompetent developers. Oh.. there is a second thing that comes to my mind now. Outsourcing your C++ project to India or somewhere else may be a really bad decision.
Also, all this makes me think that people at the university should not start with C++ as their primary language. It's far too complex. To be able to build a bug free apps with it is nearly impossible. How can you become a programmer if you never build a good and working app? Even a teacher may have problems with detecting those little bugs which may not scream "here I am" during every execution of the program.
Moreover, an average, professional programmer is typically a lazy, not-really-responsible human being. (Since a human is not a machine and may make mistakes, she will probably do that.) No, no, C++ is not a toy, it is a heavy weapon for which reading the manual is simply a must... which is actually good for me :-) I have some time to do that now. (Which probably won't stop me from writing a shitty, bug code in the future... just like all the other do.)
Oh my.
Tuesday, January 19, 2010
C++ is getting to be interesting (like never before)
The more I read my new C++ book, the more I understand how does expierience with Java (and probably the other languages like PHP or Perl) help me to simply "suck the knowlege" out of it. It is really amazing how much these languages have in common. It is also interesitng how professional expierience affects the way new knowlege gets absorbed. Now, when it's completely clear to me how a "typical" (not to overexaggerate), large scale application is build, it is far much easier for me to "detect" those "big" things about the tools (like C++) I use. I can see the value of both Java and C++ better. Also, I can now imagine (from the architectural point of view), how both of the languages can be mixed together in one project in order to achive maximum performance (e.g. web applications processing large ammounts of data).
It totaly amazed me that learning a new language (syntax... completely) may be the metter of only two/three weeks. I remember it beeing so painful at the university.
Today I got to the part with bitwise operations (not really needed when programming in Java or PHP) and I finally completely understood them (in terms of, why and when to use them, why do people need them, etc.). Cool stuff, I used the bitwise operators before... but I always underestimated their real power and tried to avoid them for the sake of code complexity. The same with extern, volatile and static variables. For some reason it was never well explained to me (at the university). Hmmm.. why, when and what for should I use them. Now I get it :-)
Tommorow I will start with the "Object-oriented programming" part of the book. I expect to see even more cool stuff.
It totaly amazed me that learning a new language (syntax... completely) may be the metter of only two/three weeks. I remember it beeing so painful at the university.
Today I got to the part with bitwise operations (not really needed when programming in Java or PHP) and I finally completely understood them (in terms of, why and when to use them, why do people need them, etc.). Cool stuff, I used the bitwise operators before... but I always underestimated their real power and tried to avoid them for the sake of code complexity. The same with extern, volatile and static variables. For some reason it was never well explained to me (at the university). Hmmm.. why, when and what for should I use them. Now I get it :-)
Tommorow I will start with the "Object-oriented programming" part of the book. I expect to see even more cool stuff.
Friday, January 15, 2010
The book is good
As I mentioned in my previous post, I started to read and now decided to review the "C++ from the groud up" book written by Herbert Schildt.
After reading the first 127 pages (and taking a quick look at the next 100) I must say that it is really well written. The author makes sure to present as many examples as possible to make the theory clear. The book is also rich in "professional programmer's adivces". There is not many, but the most important ones (very much simplifying them) go like e.g. "global variables are bad, try not to use them because your code will be messy and piss of your fellow programmers" or "know where your pointers are pointing all the time!" (which is kind of funny, but true). This is actually something that I would expect from such a book and the author did a good job delivering a C++ programming guide for all (beginners and professionals). The book kind of feels like Kathy Sierra's "SCJP 6 Certification" book. It is full of detailed information on most important aspects of the programming language, well organized and presented. (I guess no one can present the contents as good as Kathy, but Herbert did a good job too.) The book is not boring and also makes me feel like "I want to know more.. come on, give it to me!". I kind of like this feeling, so if my eyes did't say "Adam, enough for today", I wouldn't stop reading it.
Nice. So.. how many pages will I read tomorrow? I guess none :-) It's weekend!
After reading the first 127 pages (and taking a quick look at the next 100) I must say that it is really well written. The author makes sure to present as many examples as possible to make the theory clear. The book is also rich in "professional programmer's adivces". There is not many, but the most important ones (very much simplifying them) go like e.g. "global variables are bad, try not to use them because your code will be messy and piss of your fellow programmers" or "know where your pointers are pointing all the time!" (which is kind of funny, but true). This is actually something that I would expect from such a book and the author did a good job delivering a C++ programming guide for all (beginners and professionals). The book kind of feels like Kathy Sierra's "SCJP 6 Certification" book. It is full of detailed information on most important aspects of the programming language, well organized and presented. (I guess no one can present the contents as good as Kathy, but Herbert did a good job too.) The book is not boring and also makes me feel like "I want to know more.. come on, give it to me!". I kind of like this feeling, so if my eyes did't say "Adam, enough for today", I wouldn't stop reading it.
Nice. So.. how many pages will I read tomorrow? I guess none :-) It's weekend!
Thursday, January 14, 2010
New Year - Old language
Since the software world would look much better if every professional programmer would read at least one book per year, I decided to start as quick as possible with upgrading myself. My pick for January is "C++ from the ground up" by Herbert Schildt (why this book... honestly, because my girlfriend already bought it. It seems to be well written.).

Why C++? I was always a Java guy! I even got certified! Well, the answer is easy.. I have to! .. and I kind of like the fact that I have to as well :-)
There is a slight chance for me to get a new, interesting job but C++ is a requirement.
The old, powerful, mother-of-all language came back to me like a boomerang I was always trying to get rid of. Re-learning C++ after so many years of experience with Java seems to be fun right now. (I am talking about Standard C++ without any MFC or self-made bullshit.) Well, some thing are finally clear to me. I understand the power of this language much better then before. I also see where it fails by giving developers too much freedom.
Hopefully, the fact that I always tried to program "into the language" instead of "in the language" will allow me to faster be able to work fluently with C++. What I am mostly afraid of is the fact that (if ever) I will probably be put into old, crappy, poorly designed and programmed project where I will have nor time neither freedom to make a change.
Anyway, C++ is the new skill that I want to put in my brand new 2010 profile.

Why C++? I was always a Java guy! I even got certified! Well, the answer is easy.. I have to! .. and I kind of like the fact that I have to as well :-)
There is a slight chance for me to get a new, interesting job but C++ is a requirement.
The old, powerful, mother-of-all language came back to me like a boomerang I was always trying to get rid of. Re-learning C++ after so many years of experience with Java seems to be fun right now. (I am talking about Standard C++ without any MFC or self-made bullshit.) Well, some thing are finally clear to me. I understand the power of this language much better then before. I also see where it fails by giving developers too much freedom.
Hopefully, the fact that I always tried to program "into the language" instead of "in the language" will allow me to faster be able to work fluently with C++. What I am mostly afraid of is the fact that (if ever) I will probably be put into old, crappy, poorly designed and programmed project where I will have nor time neither freedom to make a change.
Anyway, C++ is the new skill that I want to put in my brand new 2010 profile.
Subscribe to:
Posts (Atom)