LWN.net Logo

...and right they are

...and right they are

Posted May 14, 2012 8:00 UTC (Mon) by HelloWorld (guest, #56129)
In reply to: ...and right they are by nix
Parent article: ConnMan 1.0 released

The alternative to using GObject isn't to build your own object system for C but simply to use a decent language that supports OOP. And if you really, really want to use GObject, at least use Vala.


(Log in to post comments)

...and right they are

Posted May 17, 2012 20:51 UTC (Thu) by nix (subscriber, #2304) [Link]

All I can say is that in many previous jobs if I had tried to force everyone to use C++ they would have killed me -- but a few simple ADTs they were quite happy with. That the data structures happen to use structures containing function pointers and up-pointers to ancestor structures internally, just like C++ classes, is something they didn't need to know or care about unless they were adding a new descendant ADT. They had their happy C still. (Also, we had a lot of pre- and post-processors involved which could parse C -- just -- but had no chance of parsing C++. One of them claimed to parse C++, but it couldn't handle templates at all, so it barfed on the G++ headers. Most impressive. Not.)

...and right they are

Posted May 17, 2012 22:01 UTC (Thu) by HelloWorld (guest, #56129) [Link]

I don't see the connection to the topic at hand. The discussion was about object systems and GObject specifically, and ADTs have nothing to do with those.

Also, I think that ADTs in C invariably suck. It's simply not possible to write generic, type-safe ADTs in a sane way (the C preprocessor isn't sane).

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds