C++ Embraces Procedural Programming Over OO Programming - Programming Languages

This is a discussion on C++ Embraces Procedural Programming Over OO Programming - Programming Languages ; If one desires to write a program using the OO "paradigm", they can only fake it in C++ because it has no inherent support for it from the onset, C++ only supports the procedural technique of C which is main(). ...

+ Reply to Thread
Page 1 of 14 1 2 3 11 ... LastLast
Results 1 to 10 of 138

C++ Embraces Procedural Programming Over OO Programming

  1. Default C++ Embraces Procedural Programming Over OO Programming

    If one desires to write a program using the OO "paradigm", they can
    only fake it in C++ because it has no inherent support for it from the
    onset, C++ only supports the procedural technique of C which is main().
    Various techniques of hiding this blemish have been concocted by
    frameworks over the years. You'd think that with all that desire to do
    something OO from the onset (program initiation), an alternative approach
    to handle program that would have been supported by now: a 'Program'
    class or something. Becauset here isn't something like a 'Program' class,
    it kinda says that OO/classes aren't as "good" (for some reason) as
    procedural C and functions.

    Is C++ saying that procedural is better than OO? It seems so.

    Tony

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  2. Default Re: C++ Embraces Procedural Programming Over OO Programming

    * Tony:[color=blue]
    >
    > Is C++ saying that procedural is better than OO?[/color]

    I may be blind, but I fail to see the connection to the C++ standard.

    --
    A: Because it messes up the order in which people normally read text.
    Q: Why is it such a bad thing?
    A: Top-posting.
    Q: What is the most annoying thing on usenet and in e-mail?

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  3. Default Re: C++ Embraces Procedural Programming Over OO Programming

    In article <Vhr7h.11912$yl4.9799@newssvr12.news.prodigy.com>, Tony
    <rdnewsNOSPAM2006@sbcglobal.net> wrote:
    [color=blue]
    > If one desires to write a program using the OO "paradigm", they can
    > only fake it in C++ because it has no inherent support for it from the
    > onset, C++ only supports the procedural technique of C which is main().
    > Various techniques of hiding this blemish have been concocted by
    > frameworks over the years. You'd think that with all that desire to do
    > something OO from the onset (program initiation), an alternative approach
    > to handle program that would have been supported by now: a 'Program'
    > class or something. Becauset here isn't something like a 'Program' class,
    > it kinda says that OO/classes aren't as "good" (for some reason) as
    > procedural C and functions.
    >
    > Is C++ saying that procedural is better than OO? It seems so.
    >
    > Tony
    >[/color]
    What has this to do with the standardization of C++. But...

    C++ says it does not care what paradigm [classical OO,procedural,
    semi-functional, etc] but the lowest common denominator is a free
    function which is historically called main().

    No matter how you slice it, you must be able to write procedural code
    to access the inards of your OO classes, but you don't need classes to
    solve every problem.

    Not every car is a Ford, but every car has an engine

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  4. Default Re: C++ Embraces Procedural Programming Over OO Programming


    "Carl Barron" <cbarron413@adelphia.net> wrote in message
    news:171120061941223232%cbarron413@adelphia.net...[color=blue]
    > In article <Vhr7h.11912$yl4.9799@newssvr12.news.prodigy.com>, Tony
    > <rdnewsNOSPAM2006@sbcglobal.net> wrote:
    >[color=green]
    >> If one desires to write a program using the OO "paradigm", they can
    >> only fake it in C++ because it has no inherent support for it from the
    >> onset, C++ only supports the procedural technique of C which is main().
    >> Various techniques of hiding this blemish have been concocted by
    >> frameworks over the years. You'd think that with all that desire to do
    >> something OO from the onset (program initiation), an alternative approach
    >> to handle program that would have been supported by now: a 'Program'
    >> class or something. Becauset here isn't something like a 'Program' class,
    >> it kinda says that OO/classes aren't as "good" (for some reason) as
    >> procedural C and functions.
    >>
    >> Is C++ saying that procedural is better than OO? It seems so.
    >>
    >> Tony
    >>[/color]
    > What has this to do with the standardization of C++. But...
    >
    > C++ says it does not care what paradigm [classical OO,procedural,
    > semi-functional, etc] but the lowest common denominator is a free
    > function which is historically called main().[/color]

    That's a paradigm! One that doesn't seem consistent with OO. So, one can
    do procedural well with C++, but OO only half-baked. (?)
    [color=blue]
    >
    > No matter how you slice it, you must be able to write procedural code
    > to access the inards of your OO classes, but you don't need classes to
    > solve every problem.[/color]

    I tend to think in terms of things before I think about what those things
    do.
    So maybe the focus on behavior (functions) is putting the cart before the
    horse?

    Tony

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  5. Default Re: C++ Embraces Procedural Programming Over OO Programming


    ""Alf P. Steinbach"" <alfps@start.no> wrote in message
    news:4s70jeFu0gm3U1@mid.individual.net...[color=blue]
    >* Tony:[color=green]
    >>
    >> Is C++ saying that procedural is better than OO?[/color]
    >
    > I may be blind, but I fail to see the connection to the C++ standard.[/color]

    It's directly related: why is it like it is? How can it be better? Can it
    be better? To where will it evolve? Will it stagnate in its tracks for its
    attachment to backward compatibility (C)? What are the possibilities
    if some stuff is rethought, rearchitected or jettisoned?

    Tony

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  6. Default Re: C++ Embraces Procedural Programming Over OO Programming

    "Tony" wrote:[color=blue]
    > If one desires to write a program using the OO "paradigm", they can
    > only fake it in C++ because it has no inherent support for it from the
    > onset, C++ only supports the procedural technique of C which is main().
    > Various techniques of hiding this blemish have been concocted by
    > frameworks over the years. You'd think that with all that desire to do
    > something OO from the onset (program initiation), an alternative approach
    > to handle program that would have been supported by now: a 'Program'
    > class or something. Becauset here isn't something like a 'Program' class,
    > it kinda says that OO/classes aren't as "good" (for some reason) as
    > procedural C and functions.
    >
    > Is C++ saying that procedural is better than OO? It seems so.[/color]

    Historically, C++ started out as a modification of C; one of the key
    goals in the design of C is to maintain a certain amount of backwards
    compatiblity with C. No language with that goal can completely abandon
    procedural approaches, but C++ has gone just about as far as it can to
    embrace OO within that constraint. You can't go much further without
    making it a very different language; and if you're going to do that,
    there's not much point in calling it C++. If you want a language that
    is pure OO from the very beginning, use one; C++ isn't, and can't be,
    such a language.

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  7. Default Re: C++ Embraces Procedural Programming Over OO Programming

    I do not see why you posted such a thing in that forum, but I will try
    to answer your questions.

    Tony wrote:
    [color=blue]
    > If one desires to write a program using the OO "paradigm", they can
    > only fake it in C++ because it has no inherent support for it from the
    > onset[/color]

    Indeed, support for OOP in C++ isn't as extensive as in other
    programming languages.
    The main problem being the memory management. For a pure OOP design, you
    need garbage collection somewhere.
    But since C++ aims to be efficient, it lets you handle memory yourself.

    [color=blue]
    > C++ only supports the procedural technique of C which is main().[/color]

    Is it the fact that the entry point of the program is a function and not
    a member fonction of some obscure singleton what's troubling you?

    [color=blue]
    > Various techniques of hiding this blemish have been concocted by
    > frameworks over the years.[/color]

    I don't know what you're talking about.

    [color=blue]
    > You'd think that with all that desire to do
    > something OO from the onset (program initiation), an alternative approach
    > to handle program that would have been supported by now: a 'Program'
    > class or something. Becauset here isn't something like a 'Program' class,
    > it kinda says that OO/classes aren't as "good" (for some reason) as
    > procedural C and functions.[/color]

    There is no need to replace main with a program class or whatever.
    If you want one, just write it yourself.
    Stuff isn't added to the language unless it's actually useful.

    [color=blue]
    > Is C++ saying that procedural is better than OO? It seems so.[/color]

    C++ avoids to impose OOP.
    You shouldn't pay for what you don't use.

    As a general rule, genericity and object-based programming are often
    preferable to OOP.

    In C++, unlike Java, OOP is only used when needed and/or when it's relevant.

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  8. Default Re: C++ Embraces Procedural Programming Over OO Programming


    My penny..

    I write software for Investment banking companies. My core concern is
    in business domain and not C++ /Java / OO / procedural.
    [color=blue]
    > onset, C++ only supports the procedural technique of C which is main().[/color]
    I am not clear how existence of main() function suggest that C++ does
    not support OO.
    [color=blue]
    > Various techniques of hiding this blemish have been concocted by
    > frameworks over the years. You'd think that with all that desire to do
    > something OO from the onset (program initiation), an alternative approach
    > to handle program that would have been supported by now: a 'Program'
    > class or something. Becauset here isn't something like a 'Program' class,
    > it kinda says that OO/classes aren't as "good" (for some reason) as
    > procedural C and functions.[/color]

    I have seen 'C' developers first C++ code where he had a huge file
    and **everything** in one class. He called it OO because there as a
    class keyword in it. He could have done such so called OO work in ANY
    language. Because of this incidence, I cant conclude that NO language
    support OO.

    [color=blue]
    > Is C++ saying that procedural is better than OO? It seems so.[/color]

    IMHO, one should not be fanatic about OO. OO is excellent paradigm but
    is not solution to all the problems. There are many many many cases
    where a good mix of OO and procedural does the trick.

    C++ is just a tool to solve my business problem. It is NOT a solution.
    C++ should not (does not) decide or suggest OO / Procedural or mix of
    both.

    There is no paradigm which is better than another. What ever suites the
    requirement is the best.

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  9. Default Re: C++ Embraces Procedural Programming Over OO Programming

    In message <Vhr7h.11912$yl4.9799@newssvr12.news.prodigy.com>, Tony
    <rdnewsNOSPAM2006@sbcglobal.net> writes[color=blue]
    >If one desires to write a program using the OO "paradigm", they can
    >only fake it in C++ because it has no inherent support for it from the
    >onset, C++ only supports the procedural technique of C which is main().
    >Various techniques of hiding this blemish have been concocted by
    >frameworks over the years. You'd think that with all that desire to do
    >something OO from the onset (program initiation), an alternative approach
    >to handle program that would have been supported by now: a 'Program'
    >class or something. Becauset here isn't something like a 'Program' class,
    >it kinda says that OO/classes aren't as "good" (for some reason) as
    >procedural C and functions.
    >
    >Is C++ saying that procedural is better than OO? It seems so.[/color]

    I fail to see why the class *static* function MyClass.main (Java & C#)
    would be somehow superior to the free function ::main (C++).

    The programmer's code that must be run when the program starts execution
    and when it finishes execution must be written somewhere. Wrapping it
    inside a function definition is the tidy way to do it. Any additional
    wrapping is much more to do with avoiding special cases in the compiler
    than with OO or not OO.

    John
    --
    John Harris

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


  10. Default Re: C++ Embraces Procedural Programming Over OO Programming

    [email]rdnewsNOSPAM2006@sbcglobal.net[/email] ("Tony") writes:
    [color=blue]
    > So maybe the focus on behavior (functions) is putting the cart
    > before the horse?[/color]

    That's pretty funny. So much code (even C++ code) is all OO
    "framework goop" and no computation. Ultimately, what do we want from
    our programs? Computation, I hope. They have to *do* something.
    Isn't that the horse? Isn't the structure (OO) the cart?

    --
    Dave Abrahams
    Boost Consulting
    [url]www.boost-consulting.com[/url]

    ---
    [ comp.std.c++ is moderated. To submit articles, try just posting with ]
    [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
    [ --- Please see the FAQ before posting. --- ]
    [ FAQ: [url]http://www.comeaucomputing.com/csc/faq.html[/url] ]


+ Reply to Thread
Page 1 of 14 1 2 3 11 ... LastLast

Similar Threads

  1. Replies: 168
    Last Post: 10-21-2007, 08:00 PM
  2. Replies: 0
    Last Post: 09-11-2007, 04:10 AM
  3. Replies: 0
    Last Post: 09-11-2007, 12:10 AM