Refactoring: switch vs if-else vs enum vs HashMap [Command Pattern]

Опубликовано: 28 Октябрь 2020
на канале: MJC
6,998
310

The developer Nastya Borisenko will talk about a typical problem of a large number of if-else. Consider a popular way to solve this problem in java programming and tell you why switch is not a panacea.

Timecodes:
00:00 - In this episode
00:13 - Intro
00:19 - Let's talk about code quality!
01:36 - Funny (no) life story
01:51 - if-else, switch-case
02:13 - Example using if-else
04:20 - Refactoring using switch-case
04:59 - What is the problem with switch-case?
06:16 - What can replace switch?
06:30 - Refactoring using enum
11:50 - Lazy initialization with enum
13:28 - Refactoring with Map
14:15 - Why suggested options are better than switch
15:02 - Subscribe and like

Git Link: https://github.com/NastassiBor/mjc/tr...
________
Subscribe to our social networks:
Instagram:   / mjc.talks  
MJC Telegram Chat: https://t.me/mjcby
Community page: https://mjc.by


Смотрите видео Refactoring: switch vs if-else vs enum vs HashMap [Command Pattern] онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь MJC 28 Октябрь 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 6,998 раз и оно понравилось 310 людям.