5 Tips to Write Effective Code in Enterprise Organizations
Writing code in enterprise organization is a different beast compared to startups
Writing code in an enterprise organization is very different than writing code in a startup. It will all feel like a tangle of wires getting connected to arbitrary places.
Challenges
Now you may not face all these challenges in your team or organizations. You will have 1 or 2 of these in your organization.
Below is a list of some of the challenges you might face working in enterprise systems.
Legacy Code
There will be years of legacy code. Typically, the project you will be working on will be some transformation that will improve the customer journey despite all the complexity of legacy code.
Some legacy code will not be accessible to you. Another team or even a different organization might be managing the legacy system.
Lack of Tests
You will find no integration tests between the new framework and legacy systems. The knowledge of the legacy system will be concentrated within a few individuals who will always be hard-pressed for time.
You can write tests for your code but you are never sure of the impact of the changes when it goes live.
Constant changes
The code is in always a state of change. The scale of change will not be limited to your team or the systems you are interacting with. There will be changes happening across different systems at the same time.
You need to know into what batch of release your change will go to production.
Communication
You have architects, business analysts, and solution designers always writing documents and discussing requirements.
Each solution needs to go through multiple rounds of review so that everyone knows what are the changes and if there is any impact on other systems.
But the complexity of the changes means, requirements get missed, or certain new scenarios are created which get missed.
Processes
As the system is always in a state of change, owners of different systems try to minimize the chance of something breaking in production.
They are accountable for their system to keep on working without the new changes causing any harm to their systems.
What that means is, there will be multiple gates before your code goes live in production. These processes are present to minimize the risk of the code going to production.
You will have things like Change Control Boards, Change Management Systems, and different layers of testing.
It will feel like forever to get any change in production.
So how do you get across these challenges?
The best way to write code in this complex system is to understand the system. Now that will take time time and it is not an overnight thing.
You also cannot first understand the system and then begin writing code.
Both understanding the system and writing code go hand in hand.
The more you write code, the better you understand the system.
The more you understand the system, the better you write code.
So here are the tips for writing better code and understanding the system:
Get the birds-eye view
The first step would be to look to understand the architecture of the systems. Now this will not make sense initially.
But as you build features looking at the architecture will enhance your understanding of what’s happening.
Read available documentation. Some of them might be outdated. But it will get you started.
Discuss the requirements with business analysts and solution designers as that will give you a bigger picture of how the requirements tie together with the rest of the systems.
This is not a one-time activity and you need to iterate all the time to get better insights on the system.
Write more tests
Find snippets of untested code and add more tests.
Reading code is a passive activity.
However, writing tests will enhance your knowledge of the existing code and what are the scenarios the code is handling.
It will also help other developers as they can then rely on your tests.
Refactor Code
Work on improving the code.
Identify and fix code -smells.
Implement applicable design patterns.
Remove existing code duplication.
These activities will uncover hidden bugs and issues.
Fixing them involves going back to business analysts, and quality engineers to find the correct behavior.
Collaborate with testers
Enterprise organizations will have teams doing testing.
The testers have knowledge of different systems as they test and find new scenarios with each increment of changes going to production.
The knowledge they have would be from testing the system and not from the documentation which would have become outdated by the time the feature would have gone live.
Working with the testers will help you gain an understanding in a fraction of the time that they would have spent gaining the knowledge.
You can then enhance your tests to cover those scenarios so that that knowledge gets captured in your systems.
Troubleshoot Issues
Never lose an opportunity to troubleshoot issues.
Issues are the biggest opportunities to learn the most about the system in a very short time.
Working on issues means collaborating with different teams, understanding the different scenarios, and fixing the issue.
You can then incorporate the tests back into your system and thus capture the knowledge into the system.
📣 Shoutouts of the week
Top 3 SWE Skills I Picked Up On The Job by
: The skills he mentions are useful in any organization you work with.Getting your message across with ease by
: Learning to communicate is a lifelong journey. She has provided some practical tips to incorporate in daily life.To Design or Not To Design? by
: An essay on design for startups in different stages.
Thanks for the shout out Dishit. You are doing some great work for Devs!!