Wouldn't they then melt in the course of their duty??Betaz*E*p
Shaaa.... not if they are the rubber variety!
Wouldn't they then melt in the course of their duty??Betaz*E*p
Shaaa.... not if they are the rubber variety!
I would recommend learning C before moving on to C++. C is much closer to the machine than C++ is, and helps you understand programming better. Also, C is much stricter, and will enforce good programming practice. e.g:declaring variables in the beginning of the relevant block. In my opinion*prepares to get flamed* C is a much cleaner language than C++. The grafting of OO onto procedural is unnatural and messy and results in a huge, awkward language, especially when compared to an OO language such as smalltalk.
This brings up an arguement from work. Some argue that C++ is not a true object oriented language, it is only an imitation of OO. Some even go further to state that Java is not OO since it has primitive data types. What does everyone else think?The grafting of OO onto procedural is unnatural and messy and results in a huge, awkward language, especially when compared to an OO language such as smalltalk.
(I don't really care, each has strengths and weaknesses, and I just use the one best suited for the situation. Just trying to start a debate.)
Well I have a book on C and 1 in C++, and I'm taking a class in C++. C++ is *Much* easier to look at. It just seems cleaner to read, but that's an opinion. I guess if you want to write an os, forget C++, go C and/or ASM. That's the only reason I see to use C. But I think C is a better language because classes really suck. Well, maybe not, cause overloading I think is not in C. But I could be wrong.
>Also, C is much stricter, and will enforce good programming practice.
This is true. Some C++ practices will get you burned pretty badly in C, if you know the limitations of C then you will be able to better understand C++ and how it attempts to fix those limitations. Nul terminated strings come to mind
>The 'bad habits' I take as being the procedural design style of C
>when faced with OO in C++.
You forget that C++ is still procedural, the procedural aspects are simply hidden in the OO aspects. C++ may work with objects, but the procedural techniques such as evaluation and iteration are what make those objects work. OO programming is simply an abstraction of procedural programming that makes it easier for the average person to understand.
>In my opinion*prepares to get flamed* C is a much cleaner
>language than C++.
I agree that C can be much cleaner when used correctly, but it's more difficult to use correctly than C++.
>The grafting of OO onto procedural is unnatural and messy and
>results in a huge, awkward language
This couldn't be farther from the truth, any use of OO will result in more elegant and robust programs because of the nature of the OO paradigm. The problem is that grafting object oriented features on a base procedural language results in a larger and more complex language. It doesn't necessarily mean that the language will be messy and awkward, just so full of features that it becomes difficult to learn all aspects.
A relatively bright person can learn the syntax of the entire C language in about a week, I've been programming with C++ for 4 years and still haven't learned the complete syntax. A C programmer can count on using everything the language has to offer on almost a daily basis, but most C++ programmers don't even know certain features even exist in the language, much less use them daily.
>What does everyone else think?
I think an argument like that is fruitless. If one language works better than another in some situations, that is the language to use. Whether or not a so-called OO language is actually OO is beside the point, they are simply tools that are utilized when they work best for the task at hand.
In some cases C++ is easier to look at, but only if formatted in a pleasing manner. The syntax most of the time is also more intuitive and easier to understand for those who don't know the language. Operating systems should be written to be as solid and quick as possible, so C and assembly are definitely contenders. However, I have it on good authority that Windows was written in a combination of C++, assembly, and VB. When to use C and when to use C++ really depends on what you are trying to accomplish and how. Both languages will be able to reach the same result in about the same length of code, but in different ways.Well I have a book on C and 1 in C++, and I'm taking a class in C++. C++ is *Much* easier to look at. It just seems cleaner to read, but that's an opinion. I guess if you want to write an os, forget C++, go C and/or ASM. That's the only reason I see to use C. But I think C is a better language because classes really suck. Well, maybe not, cause overloading I think is not in C. But I could be wrong.
Classes are useful as containers for like information, they also have the ability to have functions that act on that information, which is immensely useful. The only purpose the C++ class serves is to pretend to be more OO than it is since the C++ struct has exactly the same functionality, the only difference is what the default access level is.
-Prelude
My best code is written with the delete key.
Well anyone that has ever had to do the STUPID marine biology case study knows that classes can be retarded, inefficient, waaaaay too complex, and completely unnecessary.
>I would recommend learning C before moving on to C++. C is
>much closer to the machine than C++ is, and helps you
>understand programming better.
Why does C help you understand programming better? Since it is closer to the machine?
Programming is a concept and should be language independent. There are many kinds of programming: procedural, object oriented, functional.
I don't see why someone should learn C before C++. C++ is an extension to C. In C++ it's also possible to do procedural programming.
>Also, C is much stricter, and will enforce good programming
>practice. e.g:declaring variables in the beginning of the relevant
>block.
C offers the possibilities to mess with pointers and do unstructured programming.
>In my opinion*prepares to get flamed* C is a much cleaner
>language than C++.
What do you mean with: cleaner?
>The grafting of OO onto procedural is unnatural and messy and
>results in a huge, awkward language, especially when
>compared to an OO language such as smalltalk.
OO is very natural. When thinking about the world that surrounds us, where thinking in terms of objects. When controlling an electromotor, the electromotor can be seen as an object. When keeping records for books in a library, each book can be seen as an object. I don't say that procedural isn't natural, it's both natural.
" If one language works better than another in some situations, that is the language to use."
Aside from getting max speed, in what situations are you better off programming in C rather than C++?.
"Well anyone that has ever had to do the STUPID marine biology case study knows that classes can be retarded, inefficient, waaaaay too complex, and completely unnecessary."
The case study isn't that bad. Have you designed a program of comparable size?
>Programming is a concept and should be language independent. >There are many kinds of programming: procedural,object >oriented,functional.
Thank you. Very interesting and relevant.
>I don't see why someone should learn C before C++. C++ is an >extension to C. In C++ it's also possible to do procedural >programming.
Also interesting. What's your point? In almost every language one can do procedural programming.
>C offers the possibilities to mess with pointers and do >unstructured programming.
As does C++, but C is more punishing,therefore the programmer learns faster not to make mistakes.
>What do you mean with:cleaner?
Hmmm...Does easier to read, more aesthetically pleasing come to mind?
>OO is very natural. When thinking about the world that >surrounds us, where thinking in terms of objects. When >controlling an electromotor, the electromotor can be seen as an >object. When keeping records for books in a library, each book >can be seen as an object. I don't say that procedural isn't >natural, it's both natural.
Read the part you quoted again. I didn't OO was not natural. I said the combination wasnt natural. (Thanks to whoever pointed out that when used correctly it could be elegant, which I'm still not convinced of, but anyways, it makes it much easier to produce inelegant programs.) Learn how to read.
>This couldn't be farther from the truth, any use of OO will result >in more elegant and robust programs because of the nature of >the OO paradigm.
completely unwarranted statement. True or not, the logical jump is absurd. Explain how the OO paradigm results in "more complex and elegant programs."
<Aside from getting max speed, in what situations are you better <off programming in C rather than C++?.
How many useful open source projects are there written in C++? When you plan to develop a project open source, if you use C++ chances are you won't find a lot of willing partners.
Was there ever a better reason to stick to straight C when ever possible?Originally posted by Prelude
> However, I have it on good authority that Windows was written in a combination of C++, assembly, and VB.
"Christ died for our sins. Dare we make his martyrdom meaningless by not committing them?"
>Also interesting. What's your point? In almost every language
>one can do procedural programming.
Very interesting. Though there are many languages in which you can't.
My point is that one should learn programming first, instead of learning languages.
>As does C++, but C is more punishing,therefore the programmer
>learns faster not to make mistakes.
Really?
>Hmmm...Does easier to read, more aesthetically pleasing come
>to mind?
Well, if that's your definition of cleaner, I disagree. Writing clean code is language independent but depends on the programmer who writes the code.
>Learn how to read.
Thanks. I will.
>This couldn't be farther from the truth, any use of OO will result >in more elegant and robust programs because of the nature of >the OO paradigm.
Also procedural and functional programs can be very elegant en very robust. The robustness and elegance of a program depends on the ability of the programmer/designer to design and write robust and elegant programs.
>How many useful open source projects are there written in
>C++?
So the use of C++ in open source projects tells about the usefulness of C++?
Many commercial software, in a wide range of applications, are writtin in C++ and Java these days. Just a few examples: cars, mobile phones, smart cards etc., they use C++ and Java these days.
As so many engineers choose C++ as language for their systems, I wouldn't say C++ isn't useful.
Well when your programming for game boy you have to use C because the creators of the device that converts your executables to cartrages can only support C or asm, because C++ supposedly is too big
the thing that bugs me about OOP is that it is somewhat confusing converting a list of instructions into objects and i like to have a clear idea of exactly what i'm telling the computer to do. Also I like to keep my variables separate from my functions.
>> However, I have it on good authority that Windows was written in a combination of C++, assembly, and VB.
>> Was there ever a better reason to stick to straight C whenever possible?
heh heh argument over, learn c
All spelling mistakes, syntatical errors and stupid comments are intentional.