3 ms·
If your C umbrella includes C++, Qt has a number of (non-GUI) high-level libraries that can be useful for applications.
by loeg 6y ago
If your C umbrella includes C++, Qt has a number of (non-GUI) high-level libraries that can be useful for applications.
- lrossi 6y agoQt is more like gtk rather than glib. Although it does come with a fantastic core library. But if you can move to C++, the standard library already offers great replacements for most glib features. Glib exists mostly because the C standard library is lacking in many aspects.
- PaulDavisThe1st 6y agoThat's only partially true. You'd really something like boost to cover a lot of things that glib provides for C. glib covers many, many things that are outside of the scope of both the C++ and C standard libraries.
- loeg 6y agoIn the same way that using glib does not mean you are forced to use Gtk, you can use pieces of Qt without pulling in the GUI library. That's why I mentioned "non-GUI" explicitly. https://en.wikipedia.org/wiki/Qt_(software)#Qt_modules https://en.wikipedia.org/wiki/Qt_(software)#Qt_modules E.g., Core, Network, SQL do not require the GUI components.
- ognarb 6y agoThere is QtCore that is more similar in scope to glib and only containers, json and a few more useful stuff. It's a sort of alternate C++ standard library. Personally I wonder why people would choose today using C and Glib over C++ for system programming. I could understand why not Rust but for having to deal with glib in the past its so much of a pain.
- lrossi 6y agoThat’s exactly what I am thinking as well. Using C++ in moderation, without getting too crazy with classes, multiple inheritance, lambdas and other such things, works very well if you want to port a legacy C code base. For a new project, there are many choices: rust, go etc.
- pjmlp 6y agoThat is mostly how I use C++ nowadays, for writing native libraries to be called from Java/.NET, or GPGPU stuff.
- loeg 6y agoAs a mostly C and sometimes Rust programmer, I don't know why I'd ever reach for C++ instead of Rust these days. If I'm going to take on the mental complexity of these big languages, I'd rather have Rust's safety properties. (Not to mention, superior, portable, single-vendor standard library features — something C++ struggled with for a long time and probably still struggles with.)
- PaulDavisThe1st 6y agoEven the Qt folks accepted, though, that for run/event-loop integration between glib and Qt code, it was Qt that provided a way to use the glib event loop not vice versa (because Qt doesn't offer a sufficiently hook-able event loop abstraction).