This may seem like a superfluous question, and perhaps it is, but it's important to get the basic raison d'etres of the programming habits that are encouraged in the tutorial straight. (Wow that's a strange and awkward sentence but it's good to write in English and show off literal non-skills.)
In short: Why use:
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
messenger_rna = Seq("AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG",
IUPAC.unambiguous_rna)
messenger_rna
Seq('AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG',
IUPACUnambiguousRNA())
messenger_rna.translate()
Seq('MAIVMGR*KGAR*', HasStopCodon(IUPACProtein(), '*'))
When you can simply use:
from Bio.Seq import translate
my_string_messenger_rna = "AUGGCCAUUGUAAUGGGCCGCUGAAAGGGUGCCCGAUAG"
translate(my_string_messenger_rna)
'MAIVMGR*KGAR*'
Good answer, but I would use the term "procedural programming" to describe non-OO programming in which functions are not associated with data. The term "functional programming" describes a type of stateless non-imperitive programming such like that used in R or Haskell. http://en.wikipedia.org/wiki/Functional_programming
This makes sense. When it's already possible to use comments to make your statements clearer, it's seems kind of redundant to make objects out of often used concepts. Nonetheless, I will stick to the advice given by the tutorial.
In C#, method overriding works so: the parent class needs to declare overridable methods as
virtual
methods and the child class has to declare a method with the same name and withoverride
in its declaration. Also, aprivate
method cannot be used/overridden through instantiation or inheritance.All of this to say "virtual private methods" set off all kinds of alarm bells in my head :-)
Great answer. OOP always felt stupid to me, like why increase the complexity of the program.. I suppose there comes a point where OOP actually decreases complexity, but the commonly referred to a few hundred LOC isn't it, IMO. Maybe around 1k LOC you cross the point where OOP actually helps..