Skip to main content
2 of 2
added 34 characters in body
Doc Brown
  • 220.3k
  • 35
  • 410
  • 623
  • I would use byte TypeId instead of int TypeId, because when you make RNA strands with long lists of Nucleotides, you don't want to waste 4 times of the memory you really need. The TypeId should be the only member attribut of that struct. If you need additional information for some operations, try to use the Flyweight pattern. So a List<Nucleotide> with 1000 elements will need almost exactly 1000 bytes in memory, with neglectable overhead (in C#).

  • if you don't expect different behaviours for different Nucleotide types, it feels complety wrong for me to use different derived classes for representing the types. Don't overcomplicate things - only because different derived classes can technically be used for distinguishing types, it is not always the best solution.

Doc Brown
  • 220.3k
  • 35
  • 410
  • 623