emacs-devel
[Top][All Lists]
Advanced

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

Re: Booleans


From: Jarek Czekalski
Subject: Re: Booleans
Date: Mon, 16 Dec 2013 08:39:14 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20120824 Thunderbird/15.0


W dniu 2013-12-16 00:03, Paul Eggert pisze:
I did it primarily because Stefan suggested that I
do so, while changing int to bool etc.

Was it a private discussion? I can't remember seeing that. I hope it was not, see "Avoid private discussions". [1]

It would be an odd style to use '0' for false
preprocessor expressions, while using 'false' for false
expressions everywhere else.

For a c programmer while (1) is extremely readable and obvious, and short. While we are in c and not in Python or Lisp, I would follow the c convention. In places like this one, where introducing bool gives no benefits.

>should have been a separate commit, as
>it is not a mechanical replacement, far from it.
It was a judgment call.  Perhaps I should have separated it
out, though it's no big deal.  It was a case of an int value
being used as a boolean with values 0 and -1.

I think it is a deal worth a while. It's very hard to locate a change in a commit that is 221k long. Such long commits should be limited to mechanical changes. Putting several different changes in such a long commit makes it impossible to review. Now it's time for the most important question: do you want your revisions to be reviewed? See "Practice Conspicuous Code Review" [2].

Why this single change should be a separate commit? I would justify it being a change of the interface of an internal library. An advanced Emacs user may have more calls to this internal api. Would he expect that the interface was changed seeing a label "Use bool for boolean" in the commit message? I could even give reasons for not changing at all this interface, but maybe it's not worth arguing.

Thanks
Jarek

[1] http://producingoss.com/en/producingoss.html#avoid-private-discussions
[2] http://producingoss.com/en/producingoss.html#code-review




reply via email to

[Prev in Thread] Current Thread [Next in Thread]