[Spice-devel] [PATCH v2 0/6] sound cleanups

Christophe Fergeau cfergeau at redhat.com
Tue Apr 25 10:04:36 UTC 2017


On Tue, Apr 25, 2017 at 09:39:26AM +0200, Pavel Grunt wrote:
> Hi Jonathon,
> 
> I don't see a benefit of removing ("inlining") on_new_{playback,
> record}_channel_client. I actually prefer shorter functions even if it
> means that some other function is called only once. It is also
> recommended in the style document:
> https://www.spice-space.org/spice-project-coding-style-and-coding-conv
> entions.html#_short_functions
> 
> In case you do it to make more obvious that the client is not active
> then imho is better to assert it.

In this case, the splitting of some of the constructor code in a
separate on_new_XXX() make little logical sense. Why is this specific
code in a separate function? The code which ended there seems very
random to me. I agree that the constructor gets a bit big with
everything in it, but in my opinion it's better than having a very
arbitrary on_new_XXX() method. Maybe the constructor can be meaningfully
split in smaller methods, but then they would probably be named
differently.

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170425/3466e8ad/attachment.sig>


More information about the Spice-devel mailing list