[haiku-commits] Re: r40762 - haiku/trunk/src/apps/terminal

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 2 Mar 2011 10:01:10 -0500

On Wed, Mar 2, 2011 at 9:53 AM, Stephan Aßmus <superstippi@xxxxxx> wrote:
>
> It should not be a boolean at all, BTW. It's much easier to read this code:
>
> list->RemoveItem(item, BObjectList::DELETE); (or similar enum)

Indeed. As you probably know that is an idiom they started a while ago
at WebKit and I definitely agree it reads much better.
Self-documenting code for the win.

One of my "favorites" in the BeOS/Haiku API is BPopUpMenu. Both the
contructor and especially Go() are loaded with opaque booleans. It's
definitely something we should fix in R2 API redesign, both in
removing some of those booleans and replacing the rest with enums.

-- 
Regards,
Ryan

Other related posts: