Thread: Why learn C?

  1. #16
    Meow Pendragon's Avatar
    Join Date
    Sep 2001
    Location
    Swindon, UK
    Posts
    723
    Betaz*E*p
    Shaaa.... not if they are the rubber variety!
    Wouldn't they then melt in the course of their duty??

  2. #17
    Unregistered
    Guest
    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.

  3. #18
    Registered User
    Join Date
    Aug 2001
    Location
    computers/ theatre, travelingstudentL>- Northern California NativeNorthern California3D&Tie-DyeStudent1>. Admirer of C Bangalore Net surfingTeacher >/ >0 nagpurteaching >1  >2
    Posts
    61
    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?

    (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.)

  4. #19
    Seņor Member
    Join Date
    Jan 2002
    Posts
    560
    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.

  5. #20
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >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.

    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.
    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.

    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.

  6. #21
    Seņor Member
    Join Date
    Jan 2002
    Posts
    560
    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.

  7. #22
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >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.

  8. #23
    The Earth is not flat. Clyde's Avatar
    Join Date
    Mar 2002
    Posts
    1,403
    " 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++?.

  9. #24
    geek SilentStrike's Avatar
    Join Date
    Aug 2001
    Location
    NJ
    Posts
    1,141
    "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?
    Prove you can code in C++ or C# at TopCoder, referrer rrenaud
    Read my livejournal

  10. #25
    Unregistered
    Guest
    >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.

  11. #26
    Registered User
    Join Date
    Nov 2001
    Posts
    202
    Originally posted by Prelude
    > 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 when ever possible?
    "Christ died for our sins. Dare we make his martyrdom meaningless by not committing them?"

  12. #27
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,380
    >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.

  13. #28
    "The Oldest Member Here" Xterria's Avatar
    Join Date
    Sep 2001
    Location
    Buffalo, NY
    Posts
    1,039
    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

  14. #29
    bobish
    Guest
    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.

  15. #30
    Registered User C_Coder's Avatar
    Join Date
    Oct 2001
    Posts
    522
    >> 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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Am I too late to learn programming?
    By maccat in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 02-17-2009, 08:49 AM
  2. Looking to learn C++
    By Fuzzy91 in forum C++ Programming
    Replies: 40
    Last Post: 04-13-2006, 02:38 AM
  3. Can you actually learn c++ in 21 days?
    By Raeliean in forum C++ Programming
    Replies: 14
    Last Post: 07-27-2005, 03:41 PM
  4. You have to learn C in order to learn C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 20
    Last Post: 07-16-2004, 10:33 AM
  5. Witch to learn first?
    By Unregistered in forum Windows Programming
    Replies: 2
    Last Post: 06-17-2002, 12:06 AM