Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13
Am I missing something, or do you absolutely have to use C++ for KDE and Xfce programming? I read on KDE's site that you need to know C++. I guess ...
  1. #1
    Banned
    Join Date
    Jun 2009
    Posts
    68

    Thumbs down Only C++ for KDE/Xfce

    Am I missing something, or do you absolutely have to use C++ for KDE and Xfce programming? I read on KDE's site that you need to know C++. I guess there's no way around it. I am getting better with C, and I'm disappointed that it's not a good language for GUI programming unless you program for GNOME. I didn't really want to use PERL/Tk for GUI or anything. I don't understand ...

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    KDE is built using the Qt GUI tools and C++ class libraries. To do effective KDE programming you need to learn how to use Qt from Trolltech (now owned by Nokia). It is an open source GPL'd development kit for KDE and general cross-platform GUI applications. It supports Linux, Windows, and I think OSX amongst other operating systems.

    If you are getting comfortable with C, then C++ won't be too bad to learn. Consider it C with classes. Yes there are a lot of details to the language, but there are a number of good books to learn solid programming elements and style for C++. Personally, for complex systems level programming I prefer C++ to other languages, but then I have well over 15 years of professional experience with it.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Banned
    Join Date
    Jun 2009
    Posts
    68
    Stroustrup: FAQ
    Bjarne Stroustrup says the following:
    C is better than C++ for small projects, right?
    Not in my opinion. I never saw a project for which C was better than C++ for any reason but the lack of a good C++ compiler.

    and this also:
    I have never seen a program that could be expressed better in C than in C++ (and I don't think such a program could exist - every construct in C has an obvious C++ equivalent). However, there still exist a few environments where the support for C++ is so weak that there is an advantage to using C instead.

    If true, why is C used by so many professionals so often? I find it hard to believe that a large amount of people think this way.

  4. #4
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The concepts of encapsulation, inheritance, polymorphism provide the underpinnings that allow software systems to better model the real world. These can be accomplished with languages such as C, but not easily. Before I knew about C++ I was coding complex systems in C using these concepts, and the results were robust systems that are still in use today over 20 years later. However, what I was able to accomplish with C++ between 1992 and today would have been, I am convinced, quite impossible with a lesser language.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  5. #5
    Linux Enthusiast meton_magis's Avatar
    Join Date
    Oct 2006
    Location
    arizona
    Posts
    665
    I do have to add, that although C++ == C with classes is MOSTLY acurate, it leads to a very bad mentality that several books are sold with. If you choose to learn c++ (which I would highly suggest, there is no advantage to using C over C++ IMO) do not aproach it as C with classes. You have to REALLY learn classes AND the stl to know what's going on.

    if you are looking for books, I was suggested these 3, and they have proven to be VERY good.
    (note I like to amazon to show you the books, not to recomend you purchase from amazon.

    Amazon.com: C++ Primer (4th Edition): Stanley B. Lippman, Josée Lajoie, Barbara E. Moo: Books

    Amazon.com: The C++ Standard Library: A Tutorial and Reference: Nicolai M. Josuttis: Books

    Amazon.com: The C++ Programming Language: Special Edition (3rd Edition): Bjarne Stroustrup: Books

    If a book starts off with "C++ is C with classes" I'd put it down and move on.
    New to the internet, technical forums, or the hacker / open source community??
    Read this to learn good posting habits http://www.catb.org/~esr/faqs/smart-questions.html

    RHCE for RHEL version 5
    RHCT for RHEL version 4

  6. #6
    Banned
    Join Date
    Jun 2009
    Posts
    68
    That seems like a very good selection of books.

  7. #7
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    I also swear by Stroustrup and Ellis "The Annotated C++ Reference Manual", ANSI edition. They get into a lot of the why's and wherefor's that are often glossed over by other writers. In any case, the suggested titles are all very good.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #8
    Banned
    Join Date
    Jun 2009
    Posts
    68
    I would think the why's and wherefore's of C++ have changed some if you get into the details, since 1990 ... ?

  9. #9
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
    Posts
    8,974
    The ANSI version is from after the C++ standard was adopted later in the 90's. You are thinking of the original Annotated C++ Reference Manual, which was prior to that. The revised version deals with STL and all that other good cruft.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  10. #10
    Linux Newbie tetsujin's Avatar
    Join Date
    Oct 2008
    Posts
    115
    Quote Originally Posted by nopycckn View Post
    Stroustrup: FAQ
    Bjarne Stroustrup says the following:
    C is better than C++ for small projects, right?
    Not in my opinion. I never saw a project for which C was better than C++ for any reason but the lack of a good C++ compiler.

    and this also:
    I have never seen a program that could be expressed better in C than in C++ (and I don't think such a program could exist - every construct in C has an obvious C++ equivalent). However, there still exist a few environments where the support for C++ is so weak that there is an advantage to using C instead.

    If true, why is C used by so many professionals so often? I find it hard to believe that a large amount of people think this way.
    C++ provides organizational frameworks and abstractions that C lacks - there is sometimes a tradeoff in terms of the clarity of the resulting program. In C, if you see a function call, it's easy to tell exactly what function is being called. In C++, due to overloading and templates, as well as namespaces (both the "namespace" namespaces and the class namespaces used for object methods) it is not so easy sometimes. This is one of the reasons why I think a lot of people tend to favor C - it is very straightforward in terms of what a piece of code means.

    That said, C++ can be a powerful tool if you use it right.

Page 1 of 2 1 2 LastLast

Posting Permissions

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