Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 31st, 2005, 5:56 AM   #31
n00b
Programmer
 
Join Date: Sep 2005
Posts: 69
Rep Power: 4 n00b is on a distinguished road
Send a message via MSN to n00b
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.
n00b is offline   Reply With Quote
Old Oct 31st, 2005, 1:41 PM   #32
frankish
Hobbyist Programmer
 
frankish's Avatar
 
Join Date: Oct 2005
Location: Ohio
Posts: 177
Rep Power: 0 frankish is an unknown quantity at this point
Quote:
Originally Posted by Gunman
Hey , i don't seem to understand quite a lot of thigs in C++ . Should i try another easier language or somethink like that first before i try to learn C++ ?
Then what language should it be ? Thanx for help.
Try C.
frankish is offline   Reply With Quote
Old Oct 31st, 2005, 2:44 PM   #33
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
Quote:
Originally Posted by frankish
Try C.
That would be idiotic, C resembles C++ a lot. Try some other language like Python.
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Old Oct 31st, 2005, 3:34 PM   #34
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by DaWei
I have to say that I don't think much of the idea of forced amounts of whitespace. It's a poor tool to use as a syntactical element. I'm big on clarity. It's the sign of a smart coder. Having the language dictate your whitespace is somewhat like your mother making you eat your broccoli. Grow up and do things properly, yourself.
I can't say I agree. Yes, Python forces indentation, but if that's what you were doing anyway, what's the problem?
Arevos is offline   Reply With Quote
Old Oct 31st, 2005, 3:54 PM   #35
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote
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
Old Oct 31st, 2005, 4:35 PM   #37
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by DaWei
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.
Though I confess I don't understand your reasoning, I can't argue with personal opinion
Arevos is offline   Reply With Quote
Old Oct 31st, 2005, 4:52 PM   #38
Arevos
Programming Guru
 
Arevos's Avatar
 
Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 5 Arevos is on a distinguished road
Quote:
Originally Posted by Mjordan2nd
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.
Forgive any intrusion, but I have to agree with quite a few of your points, though I'm not sure a specific language is to blame. From my experience, it seems like computer courses focus on teaching a language, rather than teaching programming. In the same way that learning how to speak french is of limited help if you want to learn how to write a novel, learning a programming language is only the first step on a discipline that is sadly lacking from the majority of Computer Science courses.

Quote:
Originally Posted by Mjordan2nd
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.
I agree with you that pure procedual programming is easier to learn than OO programming, as procedual programming is a subset of OO. I'd also agree that learning C is vital for anyone who wants to program for a living; C gives you a very good idea of the mechanics of your computer, without letting these mechanics totally obscure your view of the big picture. I also agree that plain C is easier to pick up than Java. And Java itself is not without its quirks.

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.
Arevos is offline   Reply With Quote
Old Oct 31st, 2005, 6:08 PM   #39
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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:
when you are writing Object-Oriented code, a lot of things are handled for you by an engine running in the background.
This is a very common misconception, and it sets my teeth on edge. I have used object-oriented design and produced the code in Z-80 assembly language. What can I say? If someone says, "Bullshit", where's my comeback? If you haven't read the short blurb at the link in my sig, "Why OOP? My View," I invite you to do so. It also gives my views on abstraction.

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
DaWei is offline   Reply With Quote
Old Oct 31st, 2005, 8:08 PM   #40
Senger
Programmer
 
Join Date: Oct 2005
Location: Vancouver, Canada
Posts: 47
Rep Power: 0 Senger is on a distinguished road
"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?
Senger is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 7:26 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC