You Are Not Ruthless Enough
playswithfire.com
playswithfire.com
Writing good, clear interfaces and using them appropriately does not slow you down. It lets you move faster, think clearly, solve harder problems, and build more.
me saying this is particularly ironic because i'm the guy pushing scala adoption, clean code, fixing our abstractions, etc. i'm also less valueable to the business over the one-year timeframe that dictates my comp because of it. The only people incented to relenentlessly care about things like technical debt are those with equity.
I'm mostly thinking about programming in the small: methods, classes, parameter lists, that sort of thing. Essentially complex problems can't (and shouldn't) be solved up front, but that doesn't imply the internals of that partially-solved problem should be disorganized, or that the API is inconsistent. I find that if I explicitly scope my work as I'm doing it, I can write good code to fuzzy specs, without over-generalizing, relatively quickly. Plus, coming back to it a couple months later (well within the typical employee-raise timeframe), I can fix or modify it much faster.
It's a balance, to be sure, but I think it's sometimes possible to work both faster and better.
Good design keeps things clear in code and in your mind. It can handle changes a whole lot better as well.
5 years ago i was reading code complete and all those books, and whined a lot about all the poorly factored code in its interleaved and tangled glory. I thought I was the best programmer ever and took pride in my perfectly factored little modules. As I get older, I have a lot more respect for my elders and betters - they are solving harder problems than I am, problems that if I had attempted I would have a perfectly factored solution that meets half the requirements. Is it a bitch to maintain all that Java? it sure is, but we're all well paid, and our customers are begging us to bid on proposals we don't even want.
In my experience, this holds true ESPECIALLY when working on existing systems whose behavior you don't understand completely. If you or someone else is the author is irrelevant here.
To get it right you have to screw it up first. The hacked up version may or may not get into production (depends on the scope). What one should do is gain intimate knowledge of a particular system/module and keep up to date with it. When you start implementing something big, you have no idea what it really takes, thus abstractions make no sense. Just use the goddamn duct tape and zipties. Then fix it as you figure out how it ought to be - and don't fret over it, you WILL change it again tomorrow.
But one should always strive to do it as right as possible, given the current circumstance. One should also
Good software is grown and it takes time, knowledge and patience. I liken it to drawing Silicon mono crystal for semiconductor waffers.
With that said, point taken.
EDIT: closures > closings
- UITableView approach is megalomaniacal, could use some love.
- XCode sometimes sends you straight to the subclassing hell. Specially if you don't have a well defined model before you start dragging stuff into your storyboard.
- Lots of iOS SDK classes will help you into taking the anti-pattern road. For instance: UIView:UIResponder.
This. Especially for bugs. If I don't know why its fixed, I haven't fixed the cause - I've fixed a symptom.