Code review comment for lp:~jml/launchpad/package-permission-love

Revision history for this message
Jonathan Lange (jml) wrote :

On Wed, Sep 2, 2009 at 6:06 PM, Julian
Edwards<email address hidden> wrote:
> On Wednesday 02 September 2009 03:21:08 Jonathan Lange wrote:
>> That's just restating your point in different words. I really want to
>> understand the _reason_ for saying so.
>
> Maybe my experience is different to yours, but this is a well-established
> programming convention in every place I've done programming work for the last
> 16 years.  I can't find any exceptions (haha) to this convention when using
> Google, either.  Everything I've found talks about using them only for error
> handling.  Break strong conventions at your peril.
>

I wasn't trying to disagree with the convention at all, just to
understand it a bit better. In general, it sounds very sensible to me.

I've heard it cited as a reason to always return None rather than
raise "not found" exceptions, for example, and that's never really sat
well with me.

>> > Also bearing in
>> > mind that they're pretty expensive, if a piece of code can return a value
>> > to indicate its results, then it should do so.
>>
>> Are they really that expensive in Python?
>> http://www.python.org/doc/faq/general/#how-fast-are-exceptions is
>> unclear
>
> "Actually executing an exception is expensive" seems clear to me. :)
>
> When you think about what happens, it makes sense.

Well, it means that it's only expensive if it gets raised. What I mean
is that it's not clear to me that that matters for this function. I'm
guessing it does.

jml

« Back to merge proposal