📜 ⬆️ ⬇️

So, the manager asked to fix the bug ...


You have been here before. Your program is elegant. You used exactly the required number of abstractions. Your modules are flawlessly modular. Your system deals with the outside world through thoughtful interfaces and has no direct dependence on external systems. Your tests passed immaculately. Your test coverage report requires a full minute to download. 97% that means ...

Life is Beautiful. And then something happens.

The grocery manager breaks in and says that a bug was found in the update you sent last week. Whenever a user adds a position to his shopping basket, the counter, which is designed to display the number of positions in this basket, is updated only after a few seconds. And before the update occurred instantly.

The manager reports that complaints from users are streaming. And he asks: "Can you see?".
')
Of course you can look. In the end, it was you who created this product. It is most likely someone else’s fault. But you are going to fix the error. This is part of the work of a kind of "crisis" employee, which you are.

You pull Git hash from the most recent release and delve into the changelog. You have updated the HTTP request library to the latest version in the latest release. This has been postponed for quite some time. You may recall the commit that led to this. It was a good day.

You switch to a commit, then simulate a query that updates the shopping basket. It is good that you have such a clear division of tasks. You can easily conduct a test on the secondary and production servers with the promotion of the build flag.

You found a criminal. It looks like the HTTP library that you updated has a defect. For certain types of requests, it takes quite a long time to analyze incoming content in JSON format. Your application can update the shopping cart counter user interface only after the query content has been analyzed. The infrastructure is not configured to handle possible consistency and add what could be a separate project in and of itself. You cannot simply update the meter locally and synchronize later.

You know that someone, not you, made a mistake. That is life.

You inform the manager about what happened. He compliments you. He says that, of course, he always knew that you could be relied upon. He asks, is it known how to eliminate this bug?

Well, of course! You have already reviewed all the possibilities.

Roll back to change is not possible. All new code and bug fixes are tied to the new version of the library. You will also lose them all if you simply roll it back.

Just forking this library and working with your own copy is also not a sensible idea. The operational staff of the original project has a gigantic test infrastructure that will test your fix on thousands of devices. You also have three devices, two of which are outdated versions of the operating system. It is best to get feedback from them as well. This is, after all, their library, and they should know its structure, not you.

So, the actions are planned:


Everything is elementary, Watson!

“Great,” the manager tells you. "How much do you think it takes time?"

You know the answer. Some think that technical specialists are unable to estimate time. But you are definitely not from such specialists.

"2 weeks" - without hesitation you answer. "It depends on how quickly the request to include the code will be received and how quickly the operating personnel will issue a new assembly."

The face of the manager in his eyes whitens. "2 weeks? 2 weeks?!". He continues to repeat these two words, as if they could change something. But you remain calm. Managers, as you know, weak guys can boil. You do not have to worry about it.

“Our users will leave us! They do not buy anything because they do not see what is happening with their baskets! We are a company that sells through the Internet! It's impossible!".

You watch him go through 5 stages of despair. You wait until he finally agrees. But this is not happening. He seems to be trying to extrude.

“Is there really no way to fix it faster?” Well, maybe something temporary? Well, think! It is very important!".

“Good,” you say, dropping into your swivel chair. "Let me see."

You give him a little. Maybe then he will leave you alone. You have many other things to do, you know that.

You are again immersed in the source. You are in your element. Your fingers move around the IDE icons, like God Poseidon gliding along the waves of the ocean.

ABOUT! You found him. There is an undocumented way to enter the JSON analysis program and replace it with your own development!

But wait. This can be dangerous. Here, the application programming interface is non-public. Perhaps it is wrong to do with him as you suggested. You don't want to go for it. What if the next issue fixes an error? Then you have to do it all over again. Does anybody want? Although it is faster than maintaining your own, untested, branch of the library. Again, this is dangerous.

Not!

You will not allow dubious business decisions to destroy your temple of purity. You are the guardian of all holy in the fight against ignorant masses. After all, for this you pay a lot of money. Your duty, in such a situation - to refuse.

You quickly enter the nick of the manager: “I tell you, no! There is no clear way to do this, and I cannot rely on unsafe hacker tricks. I'm sorry. "

He reacts as expected.

“You say that there is a way to solve the problem, but you will not do it, because the way turns out to be impure ? Our users literally shout at us, threaten to leave to our competitors, and you do not want to eliminate the bug, because the way is unclean ?! ”

You lose control of yourself.

What does this guy know about program design? You created fantastic worlds from nothing but bits. Superbly scalable systems that can withstand the DDoS attacks of all computer hackers of the former Soviet bloc, created by you. You are an artist, and the computer is your canvas. You have read the book “Clean Code” by Robert Martin so many times that you know it better than even your own GitHub passport.

"Yes!" - You break down. “I'm not messing our code base with this shit! I spent the months of my life creating this palace! Each line of code captures my pain and blood! The only reason why here, in general, something works is that everything was done not because of you, but in spite of you. Just like me, they ensure the operation of all these programs, and just like me, they will have to clean up this mess for a long time after you and your “business processes” leave! ”

You fly out of the corner. Drink something. Guys like this one are just a disaster for our industry. They think that their trendy business masters' degrees give them some insight into creating serious software, which the developers for some reason forgive. We must fight them back.

You go to a cafe. Where you get gourmet meals every day. And coffee. Delicious, soul caressing coffee - without any restrictions. You deserve it because you are a highly qualified specialist .

You take a cup of coffee and see where to sit.

And here you see it .

The most respectable specialist in our company.

This person belongs to the cool, uncompromising specialists like "I-can-write-compiler-for-5-minutes." He was a hacker before hackers appeared. You want to be like him. It kind of looks like the magician Gandalf from Tolkien’s books. Everyone respects and fears him at the same time. But he is kind and always helps out children. He will definitely want to hear how you put this manager in his place. In the end, he - one of the representatives of your shop.

And you sit next to him. He slowly drinks his coffee and reads something like "Abstract data types in Haskell."

Yes. Just a colleague to talk.

You tell him your epic. He listens patiently. He nods and asks a few questions. His body is calm and relaxed. He has been here before. You can see it in his eyes.

You are finally done.

It was tiring.

You dropped the load from the shoulders.

He looks thoughtfully, as if he carefully chooses words.

You expect him to laugh out loud. He will exclaim: “Yes, my boy!” - and then you will drink another cup of coffee together. He will entertain you with the story of a similar scolding, which he asked a stupid manager a hundred years ago.

You dreamed about this day. You will knock your coffee cups together as men do after winning a battle. At least that’s what they do in movies. And, of course, they have - not cups, but mugs, and in mugs - beer, not coffee.

This is sentimentality, although it matters.

Are you waiting…

And still waiting, and more ...

He looks you straight in the eye. His gaze penetrates your soul. The long years of clashes with cars gave his eyes hardness. And he carries a fascinating power. You can not look away.

He utters quite a bit.

“Your job is not to drink coffee and shy away from writing code. Your job is to make programs that work. ”

Then he leaves.

You sit a minute. There is an unpleasant sensation in the stomach. Feeling of emptiness and nausea. You begin to understand what a sensation is. You are ashamed.

You have failed the people to whom you owe the most. Your customers.

And you go back to your computer. You quickly hack the program, then delete the latest release.

You apologize to the manager: "Sorry, friend, things are a little out of control." He says it's all right. All is well that ends well.

You also output the library to a separate branch, fix the bug, and send it to the product manager located hierarchically above. When a new release of the library with the right decision comes, you can always redesign the software .

Source: https://habr.com/ru/post/310310/


All Articles