5 ms·
Why not use GObject?
by sydthrowaway 4y ago
Why not use GObject?
- sbf501 4y agoI think writing your own portable C functions is something every programmer wants to own at some point in their young career. Then you grow up and realize there are entire organizations that have spend tens of thousands of man-hours providing the same code, but done correctly and with intent (and consistent philosophy). GObject is that philosophy, but lots of people never hear about it until someone says "Why not use GObject?" :)
- slabity 4y agoThis is completely anecdotal, but when I was looking for something like this ~10 years ago (and was just beginning to learn about the wider Linux ecosystem outside of libc), I stumbled upon GObject and completely ignored it because of its association with GNOME. My initial thoughts was that GObject was only really useful if you were building things for the GNOME ecosystem and wrote it off completely. I also did the same with GLib. I know now that the association only really goes as far as who maintains it, but if it wasn't for how it was branded, I probably would have been using it in a lot more of my projects. Sounds kind of stupid, but never underestimate how branding can affect how your project gets used. Especially by people who are unfamiliar with it.
- zambal 4y agoYour comment could have been mine. Many years ago, I found GObject interesting, but was afraid using it would lead to friction when used outside GNOME's ecosystem.
- sbf501 4y agoI was referring to myself too in my original post, but I don't think it was clear. I resisted GObject/GLib for the exact same reasons you listed. Plus as a younger programmer I was super fussy about style conventions and didn't like introducing other styles with my "pure" style. (I know, I know.) It wasn't until I started using GStreamer that I saw the light.
- AceJohnny2 4y agoPerhaps because it's licensed as LGPL, whereas this repo is BSD?
- bregma 4y agoGObject, the C++ implementation by a True C Believer.
- synergy20 4y agotried to use it for embedded system in the past, pretty large in size and impossible to use there, it's in fact larger than c++ stdlib and I ended up going straight to c++ instead.
- sydthrowaway 4y agoC++ probably put the smarts in the compiler
- deleted 4y ago[deleted]
- bjourne 4y agoGObject's object model is insanely overcomplicated. It's more or less an implementation of C++ in C. It's overkill if you just want resizable arrays, hash tables, and maybe some trees.
- wruza 4y agoI think gp confused gobject with glib. Glib has no object model, it’s a collection of functions and data structures, including “managed” strings. Just a better version of libc, if you don’t mind the size. https://docs.gtk.org/glib/#structs https://docs.gtk.org/glib/#structs