Re: [PATCH v2] Document preferred naming conventions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Mar 03, 2017 at 07:57:24PM +0100, Jiri Denemark wrote:
> On Fri, Mar 03, 2017 at 17:47:23 +0000, Daniel P. Berrange wrote:
> > This documents the preferred conventions for naming files,
> > structs, enums, typedefs and functions.
> > 
> > Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
> > ---
> > 
> > Changed in v2:
> > 
> >  - Fix typo
> >  - Add macro docs
> >  - Clarify that $VERB is always last in function/macro names
> 
> Hmm, so what do we do if there is an object, an action, and a subject?

Good question :-)

> Typically accessors which are designed to return some specific part of
> the object. For example,
> 
>     virQEMUCapsGetDefaultMachine
>     \         / | \            /
>        object   |    subject
>                 |
>                 `- action (verb)
> 
> Are we supposed to name such function as virQEMUCapsDefaultMachineGet?
> While it is certainly possible, it just doesn't read well.

Yeah that's craziness in that example at least. Do you recall any examples
where we have object,subject,action, or are we always doing
object,action,subject ?

We could specify object,action,subject, or we could just say either
ordering of action & subject is valid.


Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://entangle-photo.org       -o-    http://search.cpan.org/~danberr/ :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux