In the last issue of DNC Magazine, I wrote about Software Gardening: Using the Right Soil. As a quick review, soil is good Agile practice. Here are the four tenets from the Agile Manifesto:
- Individuals and Actions over processes and tools
- Working software over comprehensive documentation
- Customer collaboration over contract negotiation
- Responding to change over following a plan
Agile is an excellent guideline and is a key part of Software Gardening. But there is one problem here. Do you see it? Go ahead, read the four points of the Agile Manifesto again. In case you did miss it, the Agile Manifesto in reality has nothing to do with actually writing code. The Manifesto is all about project management.
This article is published from the DotNetCurry .NET Magazine – A Free High Quality Digital Magazine for .NET professionals published once every two months. Subscribe to this eMagazine for Free and get access to hundreds of free tutorials from experts
For Software Gardeners, we need something that helps us write better code. It turns out; this problem has already been put forth by people who also realized the Agile Manifesto tells us nothing about how to write code. They came up with a manifesto to do just that. It’s called the Software Craftsmanship Manifesto. This is the water for Software Gardeners.
Before we get into the manifesto, let’s look at what defines a craftsman. In medieval times, a person had to go through a series of steps to earn a title befitting a craftsman. Often times that person would start out as an apprentice, then perhaps move to a journeyman level, then on to something else, and eventually become and expert or craftsman.
Often times this path was part of a guild. According to Bing Dictionary, a guild was a “medieval trade association: an association of merchants or craftspersons in medieval Europe, formed to give help and advice to its members and to make regulations and set standards for a particular trade.”
Even today, in some industries, to become a craftsman, you have to go through a similar path. For example, in the USA, to become a carpenter, electrician or plumber, you will often join a union (the modern version of the old-time guild), and progress through a series of levels before becoming a Master Carpenter, Master Electrician, or Master Plumber.
A Master is someone who is highly skilled in their profession. The term craftsman means that and more. A craftsman is someone who is seen as taking great pride in their work. Look at someone who makes furniture as a hobby. This person keeps refining their skills to the point that not only is the furniture sturdy and well built, but the designs carved into the wood are intricate, elegant, and beautiful.
The idea of a Software Craftsman comes directly from the concept of guilds and apprentices. Wikipedia tells us, “The movement traces its roots to the ideas expressed in written works. The Pragmatic Programmer by Andy Hunt and Dave Thomas and Software Craftsmanship by Pete McBreen explicitly position software development as heir to the guild traditions of medieval Europe.” (If you were with me in my first column here in DNC Magazine titled Software Gardening: Software is Not a Building, the concept of Software Gardening traces its roots back to The Pragmatic Programmer.) Here’s a picture of a Craftman’s shop in the Witte Museum in San Antonio, TX.
Now, without further ado, here are the four tenets of the Software Craftsmanship Manifesto. As you read them, pay attention to how they intertwine with the Agile Manifesto:
- Not only working software, but also well-crafted software
- Not only responding to change, but also steadily adding value
- Not only individuals, but also a community of professionals
- Not only customer collaboration, but also productive partnerships
Let’s look at each one in more detail to learn what Software Craftsmanship is all about.
How many projects have you had that is new development? How many that are enhancing an existing application? If you do more new development than maintenance, you’re one of the lucky few. Most of us work far more on existing applications. And we always hate the code and come to say bad things about the person that originally wrote the code, often times that person was yourself.
But there is a better way. If we write the code to be more maintainable in the beginning, the maintenance would be easier. This means interfaces, small methods, single purpose classes, and more. I’ll discuss these topics and more in future columns.
Steadily adding value
When you have to add code to that poorly written module, do you cram the new code in or do you rework the old code so that it’s better? The Boy Scouts have a rule to leave the campground better than they found it. A good software craftsman should leave modified code better than he found it.
Community of professionals
Do you learn from others? Do you help others to learn? Do you encourage good practices? Do you attend user groups, conferences, code camps, etc? Do you have any non-work friends that are also developers? If so, do you talk about how to improve your skills? Do you read blogs and magazines? Do you keep abreast of new technologies or techniques? You should, if you wish to become a Software Craftsman.
Are you a detriment to your coworkers? What about your customers? How about your employer? Do you want to help them out? Do you want to help them solve their business problems? Do you do this by delivering the code as quickly as you can or do you work to have a low bug count and well-crafted code so that it will be easy to maintain.
Agilitrix lays out these four areas in quadrants that make it easy to see and understand.
Image Courtesy: Agilitrix
There’s another aspect to Software Craftsmanship that we can’t overlook. Returning to Wikipedia’s entry of Software Craftsmanship, we read in the first paragraph, “Software craftsmanship is an approach to software development that emphasizes the coding skills of the software developers themselves. It is a response by software developers to the perceived ills of the mainstream software industry, including the prioritization of financial concerns over developer accountability.” What this tells us is the industry typically puts money as more important than making the developer responsible for what he/she does. I don’t totally agree with quote from Wikipedia. Keeping the financial needs of the business is extremely important. But as developers, we need to be accountable for what we do. That includes the financial side of the business, the costs of development, as well as doing high quality work. My advice, make sure you understand business basics in general and more specifically your customer’s or employer’s business model and policies.
At this point you may be wondering how you can become a Software Craftsman. The short answer is, I’m not sure most developers ever do. There seems to always be a new language or technique to master. The long answer is you have to take the route of those people from medieval times. You need to learn, practice, and re-learn. You need to teach others as well as learn from them. And don’t forget to learn about not only business in general, but about your customer’s business or the business where you’re employed. At each step of the way, you need to apply what you know. When you make mistakes, you need to understand what was wrong and then not do it again.
Now that I’ve covered what Software Craftsmanship is, I need to give you a warning. A Software Craftsman also knows when to do the simplest thing. It becomes easy to over-engineer a solution and this is just a bad as writing bad code. K. Scott Allen addressed this in a recent blog post.
In his post, Scott goes through an example that applies Software Craftsmanship guidance and shows how easy it is to over-engineer, then give the simple solution that turns out is easier to write, read, test, and maintain.
In the first paragraph of his post, Scott also says, “Sometimes people will approach me and ask “what is it like to be a software craftsman?”. I’ll usually answer with: “Pffft, don’t ask me, I just cranked out 500 lines of script that are harder to read than Finnegans Wake”. At times though, I like to pretend what it might be like to be a software craftsperson.”
Like Scott, I see myself as an aspiring Software Craftsman. I work every day to improve my skills and knowledge. If you head down this path, you too can become an aspiring Software Craftsman and begin to water your software. After all, it’s a good thing to have software that is green, lush and vibrant.
This article has been editorially reviewed by Suprotim Agarwal.
C# and .NET have been around for a very long time, but their constant growth means there’s always more to learn.
We at DotNetCurry are very excited to announce the The Absolutely Awesome Book on C# and .NET. This is a 500 pages concise technical eBook available in PDF, ePub (iPad), and Mobi (Kindle).
Organized around concepts, this eBook aims to provide a concise, yet solid foundation in C# and .NET, covering C# 6.0, C# 7.0 and .NET Core, with chapters on .NET Standard and the upcoming C# 8.0 too. Use these concepts to deepen your existing knowledge of C# and .NET, to have a solid grasp of the latest in C# and .NET OR to crack your next .NET Interview.
Click here to Explore the Table of Contents or Download Sample Chapters!