Results 1 to 9 of 9

Thread: Why C++?

  1. #1
    Join Date
    Apr 2007
    Posts
    33
    Thanks
    21
    Qt products
    Qt4
    Platforms
    Windows

    Question Why C++?

    Obvious by my posts I am an absolute beginner in OO programming. Back to school I solved my necessary computational tasks all by MATLAB. When I started working in an institute I understood not being able to use Visual C++ is like being an amputee (at least there). If something was about simulation or theory thing then MATLAB sufficed but if I wanted to do something practical then I needed C++ or MFC or something like that! That's why I am trying to learn Qt. But still there is a big question mark for me. Why C++?
    There are bunch of other languages out there, probably easier to learn and handle. What makes C++ the first choice at least in the field of sensing and control?
    I was reading this article today and was amazed and confused by the sentences from the founder of C++.http://members.safe-t.net/jwalker/pr...interview.html
    Was he joking?

    Regards,
    Last edited by Masih; 24th July 2007 at 04:26. Reason: spelling error

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    Well, that interview is on the internet for some time and most likely not true.
    It's somebody's lame attempt to bring down not only C++ but object oriented programming also.

    It's probably one of those narrow minded assholes who never managed to understand c++ or oop, and he does a lot of hard core programming in .NET.

    Or it was simply a joke...

    Either way, Qt is written in C++ because it is . I can't give you the real reason. Probably because C++ is very flexible and allowed the framework to reach the point where it is today.

    Regards

  3. #3
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Why C++?

    C++ has its advantages.

    • It's compiled, not interpreted. This is faster at runtime.
    • It has OOP, which is a big plus when working on bigger projects. (And I use it whenever I can.)
    • It's still mostly backwards compatible with C, which is handy for most veterans.
    • It's supported everywhere. There are many programmers with experience. It has libraries like Qt. So it's practical at the moment.

    Java has other ups and downs but is, in my opinion, on the same level as C++. I think both are dated when it comes to software engineering. It's mostly because of the vast support that they are so popular.

    A better language is D, for example. But it doesn't have things like Qt.
    Last edited by Michiel; 24th July 2007 at 18:09. Reason: spelling error
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    Quote Originally Posted by Michiel View Post
    A better language is D, for example. But it doesn't have things like Qt.
    AFAIR there were some attempts in that matter, but I don't know the outcomes. It would be very nice to have D bindings for Qt, as it is a very interesting language. Maybe we should do something about it?

  5. #5
    Join Date
    Mar 2006
    Location
    The Netherlands
    Posts
    300
    Thanks
    9
    Thanked 29 Times in 29 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Why C++?

    I suspect it wasn't very practical until recently, when version 1 of D was released. Before that, the language was constantly changing.

    I'd love to help, but I don't have experience in these matters. I have no idea how the Java bindings were created, for example. But if you're going to make a project of it, count me in. I want to learn.

    I wonder which of D's advanced features we could actually use. D has support for user-defined class properties, for example.

    The first step would be to find out what progress has been made. No use starting from scratch if people are already working on it.
    Last edited by Michiel; 24th July 2007 at 18:21.
    "The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry

  6. #6
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    AFAIK some guys are working on a similar binding for C#... It has nothing to do with D except that, both being C-like their code structure are very similar which could do the trick : these guys use a tool of their own to auto-generate headers for their C# wrapper from Qt headers! As for the real implementation I understood that they were trying to reduce every function call to a single one but I must have missed something since that wouldn't allow objects to be used easily...
    Current Qt projects : QCodeEdit, RotiDeCode

  7. #7
    Join Date
    Jan 2006
    Location
    Athens - Greece
    Posts
    219
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    The only way to go that seems viable in all the discussions I 've followed around is to check how Jambi does it for ideas. The main problems for wrapping the C++ implementation is the lack of support for C++ headers in the D language (you can use C headers) and all the preprocessor magic of Qt.
    The last time I checked Qt# was wrapping the QtC (the C binding for Qt) and there were thoughts of wrapping that one for D but I think this is old news.
    I am also interested in such a wrapping (who wouldn't be I guess?). For now I 'm avoiding C++ by using PyQt. Jacek do you have anything in mind? I would help although I 'd prefer it if automagically such a binding was announced :-).
    As for the original question in this thread I 'd say don't use C++ if you don't have to, use one of the many bindings to more productive languages (python, ruby). As for Trolltech for me they made the right decision in using C++ as it can be extended to more productive languages (such as ruby or python) and they can use the most powerful language to provide the best available gui toolkit around. This of course comes with the cost that they have to hire the best developers around to keep such a toolkit in good shape but since they 're paying the bill I 'm happy with it.
    I love deadlines. I like the whooshing sound they make as they fly by.
    --
    Douglas Adams

  8. #8
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    Quote Originally Posted by jacek View Post
    AFAIR there were some attempts in that matter, but I don't know the outcomes. It would be very nice to have D bindings for Qt, as it is a very interesting language. Maybe we should do something about it?
    I'm in too!

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Why C++?

    Quote Originally Posted by yop View Post
    I 'd prefer it if automagically such a binding was announced :-).
    Well, that's what everybody count for.

    If Jambi generator sources are available, we could take a look and see whether we can make it emit D code and use QtC, but I think that the biggest problem is how to make Qt/D API blend naturally with D and how to replace moc, uic and rcc.

    Quote Originally Posted by yop View Post
    As for Trolltech for me they made the right decision in using C++ as it can be extended to more productive languages (such as ruby or python) and they can use the most powerful language to provide the best available gui toolkit around.
    Also there wasn't much choice at the time they started planning Qt.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.