News for hackers. Stuff that matters.
Re:Krita, OpenGL and Qt by quietbritishjim on Saturday July 18, 2020 @07:09AM (#23880555)
But if you can use a framework then that is going to save you a ton of work, both upfront and in maintenance costs. Since developer resources are almost always limited, that means you end up with more time left over for actual application features.

(And by "use" I mean use directly, not through some framework-abstracting metaframework you've written yourself - I think it's very obvious that's going to be a disaster. The whole point of a framework is to abstract over different APIs, so if you have to abstract on top of them then they serve no purpose. It brings to mind horror stories of hand-rolled database engines written on top of other database engines!)

I think your comment leaps directly from "if you can't use a framework directly then you're best off writing your own" (fair point) to "I don't like frameworks at all", without tackling the key bit in middle: how often is it possible to use a framework directly? The truth is, most applications can be built just fine with a framework like Qt. There is a gap between "hello world" and Krita that encompasses almost all practical programs.

Even in Krita's case, with all the pain they've encountered, they're still not seriously discussing abandoning Qt. They're even talking about maintaining their own patch set! Given how much experience they obviously have on the subject I think that shows there is value even in a framework that doesn't fully work for you. (I know that's an appeal to authority but I think there's some value in that argument.)

One compromise is to use a framework like Qt for all the boring bits of your program, like the dialog boxes and window decorations, then write your own wrapper for low-level APIs for the main display area if it needs it. I must admit I'm not sure how feasable this actually is given that something else in ultimately in control of the overall rending - maybe it isn't at all given that Krita doesn't do it.

Re:Krita, OpenGL and Qt by boudewijnrempt on Saturday July 18, 2020 @07:56AM (#23880773)
When I started working on Krita 2003, it was already using Qt, of course, so I didn't have much of a choice -- if I wanted to work on Krita. But then, in a nice piece of circular reasoning, I choose to work on Krita because it was using Qt. Back then, I only knew Java, and Qt made C++ look like Java. One of the big problems I see in Qt is how the Qt developers are somehow ashamed of that heritage and want to make Qt steadily less Java-y and more Boosty or std-y.

Over the years, we've had a lot of pain, of course... But then again, a lot of fun, too, and without Qt we wouldn't have been able to create an application like Krita. Every alternative just is worse, much worse.

Re:Krita, OpenGL and Qt by HelloNurse on Saturday July 18, 2020 @09:43AM (#23881339)
2003 was a long time ago: C++ has evolved, Java has stagnated and is falling out of fashion, and many traditional Qt peculiarities like nonstandard strings and collections or the custom preprocessor have gradually transitioned from idiosyncratic but justified to unreasonably antiquated and possibly unacceptable. I think making Qt as "Boosty" as possible is necessary for it to remain relevant.
Re:Krita, OpenGL and Qt by pjmlp on Sunday July 19, 2020 @05:50AM (#23888218)
Might be failing out of fashion, yet Microsoft just bought a Java company, is now an OpenJDK contributor and is one of tier 1 languages at Azure and Amazon SDKs.

Meanwhile, C++ lost its full stack status, the only mainstream OS that still offers C++ GUI tooling, is Windows, and none of MFC, ATL or UWP/WinUI APIs are "Boosty".

What keeps Qt relevant as the surviving C++ GUI framework not stuck in 90's tooling idioms are the paying customers, and those have quite clear ideas which compilers and ISO C++ versions they want to have Qt on.

Re:Krita, OpenGL and Qt by pjmlp on Saturday July 18, 2020 @08:34AM (#23880986)
It is not that they are ashamed, rather Trolltech made a series of decisions that make sense in the context that Qt was originally designed and the C++ compilers used by the demographic of paying customers, which does seat well with ISO C++ of all things crowd.

Meanwhile std::string still doesn't provide everything that compiler specific frameworks have been doing since mid-90's.

Re:Krita, OpenGL and Qt by PaulDavisThe1st on Saturday July 18, 2020 @02:56PM (#23883825)
Qt isn't a compiler-specific framework.

The problem with Qt not using std::string is when you (gasp!) want to integrate with non-Qt libraries that do use std::string. It has nothing to do with what std::string offers or does not offer compared to any other string implementation. std::string was the string implementation for C++ since before Qt began, and by not using it for their strings, they delivered a significant message about their desire to integrate easily with non-Qt libraries.

Re:Krita, OpenGL and Qt by boudewijnrempt on Saturday July 18, 2020 @05:46PM (#23885120)
Meh, having used Qt since 2000, I've never found that a problem in practice. After all, there've always been conversion functions.
Re:Krita, OpenGL and Qt by sgerenser on Saturday July 18, 2020 @07:09PM (#23885593)
Qt not using std::string made a lot of sense when everyone though UTF-16 was the future. A 16 bit default string type was just what modern i18n friendly language or framework had to have. It’s only in the past several years with the rise of UTF-8 everywhere that it looks like a mistake.
Re:Krita, OpenGL and Qt by PaulDavisThe1st on Saturday July 18, 2020 @07:39PM (#23885747)
I'm not questioning your perspective.

But I looked at using Qt in 1999 and easily decided against it, in part for this reason. Those of us coming from a *nix background got the UTF-8 thing much earlier than people affected by the Microsoft worldview.

Re:Krita, OpenGL and Qt by pjmlp on Sunday July 19, 2020 @01:30AM (#23887232)
Ah that is why C excels in localisation and internationalisation.

Thankfully having a *nix background helped Sun getting Java design regarding UTF just right.

Re:Krita, OpenGL and Qt by joezydeco on Saturday July 18, 2020 @09:21AM (#23881245)
I’m a QWidgets guy, I understood what he is saying.
Re:Krita, OpenGL and Qt by Netcob on Saturday July 18, 2020 @01:53PM (#23883239)
I probably came across as a bit too rant-y. I'm not blaming anyone for using frameworks and I use them all the time myself. And I'm definitely not criticising Krita for using Qt.

Qt, as most frameworks, simply has the ability to get you stuck between a rock and a hard place. It's all a bit of a gamble of course. Similar to writing plug-ins for specific programs or apps targetet at app stores for a living. Someone can just decide to kick you out for no reason. I'm sure Qt doesn't intend to do that, they probably just want to do right by that almost-all-programs group. When you're that popular, ANY decision will hurt a lot of people.

What I'm trying to say is that I wish there was more of an effort in the programming community to avoid these asymmetric relationships. We already make a huge commitment by deciding what programming language to use, which often already comes with a built-in framework or standard library, a package manager and maybe even an IDE. For example, in the .NET world you have to constantly keep up with Microsoft's latest ideas on how to complicate the ecosystem by introducing yet another thing that is supposed to solve all problems at once, including those introduced by the previous attempts. If you're already in one abusive relationship, the last thing you want is two abusive relationships.