![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#31 |
|
Programmer
|
oh, about C or C++ dillema: c++ is my first and only programming language, but my buds from college who had learnt c before c++ told me that C++ has a much simpler way of manipulating files than C which is provided by the C++ iostream library. and you'll use that very often.
i'm not a pro but, i'd say that using the iostream is much easier than using IO redirection. |
|
|
|
|
|
#32 | |
|
Hobbyist Programmer
Join Date: Oct 2005
Location: Ohio
Posts: 177
Rep Power: 0
![]() |
Quote:
|
|
|
|
|
|
|
#33 | |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
Quote:
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for." -- Socrates |
|
|
|
|
|
|
#34 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Quote:
|
|
|
|
|
|
|
#35 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
What can I say, beyond what's already in my post? Obviously, it's a matter of personal opinion. Mine is that whitespace is a good aid to clarity and a poor syntactical requirement. I've never had a Bible that said that, though.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#36 |
|
The Supreme Ruler
![]() Join Date: May 2004
Location: Houston
Posts: 1,476
Rep Power: 6
![]() |
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 |
|
|
|
|
|
#37 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Quote:
![]() |
|
|
|
|
|
|
#38 | ||
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Quote:
Quote:
This said, I also believe it's important to learn a higher level language with a high degree of abstraction, such as Ruby, PHP or, indeed, Python. Too much low-level programming can be a bad thing. |
||
|
|
|
|
|
#39 | |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
I'll address a couple of your points here. The first thing you have to realize is that no one is understanding what I'm saying about C vs. C++. If, in learning a language, your teacher is forcing you to begin with OOD, when you'd feel better going more procedural, than you have a perfectly valid point. My point is that since C is nearly a subset of C++, YOU CAN LEARN FROM C++ PRECISELY WHAT YOU'D LEARN FROM C, presuming the choice is yours. There are some differences, but you'd be hard put to run aground on them. I see no harm in not ever knowing that a structure in C is not precisely equivalent to a structure in C++. Bubba, if you get that low, you're going to know the difference at an even lower level of abstraction.
Why reinvent the wheel? There's an excellent reason to reinvent the wheel. You learn about wheels. I believe that's your point, and I agree. There are scads of coders, however, who will make their mark, and never care about a wheel. They want to drive the car. Someone else can fix the flats. There are niches and there are levels of understanding and skill. If you want to come up with the definitive pattern recognition system, you would probably be advised to invest your time in creative thought and possibly new approaches, and leave the bubble-sort to someone else. There is a limit to what any one person can accomplish in one day, or one year, or one career. One picks and chooses. Quote:
Lastly, you may not realize that I'm not a C/C++ guru or a programming guru of any type. I have substantial experience, but my focus was on running successful engineering departments/companies. Obviously, I learned C before C++, and ASM before C. Some people learned to crank magneto ringers on their phones before they knew they could download lebenty-zillion ring-tones. Some people drug sleds before Oog got around to the wheel. Seems silly, looking back, but they didn't have a wheel, so they made the best available choice -- they drug it instead of carrying it.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
|
#40 |
|
Programmer
Join Date: Oct 2005
Location: Vancouver, Canada
Posts: 47
Rep Power: 0
![]() |
"Some people learned to crank magneto ringers on their phones before they knew they could download lebenty-zillion ring-tones."
(Puts up hand eagerly.) I cannot lend any philosophical insight to this discussion, except to note that in college/university, I learned procedural C++ first, the idea being that we should learn the nuts and bolts before moving on to OOP (the second term), and finally the STL (the third term). By the third term, I was learning C (and getting used to using stdio.h versus iostream, among other things). Assembly language came much later, and circuit logic last of all...everything in chronological reverse, in fact!
__________________
It can be proved that you can watch streaming video on a Turing machine. The question is, why would you want to? |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|