Sunday, February 14, 2021

The difference between a developer and an architect

I encountered the term software architect about 15 years ago while I was a developer in small company. At that time I found it very weird to actually have this type of co-worker. It wasn't long before the architect himself felt the same way. Later on when I met him again he explained that a small company doesn't need an architect.
Nowadays I'm doing more architecture work that actual developer's work and finally decided to try and explain the differences. I must first give a warning about generalization, I've encountered many developers who do better architecture than the architects in their team, but the majority needs the architects' guidance.
I'll begin with a code sample I got from a developer not so long ago:

interface IExporter {
void Export();
OperationMode GetOperationMode();
}
interface IImporter {
void Import();
OperationMode GetOperationMode();
}

The code was working perfectly. From the developer's point of view it was "mission completed" - everything passes. Luckily it had to pass by me too. After trying to understand why both the import and export contain an implementation of the same function I found out the following:

abstract class ImportExportBase {
serialize / deseialize functions
public OperationMode GetOpertaionMode();
}

The developer saw an existing base class, and without fully understanding the meaning of the base class add a new 5th leg to the frog. At this point I stepped in defining the architecture as follows:

interface IExporter {
void Export();
}
interface IImporter {
void Import();
}
interface IOperationModes {
OperationMode GetOperationMode();
}

Explaining to the developer he has to align the code to the defined interfaces, and use the interface in the base class if needed without making the function public. I have to admit that it was a result of my misbehavior - letting the developers write code before the architects' define the API is not fair to say the least.
Unfortunately, as I experienced 15 years ago too, in most cases architects are not involved correctly. Instead of making sure the program will be easier to maintain / debug they find themselves trying to decouple the hog's nose from the giraffe's hind leg because no architect was available when it was developed. To add insult to injury, the customer doesn't understand why should the leg sniff the air, even if there's no way it will sniff the fresh air. It took me half a day to explain to a customer that it's easier to read the data from the device itself than "reading the data from the device and manually typing the same data from the device by someone who reads it" - luckily for me, in that case I had architect's help.

To summarize it to a one liner:
The difference between a developer and an architect is in the scope of the system, an architect has to look at the macro-level - interfaces and public functions, while a developer has to look at the micro-level - make the implementations as efficient as possible and find ways to re-use the code without exposing it.

No comments: