As many Processing users, I have never been formally trained as a programmer (so apology up front for any incorrect terminology). I've followed a familiar path, starting with putting a few ellipses on the screen and working my way up towards using object-oriented programming and related concepts. While my sketches are still modest in scope, I want to learn about code structure - in the broadest sense - where it can help me write more efficient and elegant code. I can imagine more Processing users at some point feel this way.
I've read different online resources and they mainly talk about two ways of constructing larger hierarchies of code. The first is to extend (abstract) classes. The second is to implement interfaces. My feeling is that behind this seemingly small number of 'solutions' lies a world of possibilities? Or are the possibilities as limited as they seem? Or maybe there are more options?
Extending classes made a lot of sense to me right from the get-go, because it allows reusing code of existing objects. I had a little more trouble understanding the usefulness of interfaces, which at first seemed like an 'empty present' to me. Wow, here are a lot of methods... what's in them? Nothing! :-) But as I read more, I found that the benefits are that it enforces structure (mainly useful in bigger projects) and it allows multiple inheritance (without method definitions) in java. But in all honesty I think the interface has yet to click for me, much like OOP had to at some point.
I posted this under general discussion, so feel free to share your thoughts? Opinions? Resources? Any knowledge or experience that programming veterans can share?
I've read different online resources and they mainly talk about two ways of constructing larger hierarchies of code. The first is to extend (abstract) classes. The second is to implement interfaces. My feeling is that behind this seemingly small number of 'solutions' lies a world of possibilities? Or are the possibilities as limited as they seem? Or maybe there are more options?
Extending classes made a lot of sense to me right from the get-go, because it allows reusing code of existing objects. I had a little more trouble understanding the usefulness of interfaces, which at first seemed like an 'empty present' to me. Wow, here are a lot of methods... what's in them? Nothing! :-) But as I read more, I found that the benefits are that it enforces structure (mainly useful in bigger projects) and it allows multiple inheritance (without method definitions) in java. But in all honesty I think the interface has yet to click for me, much like OOP had to at some point.
I posted this under general discussion, so feel free to share your thoughts? Opinions? Resources? Any knowledge or experience that programming veterans can share?