This is not a “People speaking” entry. And, hopefully, not a self-indulgent bragging entry.
— “Amir, did you learn Visual Basic .NET in the university?”
— “No. I learned VB.NET here, at this project that i’m doing now.”
— “And where did you study the old Visual Basic?”
— “I wrote many macros for Microsoft Word and Excel in Visual Basic.”
— “And C#?”
— “I learned C# at this project too.”
— “I want to learn C#. And C++. C# is just a new version of C++, right?”
— “Not exactly – they are different languages, but they are in the same family and their basic syntax is very similar.”
— “And is VB.NET a new version of the old Visual Basic?”
— “Yes, but Microsoft made a lot of changes in the syntax of the advanced parts, such as types, classes, objects, inheritance, controls, and stuff like that.”
— “Oh, yeah … That’s exactly the part that I don’t understand at all. I guess that I should learn it.”
If you are not a programmer, “that part” is called “Object-Oriented Programming”, OOP for short, and it is one of the most important concepts in the world of software since the late 1980’s.
At this point in the conversation i suddenly realized that i have never studied Object-Oriented Programming. I also realized that the biggest programming project that i’ve ever done all by myself was in high school. It was a project for which i received a bonus grade in my final school certificate (“bagrut”). Functionally it was a database of pupils in extra-curricular school activities.
Technically it was a pretty big Pascal program. I don’t remember how many lines of code it had, but i guess that there were at least a few thousands; i did have to break it up to several files (“modules”). It had a DOS’ish text based menu interface – almost a GUI, written using the wonderful Turbo Vision library, which apparently still exists today as free software.
To use Turbo Vision i had to learn Object-Oriented Programming and most of the concepts of Software Design and even System Analysis. I studied using books, completely by myself (except the stupid DFD diagrams, which looked hard, so i got some help from my high school Computers teacher; but he admitted at some point that they seem hard mostly because they are not so useful and allowed me to omit them from the project).
Now here’s the scary part: A year later i studied OOP at Programming Course in IDF. I’m not sure that i would understand it as well – if at all – had i not learned it earlier from a book.
And this is the point – for me self-study from books is nearly always better than classes.
In a class i feel that being there is enough. I mean come on! I woke up early, i went all the way to the school, i sat there for hours – what else do i have to do? Homework? Self-study?? I studied OOP from a book for the fun of it when i was sixteen. I am absolutely sure that i would understand it just as well if i would read it when i was nine.
When i am thinking about it this way, it seems that dragging children from the age of six all the way to to eighteen through all those classes in school is terrible dictatorship. It seems that it is done for a good cause, but it seems disastrously ineffective and possibly destructive.
But maybe that’s just me.
I thought I understood Object Oriented Programming when I learned C and what was then C++ using the Turbo C++ 3.0 manual. I like to call it C/C++ – C++ while using ANSI C paradigms. Some C++ purists say there’s not such thing as C/C++, but I disagree.
In any case, then I learned how to do Object Oriented programming in Perl, and I realised how bad C++’s OOP is. As a result I said thatC++
supports Object Oriented Programming roughly as much as COBOL supports Functional Programming (i.e: hardly). Of course, some people may argue that Perl 5’s OO is lacking, and that the object philosophy of Smalltalk, Ruby or Common Lisp are better in some respects. I have some experience doing OOP in Common Lisp, and very little in Ruby (and temporarily ran away from Smalltalk due to the Squeak’s complete lack of usability). But what I want to say is that OOP in Perl just works, while in C++ it mostly doesn’t.
I always love seeing those jobs ads for “X years of experience in OOP&D”. They usually mean C++ or Java. But OOP&D in C++ is not real OOP. To quote Alan Kay: “I coined the term ‘Object Oriented Programming’ and I can tell you that I didn’t have C++ in mind.”
I’m not trying to say there are no cases where you’d like to use C++. C++ is better than ANSI C for GUIs, games, and some other domains. But even though I grew up believing that C++ was better than ANSI C, I now prefer doing most stuff in ANSI C.
Hello, Shlomi,
Thanks for your comment – i’m glad to see you here!
That’s just My Humble Opinion, but i wouldn’t recommend Perl 5 as a good language to learn OOP concepts, although otherwise it is mostly a great first language. I think that the lack of the `class’ keyword (fixed in Perl 6, AFAIK) would be confusing enough for first-time OOP students.
C++ is not such a bad language to study OOP, although Java is probably cleaner. Many people recommend Python for this, but i think that it is a bit problematic that everything is public by default (correct me if i’m wrong – i’m not an expert if Python).