YAGNI and human nature

I’m on my development walkabout and it’s been eye-opening.

“YAGNI” stands for an Extreme Programming principleYou Aren’t Gonna Need It

Even though I’ve preached and argued this point myself, I’ve found myself repeatedly violating it as I build my application.

2017-08-09 17_19_49-Weather API by DaneWeber · Pull Request #12 · DaneWeber_MaintenanceApp

Here’s the core of my experience: I’m building an app of my own design and I have ideas for what it might do in the future. When I go to create the very first iteration of some part of it I have to figure out what’s required for the bare minimum. It is so incredibly tempting to use my knowledge of my future plans to inform those decisions. While that knowledge might keep me from making a terrible mistake, more frequently it leads me to create attributes, variables, and methods that I don’t need yet, but that I know I’ll need.

It takes discipline and effort to do the bare minimum. It isn’t a desire to do more work that leads me to over-engineer, but rather a desire to save myself effort in the future.

Of course, even in the short time I’ve been working on this app, I’ve learned so much and drastically refactored significant chunks of it. That refactoring is easier when what is being refactored is simpler. The more complexity I’ve built up the more I have to think through in order to replace it.

I certainly won’t keep my API call as static and hard-coded as it is now, but rather than predicting now how I’ll construct it when I start supporting different cities, etc. (which I did), I should trust my future self to be smarter and better able to figure out the best way to construct the call to accomplish what I need.

YAGNI and human nature

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s