Completely OOP

This is a discussion on Completely OOP within the C# Programming forums, part of the General Programming Boards category; Why would one want to make everything completely OOP. Wouldn't it slow down the execution big time. Even C++ is ...

  1. #1
    ¡Amo fútbol!
    Join Date
    Dec 2001
    Posts
    2,136

    Completely OOP

    Why would one want to make everything completely OOP. Wouldn't it slow down the execution big time. Even C++ is slower than C so would C# be even slower? Also, since I come from a C++ background, what is the point of putting main in a class?

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    >Why would one want to make everything completely OOP.

    Software maintainability. Object oriented software is easier to maintain then procedural software. So the costs of maintainment are lower and less time needs to be spend on maintaining the software.

    >Wouldn't it slow down the execution big time.

    The speed of software doesn't depend very much on the used language, C or C++, but most on the used algorithms.

    >Also, since I come from a C++ background, what is the point of
    >putting main in a class?

    I'm from a C background and having a main as an seperate function looks quite procedural to me. If you want everything to be an object, then there shouldn't be seperate functions. I don't know if that's the true reason, its my personal opinion.

  3. #3
    Unregistered
    Guest
    As mentioned OOP has advantages relating to design such as code reusability, integration and testing classes. Many also find that OOP design is more stable than design based on algorithms. Features added to programs cause more substantial loss of form in procedural design as compared to OOP design. It is easier to add and remove OOP components working in an environment that supports encapsulation. It is also easier to refactor OOP programs.

    In .net the main fuction is static and like any language serves as the point of entry.

    Since everything is an object they are able to use a common type system in .net for all the languages. The langauge semantics offer some uniqueness I hear, but overall they are equivalent, so basicall everything being an object facilitates the goal of having a managed codebase. The framework itself offers a higher level of abstraction and compatibility across languages and platforms.

    The are using the .net framework and IL for embedded systems. It's a lightweight version of the framework. The speed of execution is obviously not an issue, but in these embedded systems the real issue has more to do with memory conservation.

  4. #4
    Registered User
    Join Date
    Mar 2002
    Posts
    23
    C++ is slower than C in only some ways. OOP will no doubt be slower than regular procedural/functional calls just because it causes a bit more of an overhead. If you code in C++ using C syntax(such as using structs only) it can be of the same speed. C# is no doubt going to be slower than C++/C, just look at java. Remember C# is supposed to be cross platform.. so giving up a little bit of speed is one of those things you have to sacrifice.

  5. #5
    Unregistered
    Guest
    >C++ is slower than C in only some ways. OOP will no doubt be
    >slower than regular procedural/functional calls just because it
    >causes a bit more of an overhead.

    The only thing that makes OOP "slow" is polymorphism because of the virtual table (and its not really as slow as people like to imagine). Just declaring classes and such is no slower than "normal" function calls.

    >Why would one want to make everything completely OOP.
    >Wouldn't it slow down the execution big time.

    The reason C# and Java are slower is because they're interpreted, not their OOness. The reason C++ code was slower than C had more to do with the language being newer and so the compilers weren't as optimized than it being OO.

    >The speed of software doesn't depend very much on the used
    >language, C or C++, but most on the used algorithms.

    I agree.

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, 03:02 AM
  2. Should OOP be any new language priority??
    By Hussain Hani in forum General Discussions
    Replies: 80
    Last Post: 06-13-2009, 11: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, 05:28 PM
  5. OOP Theory Question
    By Zeusbwr in forum C++ Programming
    Replies: 2
    Last Post: 10-30-2005, 08:37 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21