[Qt-interest] Qt5 and SQL
Andre Somers
andre at familiesomers.nl
Tue Jun 7 09:00:19 CEST 2011
Op 7-6-2011 8:34, Ross Bencina schreef:
> Andre Somers wrote:
>
>> Op 6-6-2011 17:47, Alan Ezust schreef:
>>> Shouldn't someone start the process of renaming it to QSqlConnection,
>>> having a deprecated typedef to QSqlDatabase in Qt5, so that we can
>>> remove QSqlDatabase from Qt6?
>> To be honest, you are the first I have heard up this confusion.
> Be careful with this attitude, when I take that position I usually regret it
> later. It's a kind of pointless defense against users telling you something
> is wrong with the system. Why not fix all problems rather than just those
> that lots of people are confused by? Especially high-value low effort things
> like renamings.
Sorry you see it as an attitude. I really mean it. I have been active in
the Qt community for quite a while, and I simply don't remember anyone
expressing confusion on this point before you did. *I* think a rename
will confuse more people currently working with Qt than it will solve
confusions for new users. No data on that though.
>> I don't think this is an important one. If one were to
>> re-design the complete API for it, then sure, refactor QSqlDatabase into
>> something that makes more technical sense, but just a rename for the
>> sake of renaming seems none-produtive to me.
> Personally, I think it's extremely important. If naming is not done properly
> it reflects just as badly on the codebase as other types of flaws. It
> implies a serious deficit in design to missname something as fundamental as
> "a connection to a database" as "the database itself". If you can't even
> name objects correctly there is not much hope for the rest of the system.
I find it less important than the classes actually working. And as
argued before, in the case of an embedded DB, QSqlDatabase actually
_does_ represent the database, and not a connection. I really do agree
that class and method naming is important in API design, and I think
that Qt is in general doing a good job in it.
> On the whole Qt does a great job with naming, I think this is just a legacy
> from cloning Borland VCL (which calls the same class TDatabase)
I agree. And maybe it was a mistake back then.
>> There are bigger fish to fry.
> Ever heard of broken window theory?
> http://en.wikipedia.org/wiki/Broken_windows_theory
I was not with the name, but I am with the concept. Not sure if the Qt
code base can be equated with the urban environment, and Qt developers
with vandals though. It seems stretching the theory to domains it does
not apply to, but hey, that may just be the social scientist in me talking.
> Renaming a class is as easy as ctrl-alt-R, grep and updating the changelog.
> Easier in-fact than me writing this email.
Really? Will that ctrl-alt-R also automagically change all
documentation, all knowledge gathered on fora, mailing list archives,
blogs, books and other places on using this class? And yes, I think that
that is relevant. That body of knowledge is valuable, and it is valuable
that people can find it. Fixing this "broken window" may do more damage
than it solves.
> If you don't commit to continuous improvement of the codebase it will
> ossify. A major release is a good time for this kind of change. In-fact, the
> only time given current Qt policies.
>
> While we're at it, shouldn't QSqlDatabase::transaction() be named
> beginTransaction() ?
Transaction should be a RAII class. In fact, I made one for it.
> These things matter. I'd say fix it.
Yes, these things matter, but IMO it is not worth fixing it _in this case_.
André
More information about the Qt-interest-old
mailing list