1 of 38

THE PATH

THROUGH LEGACY

DELICATE BALANCE BETWEEN TOLERANCE AND PHOBIA

MAXIM NAM

Head of Frontend Development�Tele2 Kazakhstan/Altel Digital

2 of 38

OUR PROJECTS

3 of 38

OUR PROJECTS

4 main �mobile apps

4 of 38

OUR PROJECTS

10+ web apps

4 main �mobile apps

5 of 38

OUR PROJECTS

150+ microservices

4 main �mobile apps

10+ web apps

6 of 38

Ancient architecture?

PROLOGUE. LEGACY TODAY

7 of 38

  • Ancient architecture;

Board �game saves?

PROLOGUE. LEGACY TODAY

8 of 38

  • Ancient architecture;
  • Board game saves;

3-year old �react project?

PROLOGUE. LEGACY TODAY

9 of 38

WHAT IS LEGACY CODE?

10 of 38

- Old code?

- Nope.

WHAT IS LEGACY CODE?

11 of 38

WHY" we write code �that might end up as legacy?

WHAT IS LEGACY CODE?

12 of 38

Black box�&

Difficult �to extend

CHARACTERISTICS

13 of 38

No documentation

CHARACTERISTICS

- Black box;

- Difficult to extend;

14 of 38

CHARACTERISTICS

Deprecated packages/entire technology

&

Self-written unnecessary dependencies

- Black box;

- Difficult to extend;

- No documentation;

15 of 38

- Black box;

- Difficult to extend;

- No documentation;

- Deprecated packages/entire technology;

- Self-written unnecessary dependencies;

CHARACTERISTICS

No testing infrastructure�&�No standards at all

16 of 38

The answer is outside of the actual coding process and implementation aspect.

THE ANSWER OF ”WHY?”

17 of 38

THE ANSWER OF ”WHY?”

The answer is outside of the actual coding process and implementation aspect.

Business side of things.

18 of 38

THE ANSWER OF ”WHY?”

The answer is outside of the actual coding process and implementation aspect.

Business side of things.

Write it fast and revisit later.

19 of 38

THE ANSWER OF ”WHY?”

The answer is outside of the actual coding process and implementation aspect.

Business side of things.

Write it fast and revisit later.

The key is acknowledging the problem in time.

20 of 38

The old code might look ugly messy, but it works.

It is hard to read code and understand so we have the impulse to completely avoid it.

Preparation:

- Understanding of previous business logic and edge;

- Reading documentation.

CHAPTER 1: �REFACTOR VS REWRITE

21 of 38

All developers agree but few do.

Antipatterns:

- Keep everything in your head, hoping you remember someday;

- Let’s write a novel approach just for the sake of writing.

Explaining how and why in your repository documentation may be goal.

CHAPTER 2: DOCUMENTATION

22 of 38

All developers agree but few do.

Antipatterns:

- Keep everything in your head, hoping you remember someday;

- Let’s write a novel approach just for the sake of writing.

Explaining how and why in your repository documentation may be goal.

CHAPTER 2: DOCUMENTATION

23 of 38

All developers agree but few do.

Antipatterns:

- Keep everything in your head, hoping you remember someday;

- Let’s write a novel approach just for the sake of writing.

Explaining how and why in your repository documentation may be goal.

CHAPTER 2: DOCUMENTATION

24 of 38

A PIECE OF CODE MIGHT WORK BUT IT IS DEAD NOT USEFUL ENOUGH IF YOU CAN’T EXTEND IT.

CHAPTER 3: EXTENDIBILITY

Our codebase

25 of 38

CHAPTER 3: EXTENDIBILITY

A piece of code might work but it is dead not useful enough if you can’t extend it.

CODE ISOLATION IS NOT A PERMANENT SOLUTION.

Our codebase

26 of 38

CHAPTER 3: EXTENDIBILITY

Our codebase

A piece of code might work but it is dead not useful enough if you can’t extend it.

Code isolation is not a permanent solution.

HARD-TO-DELETE CODE DRIVES OUT EASY-TO-DELETE CODE OVER TIME.

27 of 38

The code you write today is old code by tomorrow

CHAPTER 4: PRACTICAL IMPLEMENTATION

28 of 38

- The code you write today is old code by tomorrow;

CHAPTER 4: PRACTICAL IMPLEMENTATION

How we write code and with what intention

29 of 38

- The code you write today is old code by tomorrow;

- How we write code and with what intention;

CHAPTER 4: PRACTICAL IMPLEMENTATION

We want to help future developers not to struggle with our codebase

30 of 38

- The code you write today is old code by tomorrow;

- How we write code and with what intention;

- We want to help future developers not to struggle with our codebase;

CHAPTER 4: PRACTICAL IMPLEMENTATION

It’s easier to fix code that is repeated than code that is abstracted in the wrong way

31 of 38

- The code you write today is old code by tomorrow;

- How we write code and with what intention;

- We want to help future developers not to struggle with our codebase;

- It’s easier to fix code that is repeated than code that is abstracted in the wrong way;

CHAPTER 4: PRACTICAL IMPLEMENTATION

Testing infrastructure

32 of 38

GENERAL TEST: �Anyone in your team can make changes throughout the codebase, newcomers can at least navigate.

HEALTHY SIGN: �Your codebase doesn’t depend on one single person.

ETHICAL ASPECT: �Detatch your ego from the code.

CHAPTER 5: �AFTER EFFECT

33 of 38

Do not expect quick results

EPILOGUE

34 of 38

Incremental progress is key

EPILOGUE

- Do not expect quick results;

35 of 38

Well-documented updates

EPILOGUE

- Do not expect quick results;

- Incremental progress is key;

36 of 38

Focus on refactoring

EPILOGUE

- Do not expect quick results;

- Incremental progress is key;

- Well-documented updates;

37 of 38

Don’t attach yourself �to particular codebase

EPILOGUE

- Do not expect quick results;

- Incremental progress is key;

- Well-documented updates;

- Focus on refactoring;

38 of 38

Thx! See you!

Changing the rules, expanding opportunities

Technological like you

MAXIM NAM

Head of Frontend Development�Tele2 Kazakhstan/Altel Digital