I'm not the greatest programmer ever, I'll brute force if I have to, and any professional programmer would probably cringe in horror at some of my code. Just a small disclaimer. I'm currently using a Java derivative language (Processing), and hence Object Oriented. My question is, is there some kind of guideline for when a new class is or isn't a good idea? How do you know when you're over or underusing classes vs. new methods.
Name:
Anonymous2007-09-03 5:38 ID:Nu1otLvn
>10
That was pretty much my understanding of it. Unfortunately when it comes to pre-structuring code, I'm not great. I should explain what I'm essentially programming is one big genetic algorithm. At first I thought that it would be a good idea to have a population class, a genome class, and a gene class. Unfortunately, when it comes to prestructuring code and information flow, i am not terribly good, so I went with the simplest possible solution in order to get it working. And up til now I've just been using arrays, the GA works, and everything is fine. But lack of foresight means I've realised that each gene will need to be more complex than the 1 int per gene I've been using before, and other values will have to be associated with them. My first thought is to use yet another array, but... surely I can't just keep using arrays forever. On the other hand, the other solution sounds like a complete code restructure... which... is not an ideal solution either right now.