Sunday, March 21, 2010

The rabbit hole of abstraction

So, I've really been digging abstraction and interfaces lately. I'm like, "Hmm, I'll probably want more than one way to do this in the future, so I'll abstract that bit out so I can inject the dependency or whatever." Because I've been so focused on writing tests lately, I wasted a few hours today. I got to this point where I was confused as to which Interface/class I was injecting into another class, and I realized I'd abstracted the same thing about three levels deep. I kept being like, "I'll handle it with this next abstraction," but I never actually was like, "The buck stops here."

Anyway, just a bit of frustration, mostly because I felt so productive yesterday and most of my coding today seemed for naught. Though, I think I learned a valuable lesson about making sure I don't lose sight of the bigger picture.

I think I'll start using EclEmma pretty soon to help keep track of what I'm doing with my tests.

2 comments:

mwb said...

from an unknown source: every problem in computer science can be solved with abstraction, except too much abstraction.

abagoforanges said...

Good call. :-) I haven't been working on this project much, but I'll soon (in the next two weeks) have much more free time. I've been taking notes and writing down ideas for features and such during the last few months.