This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC v2] Pretty printers for NPTL lock types


On 13 Mar 2015 14:48, Martin Galvan wrote:
> On Fri, Mar 13, 2015 at 2:47 AM, Mike Frysinger <vapier@gentoo.org> wrote:
> > On 12 Mar 2015 14:33, Martin Galvan wrote:
> >>         else:  # Mutex is locked
> >>             if self.lock & FUTEX_WAITERS:
> >
> > i prefer to avoid inline comments
> 
> I've been looking at the code again and IMHO, save for perhaps that
> one comment, the rest of the inline comments should stay. The ones
> beside the "else"s are helpful for maintainers to know what my
> assumptions were for that particular else, i.e. which cases I
> predicted would go through that path. Any cases not mentioned in the
> else comment nor the previous if/elifs are a sign of a possible bug,
> or at least a reminder for maintainers who have to implement a new
> case.
> 
> The comments by the globals are useful to identify what they'll be
> used for without having to search through the code, and the comment
> inside MutexPrinter's printAttributes method tells of an inconsistency
> inside the NPTL itself.

i'm not saying delete the comments.  i'm saying comments should not be inline.

incorrect:
	CONSTANT = 0x213  # Blah
	...
	else:  # Some foo
		blah = 0

correct:
	# Blah.
	CONSTANT = 0x213
	...
	else:
		# Some foo.
		blah = 0
-mike

Attachment: signature.asc
Description: Digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]