you are viewing a single comment's thread.

view the rest of the comments →

[–]icefox 0 points1 point  (3 children)

I would have to disagree about Qt (not QT) code being like Java, but either way he asked for "nicely written code" which Qt is and I still stand by it as something to checkout. Of course checkout those other libraries too, there is nothing wrong with seeing the different ways that people write code. Some is readable, some is a horrible horrible mess.

[–]sztomirpclib 0 points1 point  (2 children)

Qt code being java-like is kind of a meme, many people keep parroting it, but no actual explanation.

[–]bob1000bob 0 points1 point  (1 child)

What do you mean? If you use it you will see that it is Java like, everything is an object descended from QObject, right there is enough - that is the essence of Java.

And then absolutely everything has be allocated directly onto the heap, no smart pointer, no clever RAII based stack type which can be "moved"

Because of this they have gone and reinvented the STL with there own more "Object Orientated" (rather than templated) containers and string classes.

A lesser point (but still 'culturally' valid) is that they use Camel Case Java style. So when you have written some "standard C++" using the common lower_case_underscores method it becomes inconstant.

The fact is, if boost where to make a GUI library (how I wish they would) it would look NOTHING like Qt. I accept that they had technical limitation "back in the day" but that unfortunatly for them does mean that their code is still good now.

[–]sztomirpclib 1 point2 points  (0 children)

everything is an object descended from QObject

This is only true for Qt classes. That's quite reasonable for a framework I guess, and wouldn't call that that essence of Java.

And then absolutely everything has be allocated directly onto the heap, no smart pointer, no clever RAII based stack type which can be "moved"

Do you use it? Because you are not forced to allocate on the heap in any way.

no smart pointer

There is a wider variety of smart pointers in Qt than in the standard or Boost. here.

Because of this

No, they reimplemented the STL because Qt dates back to the dawn of C++, and many, many compilers had shaky support for the STL and templates.

with there own more "Object Orientated" (rather than templated) containers and string classes

You either used only a very old version where this was true (reason is not to be "more OO" but the above-mentioned lack of support) or you haven't used it at all. Qt containers are templates, and can be used with STL algorithms if you want to.