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 ;-)

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.

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.

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!

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.

Monday, January 11, 2010

Few words about Avatar

Avatar is one of those rarely appearing movies which truly impress the audience (well, not all of course, at least all the people who were not affected by the Vatican City in any way).

James Cameron produced a really legendary movie which, behind the scenes shows us the current situation on our planet - the Earth. He has shown the Pandora moon as the highest value to its inhabitants, the place worth fighting for, the place so precious that it's worth dying for! At the same time, the aliens (Human beeings) are described as destructive organisms, acting like a virus, turning into dust everything they see with their materialistic eyes and not understand. This is exactly who we became and who we have always been.

Yes, the humans and the human inventions such as money or religion starting from Ancient Egypt to Christianity which always say something about "the other world", "the better place" are guilty. Our planet should be also the greatest value to us, like to those NA'vi people. It gives us food, place to sleep, to have fun with. It is great and could be heaven for everyone!

There is no other world. There is no Ra, Neptun or Christ, etc living in some king of dream land. Our real and only home is here and the only way of staying immortal is by keeping our planet healthy. Let's take care about it and teach the people respect to animals, plants and the planet itself.

James, great job.

So. Let's learn from this movie and change! I will start with me.