Results 1 to 19 of 19

Thread: How modern is C++ language used in Qt's API?

  1. #1
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default How modern is C++ language used in Qt's API?

    Hi

    I asked How modern is C++ language used in Qt? (http://stackoverflow.com/questions/846015/how-modern-is-c-language-used-in-qt) on StackOverflow.com

    If you have your opinion please write your answer to this question there.
    Thanks.
    Last edited by wysota; 29th May 2009 at 18:49. Reason: Removed url

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    write your answer to this question there
    Definitely not and please stop making such type of dumpy announcement for your(?) site...

  3. #3
    Join Date
    May 2009
    Posts
    147
    Thanks
    11
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How modern is C++ language used in Qt's API?

    I think, in addition to being a very good extensive framework, qt is somehow a wrapper for the c++ too!
    It has modernized c++'s use.
    and have an easily acceptable compromise (regarding performance/programming power/compatibility) in doing so.
    I think a new standard c++ can make it somewhat better, not a lot, since it already has implemented (by the API/Qt itself) much more than how much these standards modernize c++.

  4. #4
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by Lykurg View Post
    Definitely not and please stop making such type of dumpy announcement for your(?) site...
    It's not any kind of announcement and your replay is rude.
    As to site's owners - you can check yourself who they are if you're so suspicious

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    It doesn't matter if you are the owner of the site or not. Both threads you have posted in (making a total of 100% of your posts) is about that site (and nothing more) which is a bit suspicious.

    The question of yours is, sorry to say that, quite lame and speaks very badly of you and/or your programming skills which makes your posts even more suspicious - they do look like ads.

    I'm removing the links. If you prove yourself, I will bring them back.

    And to answer your question:
    Using modern C++ language in API makes it more robust, flexible and easier to use.
    This is completely false. Using non-approved standards makes the API less robust, less flexible and harder to use because there are more restrictions applied on the compiler thus there are fewer environments running compilers compliant to those would-be standards. "Newer standards" are (or should be) backwards compatible therefore if you really want to, you can build Qt with a compiler switched to something non-standard and it will (should) build fine. It wouldn't work the other way round. Qt uses modern solutions but only those that are pure C++. Thanks to that it's not a big problem to port it to yet another platform.

    And for your information - there is only one C++ standard, from 1998 (and updated five years later, but it's still the same standard). There is also C++0x which is a candidate for becoming a standard but thus far it's still in research. Being "too modern" already backfired once in C++ history - Microsoft released their Visual Studio 6 toolset a day before C++ standard was accepted which made VC6 non-compliant to C++ causing many problems to thousands of developers all over the world.

    http://en.wikipedia.org/wiki/C++0x
    http://en.wikipedia.org/wiki/Technical_Report_1
    http://en.wikipedia.org/wiki/ISO/IEC...guage_standard

    Cheers!


    By the way Qt is not a wrapper over C++.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    It's not any kind of announcement
    Ok, then I must admit that we have a fundamental different understanding of announcements.

    and your replay is rude.
    Well let's see and do some hermeneutic researches:

    Definitely not
    is telling you that I am not intending to answer your question on another board. That's my free decision. Can't see any rudeness in that. But one could say suggesting peoples - two times in two threads of total - to visit another page and answer there, which means catching peoples from one forum to another, is a little bit discourteous.

    and please stop making such type
    Notice the "please". It indicates that the following statement kindly request. What I have omitted is a "in future".

    of dumpy announcement
    Well, is "dumpy" rude. I don't think so, especially when you reconsider your first post. And even this one is a really short one with only one aim: move peoples to the mentioned site. Because there you have already a lot of answers and commentaries and no really need of more answers is visible.

    for your(?) site...
    To indicate that I am not sure if you the owner of the site (nic.com was not useful on that) i have put the (?). But because of your posts, it strongly seems so.

    So, reconsidering all these facts i came to the conclusion: No my answer wasn't rude. Maybe not the nicest one, but rude definitely not. Rude answers of mine look different.

    If you asking yourself, if this post now is rude, perhaps... (I'm not sure about it myself!)

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    Peace, people, peace :-) Make Qt, not war ;-)
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by wysota View Post
    Make Qt, not war ;-)
    You don't have to choose, you can make both! *harrrharrr*

    Attached Images Attached Images

  9. #9
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by wysota View Post
    It doesn't matter if you are the owner of the site or not. Both threads you have posted in (making a total of 100% of your posts) is about that site (and nothing more) which is a bit suspicious.
    I'm trying to bring attention of users of qt to qt question which I raised on very popular programming site. How is this suspicious? How is this a bad thing? Do you know the word collaboration?

    You are angry because I brought attention of qt users to a place where they can also help other qt users by answering their questions?
    When I send information about qt questions on stackoverflow to Henrik Hartz he was grateful not angry as you. You should learn from him...

    Quote Originally Posted by wysota View Post
    The question of yours is, sorry to say that, quite lame and speaks very badly of you and/or your programming skills which makes your posts even more suspicious - they do look like ads.
    I'm not even going to say how your answer speaks of you - readers of your post can judge this by themselves.

    Quote Originally Posted by wysota View Post
    I'm removing the links. If you prove yourself, I will bring them back.
    I could do this very easily because I live 30km from you but I won't because what you did and what you're saying is ridiculous to say the least.

    Quote Originally Posted by wysota View Post
    Using non-approved standards makes the API less robust (...)
    Who was talking about using non-approved standards?

    Quote Originally Posted by wysota View Post
    And for your information - there is only one C++ standard, from 1998 (and updated five years later, but it's still the same standard). There is also C++0x which is a candidate for becoming a standard but thus far it's still in research.
    Everyone at least remotely interested in C++ know these facts for years...

    Quote Originally Posted by wysota View Post
    Being "too modern" already backfired once in C++ history - Microsoft released their Visual Studio 6 toolset a day before C++ standard was accepted which made VC6 non-compliant to C++ causing many problems to thousands of developers all over the world.
    Pure nonsense. VC6 wasn't standard-compliant because MS didn't care about C++ standard at that time. When they did start to care years later they hired Herb.


    Cheers!

  10. #10
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by Lykurg View Post
    But one could say suggesting peoples - two times in two threads of total - to visit another page and answer there, which means catching peoples from one forum to another, is a little bit discourteous.
    I asked to answer my question there because I had already asked this question there in the first place.
    Besides on the mentioned site (I'm afraid if I can write it's name at all here) there are other Qt related questions which users of this site might want to answer and help others. I don't expect from you to understand this, however.

    If you think this forum is the only one under the sun it's really only your problem.
    If you want to pretend this forum is the only one by forbidding to even mention others you should read some Orwell's literature

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    I'm trying to bring attention of users of qt to qt question which I raised on very popular programming site. How is this suspicious?
    It's suspicious because you register to the site and in the first posts of yours you provide links to an external site asking for attention to it. There are policies on many sites that prevent fresh users from posting any links. We don't have such policy here but we're keeping an eye on any URL that appears on this site.

    How is this a bad thing?
    I think I already explained it but it's never enough to stress that preventing spam is much easier than fighting it.

    Do you know the word collaboration?
    Sorry, but accusing us of the lack of will of collaboration is ridiculous :-) If you want collaboration then start helping people. Once you do that, nobody will mind if you post a link or two, even if they consider them ads, "trafic rerouters" or pagerank stealing.

    You are angry because I brought attention of qt users to a place where they can also help other qt users by answering their questions?
    I'm not angry at all. You have a right to post links to any site you want. As long as this doesn't hurt users of this site, it is fine with me. You can see the links are still there, only that web spiders won't be picking them up.

    When I send information about qt questions on stackoverflow to Henrik Hartz he was grateful not angry as you. You should learn from him...
    Again, I'm not angry. I'm angry when someone forgets to use [code] tags despite earlier notifications from the staff. This is not the case here. If I'm angry about something in your post then it's the content of the question you asked because it's almost bound to inflict a flamewar (which I love, by the way) but not about pure fact of posting.

    I'm not even going to say how your answer speaks of you - readers of your post can judge this by themselves.
    Yes, I can be very direct in my posts. I'm also very radical, strict and conservative when it comes to programming. I'm aware of that but that's the way I am. But I'm also accepting criticism directed to myself. Just go to my thread about wwWidgets and criticize, I do deserve that because my laziness (or lack of time) once again proved its point.

    I could do this very easily because I live 30km from you but I won't because what you did and what you're saying is ridiculous to say the least.
    I think you misunderstood me. I meant you have to prove yourself on the forum by asking or answering questions about Qt, not visiting Warsaw and shaking my hand... If you want to shake my hand or tell me straight into my face what you think of me then I would strongly suggest you go to DevDays to Munich in October - it's a great event (fact or crap?) so even if I don't make it there and you don't have a chance to laugh into my face you will still enjoy it and it will be time well invested. Besides, you'll be able to ask Qt Software developers in person why they use so outdated concepts in their code.

    Who was talking about using non-approved standards?
    Considering the fact there is only one standard and you were speaking about something "modern" and "old" (so mentioning at least two distinctive things) then I guess I meant you. If I misunderstood you, then that's my fault, sorry. But then you should probably explain what you meant if you weren't talking about standards.

    Everyone at least remotely interested in C++ know these facts for years...
    So why make a FUDD about Qt using some "old" dialect of C++?

    Pure nonsense. VC6 wasn't standard-compliant because MS didn't care about C++ standard at that time.
    Ok, have it your way. Everyone has a right to his own opinion or interpretation of ones words. Still, I'm willing to comply that God doesn't play dice with the world.

    I'm very curious what you consider so old in Qt's API. Would you share your opinions with us? Because I always thought Trolls have used bleeding-edge concepts in their code, often working around broken compilers (mostly VC6 and Borland) to make them support their code for as long as possible.

    @Lykurg: You are killing me with your pictures :-)
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    I asked to answer my question there because I had already asked this question there in the first place.
    Philosophical/sophistical side thought: So you want that all answers are made on the initial board. Is that collaboration? Or is it just because you think that that is the only place under the sun where this question can be answered...

    Besides on the mentioned site (I'm afraid if I can write it's name at all here) there are other Qt related questions which users of this site might want to answer and help others. I don't expect from you to understand this, however.
    First you can speak about other sites here. No problem at all. Second, I understand much more than you might think...

    If you think this forum is the only one under the sun it's really only your problem.
    I don't think that way.

    If you want to pretend this forum is the only one by forbidding to even mention others you should read some Orwell's literature
    Instead of reading sophisticated literature and making name dropping afterwards you may should take some minutes and consider if maybe not the mention of other boards is the problem but more the way of your threads.

    Eventually a post starts like

    "I already asked this question at xyz but would be interested what you think about..."

    wouldn't had caused this reactions.


    I also would like to know how the people of stackoverflow had had react if a new member post two post where he suggest to go to another board to answer question there, without showing any interest (and help) on their own board. Unfortunately we won't figure it out...

  13. #13
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by wysota View Post
    @Lykurg: You are killing me with your pictures :-)
    According to my secret plan to take over the reign of that forum, that was the ambition But since you have recovered the conspiracy, I will desist from it.

    And yeah, sometime I have these rare moments of brilliant brilliancy that lead to those pictures... Sadly not often enough.

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    Besides on the mentioned site (I'm afraid if I can write it's name at all here)
    You mean stackoverflow.com?

    there are other Qt related questions which users of this site might want to answer and help others.
    The truth is we are hardly keeping up with answering the ones here.

    If you think this forum is the only one under the sun it's really only your problem.
    If you want to pretend this forum is the only one by forbidding to even mention others you should read some Orwell's literature
    It might be good for you to go back in history and find out why this site was established in the first place and where did the people who founded it migrate from.

    Quote Originally Posted by Lykurg View Post
    I also would like to know how the people of stackoverflow had had react if a new member post two post where he suggest to go to another board to answer question there, without showing any interest (and help) on their own board. Unfortunately we won't figure it out...
    We don't have to figure it out. This is crossposting and is very often considered spamming just by itself, regardless of the content. Especially now that we have so good search engines that crossposting doesn't improve "findability" of a problem.

    http://en.wikipedia.org/wiki/Crossposting

    Quote Originally Posted by Lykurg View Post
    According to my secret plan to take over the reign of that forum, that was the ambition But since you have recovered the conspiracy, I will desist from it.
    Better luck next time! By the way - you really don't want to rule here... Trust me.

    And yeah, sometime I have these rare moments of brilliant brilliancy that lead to those pictures... Sadly not often enough.
    Maybe one day we can compose a gallery from your art :]
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  15. #15
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by wysota View Post
    I'm very curious what you consider so old in Qt's API. Would you share your opinions with us?
    1. What about using plain pointers in API?
    2. What about not using exceptions to communicate errors?
    3. What does Qt do to support standard containers?
    Can I use standard container in every place I can use qt container?
    If the answer is not does qt provide adapters at least?
    (Bear in mind a string is a container, too.)
    4. What does Qt do to make it easy to use its containers with the rest of the Standard
    Library?
    Does Qt provide adapters so that I could use qt container in every place I can use a
    standard one?

    These are the things that come to mind when one uses any C++ library.

    5. Has anyone from Qt checked how much of moc could be implemented with features
    found in current standard?
    Has this been tried with features from upcomming standard?
    6. Is there any official document stating what's Trolltech/Nokia position with regard to
    using new language features?

    These are Qt specific questions.

    I'm sure I'll have more questions in the course of learning and using Qt.

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    1. What about using plain pointers in API?
    What's wrong with that? Nobody prevents you from wrapping them in some smart pointer classes provided you know what you are doing.

    2. What about not using exceptions to communicate errors?
    C++ exceptions suck.

    3. What does Qt do to support standard containers?
    If by "standard" you mean std::vector and family then Qt containers have conversion methods to and from STL counterparts.

    Can I use standard container in every place I can use qt container?
    No, because there are platforms without STL implementations (or with broken ones) so in those situations you have to use Qt containers. Apart from that Qt containers and STL containers are API compatible. Qt containers tend to be faster, though. And of course they have some methods STL ones don't, i.e. QString::split().

    If the answer is not does qt provide adapters at least?
    I guess I already answered that.

    (Bear in mind a string is a container, too.)
    QString::fromStdString(), QString::toStdString(), QString::fromStdWString(), QString::toStdWString(). Enough? Bear in mind std::string is not Unicode compatible so you might experience loss of functionality.

    4. What does Qt do to make it easy to use its containers with the rest of the Standard
    Library?
    You can use Qt containers with STL algorithms.

    Does Qt provide adapters so that I could use qt container in every place I can use a
    standard one?
    No, because they are compatible. No adapters are required.

    These are the things that come to mind when one uses any C++ library.
    I guess that's settled then.

    5. Has anyone from Qt checked how much of moc could be implemented with features
    found in current standard?
    Oh, this has already been argued - "use templates instead of moc". I can redirect you to the documentation, that's a big topic. Bottom line is moc gives you some benefits that wouldn't be possible with templates and you don't have to use moc if you don't want to - use Boost signals.

    Has this been tried with features from upcomming standard?
    This I have no chance of knowing but I guess the word "upcoming" says it all. I think once all supported platforms have compilers supporting C++1x (there is no way it's going to be called 0x, it's already 2009) we might return to the topic but now this is only academic talk bearing the fact C++1x is still fluctuating.

    6. Is there any official document stating what's Trolltech/Nokia position with regard to
    using new language features?
    I'm not aware of such document. If you're interested in it, I think contacting Matthias Ettrich would be the best way of answering your question.

    I'm sure I'll have more questions in the course of learning and using Qt.
    Please ask them, we'll try our best to answer them.

    Edit: by the way, C++1x (or 0x, whatever you want to call it) will not be any revolution compared to C++03. It will just make some things easier for developers but there will be no sense in rewriting code that is already written unless you have situations where the new standard will yield an execution performance boost. Again, nobody prevents you from using a C++0x compiler with Qt even now.
    Last edited by wysota; 30th May 2009 at 14:22.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #17
    Join Date
    May 2009
    Posts
    133
    Thanks
    10
    Thanked 4 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by wysota View Post
    What's wrong with that? Nobody prevents you from wrapping them in some smart pointer classes provided you know what you are doing.
    Good API doesn't return dangerous plain pointers waiting for its users to make the first mistake.

    Quote Originally Posted by wysota View Post
    C++ exceptions suck.
    Really. Where have you read this? Who made you think so?

    Quote Originally Posted by wysota View Post
    If by "standard" you mean std::vector and family then Qt containers have conversion methods to and from STL counterparts.
    At least.
    Better yet just use standard containers

    From Inside the Qt 4 Containers

    Implicit sharing is the main difference between QVector and STL's std::vector<T> class.


    That made me really laugh
    What have they been thinking?
    Something like Instead of combing two standard features lets make it even harder for users and create our own (better as always) moc-vector?


    Qt Code:
    1. template <typename T>
    2. typedef shared_ptr<std::vector<T>> QVector;
    To copy to clipboard, switch view to plain text mode 

    That would be too easy for users to use and too standard for Trolltech to even think of.


    Quote Originally Posted by wysota View Post
    No, because there are platforms without STL implementations (or with broken ones) so in those situations you have to use Qt containers.
    If you can implement Qt containers (which don't bring anything new besides yet another api) on such platforms you could have implemented STL ones in the first place...

    Quote Originally Posted by wysota View Post
    Qt containers tend to be faster, though.
    Yep, I'm sure they are much better than the ones written by several world class c++ specialists in the course of a couple of recent years. Should Bjarne immediately start learning from Trolltech's stuff?
    By the way - do you have any evidence?

    Quote Originally Posted by wysota View Post
    And of course they have some methods STL ones don't, i.e. QString::split().
    Wow. I'm really impressed.
    I guess that's about 2% of what you already have in Boost String Algorithms Library which works with guess what... std::string of course.

    Quote Originally Posted by wysota View Post
    Oh, this has already been argued - "use templates instead of moc". I can redirect you to the documentation,
    Please do.

    Quote Originally Posted by wysota View Post
    that's a big topic. Bottom line is moc gives you some benefits that wouldn't be possible with templates and you don't have to use moc if you don't want to - use Boost signals.
    For these some benefits all users of Qt have to pay because they are forced to use moc even if they would like to avoid it. That's absolutely not in the spirit of C++.

    I guess some benefits make about 20% of what moc does. Why doesn't Qt incorporate Boost signals for all these users using the remaining 80% of moc? And let these 20% use moc, moc2, super-extra-ultra-moc and other very valuable inventions of Trolltech trying to make from static C++ a dynamic language.

    Quote Originally Posted by wysota View Post
    This I have no chance of knowing but I guess the word "upcoming" says it all. I think once all supported platforms have compilers supporting C++1x (there is no way it's going to be called 0x, it's already 2009) we might return to the topic but now this is only academic talk bearing the fact C++1x is still fluctuating.
    Thank You Good Lord, guys involved in GCC and other compilers don't think in the same way you do Otherwise we would have had conforming compilers about 20 years after each standard gets ratified.

    Quote Originally Posted by wysota View Post
    I'm not aware of such document. If you're interested in it, I think contacting Matthias Ettrich would be the best way of answering your question.
    Just read his Designing Qt-Style C++ APIs.

    Most C++ books recommend references whenever possible, according to the general perception that references are "safer and nicer" than pointers. In contrast, at Trolltech, we tend to prefer pointers because they make the user code more readable.


    Yep, Trolltech always knows better.

    Quote Originally Posted by wysota View Post
    Edit: by the way, C++1x (or 0x, whatever you want to call it) will not be any revolution compared to C++03. It will just make some things easier for developers (...)
    No, it won't as long as libraries' creators will keep using old features instead of the new ones forcing, by doing this, their users to do the same

  18. #18
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    Most C++ books recommend references whenever possible, according to the general perception that references are "safer and nicer" than pointers. In contrast, at Trolltech, we tend to prefer pointers because they make the user code more readable.


    Yep, Trolltech always knows better.
    Ah, come on! Remember what you have accused me, that I would think qtcentre is the only forum? And now your statement is that references are the only holy solution, and Qt uses this bad pointer stuff.

    Beside, this are two possible and legal ways, which both have their advantages and disadvantages. There is objectively no right solution. This is how democracy work, majority and minor thought about one topic. This is also a issue with which Orwell has dealt in his Romans...

    And your whole argumentation is very sarcastic and not always objective. If you don't like the Qt way you have two options, don't use it or change it. Qt is LGPL, so you have all freedom to alter the code.

  19. #19
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How modern is C++ language used in Qt's API?

    Quote Originally Posted by piotr.dobrogost View Post
    Good API doesn't return dangerous plain pointers waiting for its users to make the first mistake.
    Qt doesn't return any "dangerous" pointers. I agree there are places where pointers might be hidden inside explicitly shared classes but it's not possible to eliminate all pointers in C++ due to the nature of polymorphism.

    Really. Where have you read this? Who made you think so?
    I didn't have to read it, it's a widespread opinion :-) For example if you throw an exception there are cases where destructors of objects created inside the faulty block will not be called. If there is anything positive I can say about Java is that it has much better exception model than C++.

    At least.
    Better yet just use standard containers
    If standard containers are worse, I don't really see a point in squeezing them into my code just because they are inside a library that has the word "standard" in its name.

    From Inside the Qt 4 Containers

    Implicit sharing is the main difference between QVector and STL's std::vector<T> class.


    That made me really laugh
    Yes! Love'em flamewars!

    What have they been thinking?
    Something like Instead of combing two standard features lets make it even harder for users and create our own (better as always) moc-vector?
    Would you care to explain? And what does moc have to do with vectors?

    Qt Code:
    1. template <typename T>
    2. typedef shared_ptr<std::vector<T>> QVector;
    To copy to clipboard, switch view to plain text mode 

    That would be too easy for users to use and too standard for Trolltech to even think of.
    Well, that's not the same. Implicit sharing is "copy on write". What you have presented here is more close to explicit sharing. And by the way, your code is not valid C++.

    If you can implement Qt containers (which don't bring anything new besides yet another api)
    They do, only that you obviously fail to see that :-)

    on such platforms you could have implemented STL ones in the first place...
    Well, that's not the job for the Trolls...

    Yep, I'm sure they are much better than the ones written by several world class c++ specialists in the course of a couple of recent years.
    Instead of being sure you can just do some benchmarks.

    Should Bjarne immediately start learning from Trolltech's stuff?
    Well, I don't see what would be wrong in that but that's not the issue. There are situations where STL containers are faster, there are situations where Tulip containers are faster. The problem with STL containers is that they have to be backwards compatible in the way they do their tasks so there is not much space for improvements. There is also a matter of memory footprint which is different for both sets.

    By the way - do you have any evidence?
    Yes. Here is something to start with:

    http://labs.trolltech.com/blogs/2006...it-worth-it-2/
    http://labs.trolltech.com/blogs/2006...the-benchmark/
    http://lists.trolltech.com/qt-intere...ad00118-0.html

    Wow. I'm really impressed.
    I guess that's about 2% of what you already have in Boost String Algorithms Library which works with guess what... std::string of course.
    Are we talking about standards or 3rd party additions? Your argument is that a 3rd party library is not better than a standard one because there is another 3rd party library that extends the standard one with capabilities of the former 3rd party library. Just read it and think if you didn't score an own goal here...

    Please do.
    Feel redirected.

    For these some benefits all users of Qt have to pay because they are forced to use moc even if they would like to avoid it.
    Name two such users. I guess one is yourself so finding another one should be easy... Just please find a person who can trully argument why he/she would like to avoid moc.

    That's absolutely not in the spirit of C++.
    Argue with project managers if they want to keep the spirit of C++ or sell software and earn money from it. If running moc is the "price" they have to "pay" for being able to build software easily, almost all of them will prefer that to tornments with "spirit of C++". Although I don't know what is not in the spirit of C++ in running moc... Building C++ based application involves calling at least four distinct tools - preprocessor (cpp), compiler (g++), assembler (platform dependant) and linker (ld). Does it really break the spirit if you add yet another one somewhere inbetween cpp and g++?

    Why doesn't Qt incorporate Boost signals for all these users using the remaining 80% of moc?
    AFAIK the concept of signals was born in Trolltech so I don't see why would they incorporate boost signals. I can see a reason not to, of course, and that's licencing.

    But yet again - nobody forces you to use Qt signals. You can use boost signals in your code and Qt won't mind.

    And let these 20% use moc, moc2, super-extra-ultra-moc and other very valuable inventions of Trolltech trying to make from static C++ a dynamic language.
    I guess you should argue with your idols because they are trying to make C++ more dynamic as well...

    Thank You Good Lord, guys involved in GCC and other compilers don't think in the same way you do Otherwise we would have had conforming compilers about 20 years after each standard gets ratified.
    Bear in mind Qt is much different than a compiler so comparing the two is not a good idea.

    And I'm pretty sure GCC is not built using C++0x but using the current standard. So is Qt. GCC allows you to use C++0x, so does Qt. So after all I'm leaning towards thinking that they do think as I do.

    Most C++ books recommend references whenever possible, according to the general perception that references are "safer and nicer" than pointers. In contrast, at Trolltech, we tend to prefer pointers because they make the user code more readable.


    Yep, Trolltech always knows better.
    It's a convention and you don't have to follow it. I learned it to be a good convention. I'm working with code that uses references as mutable input parameters and such code is very hard to read - you have to find a declaration of the method each time you see it used to check if any of the arguments passed are not by any chance references. Unfortunately C++ doesn't give us any hint about such cases. Using ampersands as such a marker is a workaround over C++ call syntax.

    No, it won't as long as libraries' creators will keep using old features instead of the new ones forcing, by doing this, their users to do the same
    What you say is very idealistic but it's not a bit realistic. If you have production code, you can't enforce instabilities or fluctuating code. Please name one large C++ library that has a known brand that forces its users to use C++0x compilers.

    This is my personal subjective opinion but I think so far I've been able to knock aside each and every argument or statement of yours. So before replying to this post (which I of course strongly encourage you to do) stop mocking and read a bit of resources on Qt, starting with its reference manual. Giving statements about Qt (in)compatibility with STL containers before even taking a look at its API was a really bad idea, it just made you look like a troll (with lowercase "t", not to confuse with Qt developers).

    What is beautiful about Qt is that it doesn't prevent you from keeping your coding habits and it doesn't force you to use solutions you don't want to. Take exceptions - Qt doesn't throw any exceptions but it won't break your exception-aware code. The only restriction I was able to find in Qt is that it doesn't allow you to multiply inherit QObject. And there is a limitation to moc that you can't use Q_OBJECT macro in template classes but that's not a big problem, there are ways to overcome that.
    Last edited by wysota; 31st May 2009 at 03:56.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Qt language of choice
    By alecs1 in forum Qt Programming
    Replies: 4
    Last Post: 26th April 2009, 20:13
  2. Replies: 4
    Last Post: 6th February 2009, 11:21
  3. Replies: 8
    Last Post: 15th May 2007, 09:21
  4. Discovery correct Language on all OS
    By patrik08 in forum Qt Programming
    Replies: 5
    Last Post: 25th February 2007, 19:27
  5. How can I add any other language
    By ethos0714 in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 22nd February 2006, 02:51

Tags for this Thread

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.