← Back to team overview

launchpad-dev team mailing list archive

Re: Removing IArchive.commercial

 

On Thursday 03 May 2012 11:26:11 Jonathan Lange wrote:
> Actually, that wasn't entirely honest. Sorry. Here's what I was
> actually thinking:
> 
> I want to continue doing this work incrementally. Before the 'enum'
> suggestion, the way I planned to do it was this:
> 
>  1. make a property with the new name;  make that a simple
> getter/setter for 'commercial'
>  2. change the permission model for setting both it & commercial
>  3. a series of patches to rename the column in the db
> 
> I still think this is a good plan.  We could do the enum bit as a step 4.
> 
> However, I'm not 100% convinced about the enum. It is more flexible,
> but without an actual use case it's a YAGNI. I also suspect that it

Enums are nearly always better than a bool. I've lost count of the number of 
times I've seen loads of mutually exclusive bools because people didn't plan 
ahead.

If you have an enum you can even mask it as a bool property.

> will drive me into a positive line count delta. If we decide that
> that's the way it should be, I'll happily do the work. I'd only note
> that we could postpone that work until there's a use case, at no cost.

One of my concerns about this whole line delta thing is now coming to bear.  
If we let it get in the way of good design it's a disaster.


Follow ups

References