[Biococoa-dev] BCSequence class cluster

John Timmer jtimmer at bellatlantic.net
Fri Jan 7 19:48:15 EST 2005

Just a quick comment:

> I just thought of an analogy to throw in the discussion. NSString has the path
> methods like 'stringByAppendingPathExtension'. These will work on ANY string,
> even if they are not path, but the contents of this email. However, it does
> not make sense. Do we get a compiler warning? no. Do we get a runtime error?
> no. Are we in trouble? yes. What the f... this string is doing here when I
> should have a path??? This is clearly the fault of the user, here, not of the
> guy who designed NSString. OK, this is really a much simpler situation than
> ours, but still.

Yeah, this analogy doesn't really work in terms of taking into account why
Alex and I worry.  You can add a .tiff to a non-path, and the result is
still a string.  You might get unexpected behavior when you used it, but
you'd have to do something convoluted to get your app to crash as a result.

If you ask for a complement from a protein, you'll either get nil or
something with a sequenceArray count of 0.  Either of these make it very
easy for a user to crash the app.  That's why I feel (and as of last check,
Alex did as well) that things should be structured so that asking for the
complement of a sequence object should generate a compiler warning if it's
not a nucleotide sequence (and likewise for other sequence type specific
methods).  It's the user-friendly thing to do.  If we're doing that, then we
should definitely have a header that informs users of what types of sequence
respond to what messages.

I find it personally more satisfying to explicitly type my sequence
variables so that the code is easier to follow and the right methods pop up
in code sense, but I recognize that that's probably a personal taste.



This mind intentionally left blank

More information about the Biococoa-dev mailing list