Find the answer to your Linux question:
Results 1 to 6 of 6
Hi all, why in system side programming we mostly use C. C++ is just superset of C and supports all C functions.and it also has oops. Even if you want ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,763

    Question C Vs C++


    Hi all,
    why in system side programming we mostly use C.
    C++ is just superset of C and supports all C functions.and it also has oops.
    Even if you want C codes ,you can use them within C++.
    Do we have any file system or other system programs written in C++?
    Thx.
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  2. #2
    Linux Newbie burntfuse's Avatar
    Join Date
    Nov 2006
    Location
    Laurel, MD
    Posts
    158
    It's sort of to enforce simplicity - you wouldn't want classes or C++ error handling in an operating system's kernel, so why use a language that includes them when one without will do just as well? C++ is great for application-level stuff, but for system programming its extra features just really aren't needed, and you want to keep tight control over memory management, hardware, basically everything that's going on behind the scenes. At least that's the way I see it...
    I have sold my soul to the penguin

  3. #3
    Banned jan1024188's Avatar
    Join Date
    Jul 2006
    Location
    EU, SLOVENIA
    Posts
    1,549
    MHM...I agree. C is good enaugh for building kernel.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,763

    Exclamation

    Quote Originally Posted by burntfuse
    but for system programming its extra features just really aren't needed
    This where i still got some doubts,when C++ provides extrax features ,you might use them in future....it also allows usage of C codes.then, is it correct to say,
    C offers free form of coding than c++...so we chose to ignore C++ ??
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

  6. #5
    Linux Newbie burntfuse's Avatar
    Join Date
    Nov 2006
    Location
    Laurel, MD
    Posts
    158
    Those features just really aren't ever going to be used in the kernel, though, and they shouldn't - the kernel should (as I said before) keep a tight reign on what's happening behind the scenes, since it's working at the lowest level. If you used C++, then people might start using vectors and other crap where they don't belong. Using C++ for the kernel where it only needs C is sort of like writing some simple code for a PIC (which should be in assembly) with the inline assembly directives in C.
    I have sold my soul to the penguin

  7. #6
    Linux Guru Lakshmipathi's Avatar
    Join Date
    Sep 2006
    Location
    3rd rock from sun - Often seen near moon
    Posts
    1,763

    Smile

    Thanks all for your clarification bye....
    First they ignore you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
    -----
    FOSS India Award winning ext3fs Undelete tool www.giis.co.in. Online Linux Terminal http://www.webminal.org

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •