Re: [LAD] Looking for an introduction to rt programming with a gui

From: torbenh <torbenh@email-addr-hidden>
Date: Mon May 24 2010 - 16:27:06 EEST

On Mon, May 24, 2010 at 08:28:14AM -0400, Paul Davis wrote:
> On Mon, May 24, 2010 at 5:24 AM, Chris Cannam
> <cannam@email-addr-hidden-day-breakfast.com>wrote:
>
> >
> >
> > Reading a language is (for most projects) more important than writing
> > it. You yourself took the jackdmp code (in C++) and ported it back to
> > good old C because it was written "from the wrong school of C++" and
> > you found C easier to work with. Jackdmp is not exactly weird code --
> > it's written rather like pre-1.5 Java -- but its C++ is just not the
> > same C++ as you use. Similarly, for someone like me who has used Qt
> > for many years, Boost has always seemed largely superfluous and the
> > language that for you "is C++" is for me something a little bit alien.
> > Is it possible to write C++ in such a way that every competent C++
> > developer is happy to work with the results without some sort of
> > re-education?
> >
>
> nice point. i think though that its always been somewhat invalid. two cases
> in point:
>
> 1) i have on my bookshelf coplien's "advanced C++: programming styles and
> idioms" which came out sometime in the early/mid 1990's. it looked alien to
> me when i first saw it then, and picking it up again, it looks pretty alien
> to me now too. it represents a brief snapshot in time of what "good C++" was
> supposed to look like. it pushed the envelope initially (i think that
> coplien was the originator of the pimpl idiom, for example), but at this
> point it looks pretty dated.
>
> 2) gobject... written in C ... as has been noted in this thread already,
> despite being "analysable", its a style of C that some/many people find very
> difficult to work with. so much so that its ended up being wrapped, replaced
> and so forth. so the issues here are not restricted to the many headed hydra
> called C++

hmm... i dont really find GObject hard to work with.
its simply the required boilerplate that puts me off.
iE before just deriving from a gobject. you end up just instantiating
the BaseClass and connecting signals to customise it. before you even
consider deriving.

just look to what kind of a monster this compiles to:

http://www.jirka.org/gtk-button-count.gob.

c-file: http://www.pastebin.org/274390
h-file: http://www.pastebin.org/274393

however once you need some kind of property or additional state on an
object you really need to derive.
(you can probably get away with g_object_get_data() but thats
"teh ugliness" :D

-- 
torben Hohn
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon May 24 20:15:01 2010

This archive was generated by hypermail 2.1.8 : Mon May 24 2010 - 20:15:01 EEST