У нас вы можете посмотреть бесплатно Java Clean Code Tutorial #4 - Avoid Boolean Parameters (Flag Arguments) или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Episode 4 of the free Java Clean Code Training Series. Why should developers avoid Boolean method parameters? (Also known as Flag Arguments) When you use Boolean parameter you are openly saying that the method does more than one thing. Good methods should only perform one thing, and perform it well. It is also unclear from the API what the Boolean flag represents and the majority of the time developers will need to open up the java class to inspect its behaviour and meaning. Boolean flags make the methods intention unclear to the developer. How to mediate the problem? a) Split the method with the Boolean parameter into two methods and give them descriptive names. This will make the code easier to read and work with. b) If you cannot split the method due to existing complexity and technical debt, then you should create the two new methods and call the existing method with the hardcoded Boolean parameter. c) Refactoring the method into smaller methods is also a third option. Ultimately this simple design pattern Increases the use-ability, maintainability and readability of code when calling methods. Software is written once and read hundreds of times. So let’s make our fellow developers life easier. Why clean code? Simple. Clean code allows us to confidently make changes and deliver more features quickly to our customers. Don’t forget to subscribe for your regular dose of Java Tutorials! STOP THE ROT. Till episode 5, Philip