Thread: C vrs OOP

  1. #16
    Amazingly beautiful user.
    Join Date
    Jul 2005
    Location
    If you knew I'd have to kill you
    Posts
    254
    Sorry, I knew that C has portability over ASM, but even if there was an assembly type language, with universal opcodes such as JMP and CMP, and some sort of portable memory model, etc., I'd say that C would be a large step up over the "OPERATOR operand, operand" format, despite the fact that anything implementable in C would be implementable in said language.

    I do remember there being a portable ASM, called Linoleum, but I have yet to examine it.
    Programming Your Mom. http://www.dandongs.com/

  2. #17
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Sure, I'll write code in C unless it's impossible (such as context switch code or using instructions that can't be generated by the compiler for some reason - e.g. VMRUN instruction for Xen in "entry.S" - which was the last time I did some major assembler work).

    But it still doesn't mean that assembler isn't a language.

    The whole idea of a higher level language is of course that you can express things in a more abstrac way: a = (b + c) * (d - e) is much easier way than doing the same in assembly code, for sure. I'm not arguing against that. And in some languages, that may also mean that you take a bunch of arrays and do the corresponding math on it.

    --
    Mats

  3. #18
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    C is not just high level assembly. C introduces some high-level concepts foreign to assembly such as scope and structured control flow. I believe we just take it for granted because this stuff was all 'invented' over 20 years ago (computing antiquity!).
    Callou collei we'll code the way
    Of prime numbers and pings!

  4. #19
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    The following paper gives, IMO, a pretty good glimpse at how different 'thinking in C' is from how people were thinking beforehand.
    http://pplab.snu.ac.kr/courses/adv_p...p261-knuth.pdf
    Callou collei we'll code the way
    Of prime numbers and pings!

  5. #20
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    It was not my intention to say "C is a giant Macro Assembler", but rather to say that anything that translates from human readable "language" into machine code IS a language.

    Language constructs such as "struct", "union", "while", "for", "do - while" and "switch" are very useful to describe what you want done in an easy to understand way (to other readers - or oneself later on). Of course, if all of those keywords are necessary to qualify asa language, then none of Cobol, Fortran or Lisp would qualify as "languages" (in it their traditional shape - more recent versions may even support "Object Orientation" - although I, too, agree that object orientation and languages are two separate subject, although some languages are better at implicitly supporting object orientation than others) .

    --
    Mats

  6. #21
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,743
    I don't want to spoil the thread or anything, but shouldn't it be "Revolutionary" and not "Revolutional"? I don't think "Revolutional" is even a word.
    My Website

    "Circular logic is good because it is."

  7. #22
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    It never ceases to amaze me how ostentatious nerds can be about mundane things.

  8. #23
    Registered User
    Join Date
    Sep 2001
    Posts
    752
    Quote Originally Posted by BMJ View Post
    It never ceases to amaze me how ostentatious nerds can be about mundane things.
    Ahhh, crapping all over native tongue... can't take it....
    Callou collei we'll code the way
    Of prime numbers and pings!

  9. #24
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    I can't believe we are arguing about C and C++. And, no, revolutional is not a word.

  10. #25
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    It's not C over C++ now. I think it's OOP over non-OOP... but then and again I may be wrong. Maxorator entertains me so much I forget to listen.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #26
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    I lika de OOP.

  12. #27
    Officially An Architect brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,396
    OOP is MUCH more than simply syntax. The C++ version:

    Code:
    object->do_it();
    And the C version:

    Code:
    do_it(object);
    Can BOTH be viewed as "object oriented." C++ just uses a different syntax which makes it more apparent that the object is the important concept. C focuses on the function, not the object.

    Pointing to the method call syntax as the most salient difference between C and C++ misses the point entirely.

    The real advantage of C++ is the ability to easily derive from classes to create new classes. You can do this in C, but you have to do it manually. Also, you can easily implement polymorphic classes using virtual functions. Again, in C you can do it, but you have to do it manually. Further, C++ supports templates, which in MY opinion are the most valuable piece of the entire language.

    Templates, inheritance, polymorphism, and exceptions work together to give you a language that simply WORKS DIFFERENTLY that C. It encourages a different way of thinking about the problems.

  13. #28
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    *erased*

    brewbuck said it well enough. :-)

    It encourages a different way of thinking about the problems.
    Last edited by simpleid; 08-17-2007 at 12:41 PM.

  14. #29
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    Object oriented programming (don't know why people here are capitalizing it the way the Bible capitalizes The Lord) is wonderful if all you've been exposed to beforehand is C or Pascal.
    There are 10 types of people in this world, those who cringed when reading the beginning of this sentence and those who salivated to how superior they are for understanding something as simple as binary.

  15. #30
    Registered User
    Join Date
    Jul 2006
    Posts
    162
    Object oriented programming (don't know why people here are capitalizing it the way the Bible capitalizes The Lord) is wonderful if all you've been exposed to beforehand is C or Pascal.
    OOP isn't any different in concept based on your exposure to languages, and your connection of an acronym to religion is absurd...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. OOP flu
    By Hussain Hani in forum General Discussions
    Replies: 15
    Last Post: 06-27-2009, 02:02 AM
  2. Should OOP be any new language priority??
    By Hussain Hani in forum General Discussions
    Replies: 80
    Last Post: 06-13-2009, 10:56 AM
  3. Data Mapping and Moving Relationships
    By Mario F. in forum Tech Board
    Replies: 7
    Last Post: 12-14-2006, 10:32 AM
  4. recommendation for a good OOP book
    By Mario F. in forum C++ Programming
    Replies: 2
    Last Post: 06-15-2006, 04:28 PM
  5. OOP Theory Question
    By Zeusbwr in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2005, 08:37 AM