Behind The Code — How to Develop Using The Force
As software developers, certain actions we take cause transformative results that go beyond what we expect. It’s like THE FORCE.
With the relatively recent release of “Star Wars: The Force Awakens,” I can’t think of a better time than now to talk about the forces at work in software development.
Iteration — “If no mistake have you made, yet losing you are ... a different game you should play.”
One of the most important principles of Agile development is delivering working software, frequently. It almost always helps a project and its team make visible progress together.
The problem of deploying to production should be solved immediately.
Transparency — “The dark side clouds everything. Impossible to see the future is.”
Software systems will fail, so make failure work for you. Failure in and of itself is not the dark side, blindness is. Big contributors to blindness are inefficient logging systems and poor/non-existent exception handling. Configurable logging systems ensure that problems are visible when they occur.
Testing — “Adventure. Excitement. A Jedi craves not these things.”
Quality can be improved greatly with testing. Testing should be a team-level process and its quality should be maintained and enforced by someone other than the developer.
The developer’s goal is to make a product that meets its requirements in the most efficient way and “efficient the process of testing is not.”
Refactoring — “Train yourself to let go of everything you fear to lose.”
People hang on to code. Developers that enter someone else’s project are afraid to replace code or remove cruft. Little things like clarifying a function name can have a big impact.
Refactoring can expose unknown problems and open communication with your team about refactoring opportunities can help mitigate risk.
Modularity — “Laugh it up, fuzzball!”
The Han Solo quote has little or nothing to do with modularity but it’s one of my favorites so I wanted to include it somewhere.
Modularity is helpful but can lead to the dark side if it’s not managed carefully. Too much of it can create a “can’t see the forest for the trees” situation.
Large functions can be problematic. Scrolling up and down a lot while writing or debugging code indicates that you can probably extrude code into a new function. Simply doing this makes functionality much clearer.
Recursion — “The Force is strong with this one.”
Recursion can be used in very powerful ways to build things with very elegant simplicity. But…
It can also be confusing and very hard to test. In general, future developers will avoid dealing with it when built by someone else. This avoidance creates dead zones in the code.
If you are going to use recursion make sure it is encapsulated by a clear and protective API. Put comments into the code so that future developers have an idea of what’s going on.
Summary — “May the Force be with you.”
Software development is a craft. And just like becoming a Jedi Master it takes time and practice.
I hope this imparted some lighthearted wisdom helps you along the way in your future projects as a developer.
Written by Timothy Heider, Senior Developer
Artwork by Kyle Beck