S
S
Sadrutdin Zainukov2017-09-12 20:22:40
Java
Sadrutdin Zainukov, 2017-09-12 20:22:40

How to improve code readability (many if statements)?

Here I implement the Telegram API. There are SO MANY if statements. How to reduce? What pattern can be used?6a74c438ef794e879d59eeecd8247e01.PNG

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
Lander, 2017-09-12
@usdglander

There are no patterns here, but refactoring is needed. For example "method selection".

P
PqDn, 2017-09-19
@PqDn

Do not consider those for PR, but read my article on Habré, I just described the applicability of DI in the development of a bot.
https://habrahabr.ru/post/335490/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question