I finally learned how important this concept is when you are programming. Coming up as a flash developer, on of the things you learn quickly and get very used to, is how easy it is to break encapsulation on your objects and ‘hack’ things. I’ve said before I’m a big fan of just getting the stuff done and to not worry about strict OOP concepts. However, on this project I am currently trying to wrap up, I am experiencing first hand the other side of that issue…namely, the ripple effect that poor encapsulation can have on your code. Too many times, fixing one bug is breaking something else. Granted, that could’ve been caused by introducing an entirely new way of trying to accomplish something that needed to get done in the late stages of a project…but properly written interfaces would’ve saved a lot of work (and stress).
The way I’m seeing it now, therea re some projects that you can get away with sloppy encapsulation (websites) and some you WILL get your ass bitten with (applications). From now on, it’s a well-defined interface for objects and classes for me.
If you have time to breathe, you have time to refactor the mess you made. If you don’t have time to breathe, raise hell to git-r-done. That’s my philosophy on programming.