Thread: What language ?
View Single Post
Old Oct 31st, 2005, 4:30 PM   #36
Mjordan2nd
The Supreme Ruler
 
Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6 Mjordan2nd is on a distinguished road
Dawei, I'd like to respond to our earlier question. You are one of the most knowledgable people at this forum, so I'd like to throw out my opinion and see what you think about it. It's possible that I will be mistaken somewhere. If so, please correct me where I have gone wrong. I know your question about what you gain with learning C first rather than C++ wasn't pointed at me, but I'd like to put my perspective out on it.

First of all, C++ is an OO language. While you will learn procedural programming from any book on C++, it is unlikely that you will ever do a project using procedural programming when you have such an elegant alternative in OO. Now, I have nothing against OO, but I think knowing how to program a project without having to use OO as an important skill -- C will pretty much force you to do that, at least at the beginner level.

I have nothing against OO of course. As I stated before, I believe it provides a very elegant way to write your projects. I believe C++ would be a great second language to learn, but the knowledge of writing procedural code is a positive. One reason I believe this is because when you are writing Object-Oriented code, a lot of things are handled for you by an engine running in the background. When you write procedural code, on the other hand, you have a lot more control over your code. For instance, my high-school teaches nothing but Java from Computer Science I all the way to Computer Science IV. Our teacher stresses the importance of using Java's built in functions -- searches, sorts, etc., and criticizes us when we try to write any such thing on our own rather than searching through Java's libraries. I can see his point, somewhat. Why reinvent the wheel? But what I believe to be an unfortunate side-effect of this method is that 90% of our Computer Science IV guys are going to go to college without knowing how to write a bubble sort. I don't know if such a thing in C++ exists (I don't know C++ well at all), but doing procedural programming will definitely teach you basic algorithms -- this way you not only have a sort function that you can use later on in your programming career, but you also know what's going on behind the code. Given, every serious programmer will learn these algorithms at one point or another, but is it not best to learn them when you first start learning how to program?

Furthermore, I think it will be easier to learn procedural programming as a first language than it will be to learn OO. I have seen many instances where people portray C as a cryptic language which is arduous to learn. This is not true, in my opinion. When the computer functions, it thinks procedurally; one task after the next. I believe the brain functions the same way (so it seems to me, anyway). I think that new programmers will find they have more they can relate to this way. Introductory Java was quite easy to understand -- most of it was pretty much procedural programming with a twist, I guess, however, as we started doing more complex projects, I found some of the things harder and harder to follow. It took me a while to grasp the concept of OOP. People say that learning OO is intuitive -- that it's modeled after the real world. While that may be, I found it more difficult to grasp. Perhaps that is just me, though.

I don't know if I've covered all the points I wanted to, but I didn't want to make this post too lengthy. I eagerly await your reply, as I value your opinions and knowledge pretty highly. Please let me know what you think, and why you disagree with me.

God, I hope I didn't make myself sound too stupid.
__________________
"Every gun that is made, every warship launched, every rocket signifies, in the final sense, a theft from those who hunger and are not fed, from those who are cold and are not clothed. The world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children." - Dwight D. Eisenhower
Mjordan2nd is offline   Reply With Quote