• ClipSaver
  • dtub.ru
ClipSaver
Русские видео
  • Смешные видео
  • Приколы
  • Обзоры
  • Новости
  • Тесты
  • Спорт
  • Любовь
  • Музыка
  • Разное
Сейчас в тренде
  • Фейгин лайф
  • Три кота
  • Самвел адамян
  • А4 ютуб
  • скачать бит
  • гитара с нуля
Иностранные видео
  • Funny Babies
  • Funny Sports
  • Funny Animals
  • Funny Pranks
  • Funny Magic
  • Funny Vines
  • Funny Virals
  • Funny K-Pop

How to code good arguments for your function? скачать в хорошем качестве

How to code good arguments for your function? 5 лет назад

скачать видео

скачать mp3

скачать mp4

поделиться

телефон с камерой

телефон с видео

бесплатно

загрузить,

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
How to code good arguments for your function?
  • Поделиться ВК
  • Поделиться в ОК
  •  
  •  


Скачать видео с ютуб по ссылке или смотреть без блокировок на сайте: How to code good arguments for your function? в качестве 4k

У нас вы можете посмотреть бесплатно How to code good arguments for your function? или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:

  • Информация по загрузке:

Скачать mp3 с ютуба отдельным файлом. Бесплатный рингтон How to code good arguments for your function? в формате MP3:


Если кнопки скачивания не загрузились НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу страницы.
Спасибо за использование сервиса ClipSaver.ru



How to code good arguments for your function?

What are niladic functions? Is it better to use draw(x,y) or draw(Point)? All that and more in today's #QuickAnswer. #programming #tech #softwaredevelopment #developer #sde Clean Code (R. Martin) - US: https://amzn.to/3jVUEDU | UK: https://amzn.to/2Iij4Jz Best Practices for Programmers - US: https://amzn.to/2SPRSEg | UK: https://amzn.to/2Fr2h6e When reading a book about clean code, perhaps written by Uncle Bob - you may find that ideal functions are niladic which means they have no arguments at all. This sounds very controversial or even harsh, but what authors of Clean Code practices want to convey here is the fact that the less arguments your function has - the better. Of course not all functions can be useful without arguments, but, argument (*wink*) can be made, that all functions should be useful with only a few of them, and that number is three. So let’s take a look how different functions are called depending on their argument count. We have: niladic, monadic, dyadic, and triadic functions. Simple enough. But why does this actually matter? Starting with a trivial example: we have a function that takes a filename and includes a header in it: includeHeader(file). Each time you see this function you’ll stop for a moment and think: is this a file handle, file descriptor or filename? How much cleaner it would be to create a class stores the file reference (whatever it is), and offers a simple niladic function includeHeader(). Such function becomes obvious and our eyes just glide through it. This philosophy is easy to follow, but what if it doesn’t make sense to create a separate class just to wrap a one-time use argument? Enter monadic functions. Single-argument functions are usually divided between ones that ask about the argument: meetsPasswordRequiremets(string), or produce a result from the argument: toUpper(string). Recommendation here is: pay attention and pick names that explain this well. One other sin that I see in the code is using output arguments, instead of the return value. Mentioned before toUpper(str) should never be an in-place function, as the produced string is transformed into a totally new form. Third case brought to my attention by Robert Martin are flag arguments. Here, let me give you an example you may encounter in the wild: draw(true) Can you tell immediately that the function signature is actually draw(boolean inFrame)? Of course you can’t, but if you had two functions: drawInFrame and drawInView - it would be obvious, wouldn’t it? Dyadic functions should follow all the rules we mentioned before and more. Function could have less arguments when some of them are more related to each other than to the function itself. Let’s get back to the previously used name: draw(x,y). This could be wrapped in an object: draw(Point(x,y)). Such code is easier to reason about in simple cases, and will be much better with more complex things... Like drawing a rectangle, or a cube. Quote straight from the Clean Code by Robert Martin says: Even obvious dyadic functions like assertEquals(expected, actual) are problematic. How many times have you put the actual where the expected should be? The two arguments have no natural ordering. The expected, actual ordering is a convention that requires practice to learn. Triads give us way more room for errors and misinterpretation of argument ordering. General recommendation here is to avoid them wherever you can. Good luck with your refactoring, subscribe, and I’ll see you in the next one, cheers!

Comments
  • What is YAGNI coding rule, and why it helps? 5 лет назад
    What is YAGNI coding rule, and why it helps?
    Опубликовано: 5 лет назад
  • Which comments in your code ARE GOOD? 5 лет назад
    Which comments in your code ARE GOOD?
    Опубликовано: 5 лет назад
  • Избегайте наследования при разработке ООП-программного обеспечения? 5 лет назад
    Избегайте наследования при разработке ООП-программного обеспечения?
    Опубликовано: 5 лет назад
  • Modern CMake for C++ 3 года назад
    Modern CMake for C++
    Опубликовано: 3 года назад
  • Learn Programming: Quick Answers
    Learn Programming: Quick Answers
    Опубликовано:
  • What is DRY in programming and why it matters? 5 лет назад
    What is DRY in programming and why it matters?
    Опубликовано: 5 лет назад
  • Economist explains what happens after AI takes all jobs 2 дня назад
    Economist explains what happens after AI takes all jobs
    Опубликовано: 2 дня назад
  • Learn Modern C++23
    Learn Modern C++23
    Опубликовано:
  • What is Clean Code? 5 лет назад
    What is Clean Code?
    Опубликовано: 5 лет назад
  • Начало большой войны / Ликвидация главнокомандующего армией 1 час назад
    Начало большой войны / Ликвидация главнокомандующего армией
    Опубликовано: 1 час назад
  • Learn Programming: Smok Dev Workshop
    Learn Programming: Smok Dev Workshop
    Опубликовано:
  • ЧТО, черт возьми, такое UML? 5 лет назад
    ЧТО, черт возьми, такое UML?
    Опубликовано: 5 лет назад
  • I got hired at Google as a Staff Engineer! 3 года назад
    I got hired at Google as a Staff Engineer!
    Опубликовано: 3 года назад
  • OpenAI is Suddenly in Trouble 7 дней назад
    OpenAI is Suddenly in Trouble
    Опубликовано: 7 дней назад
  • This Nextcloud Alternative Caught Me Off Guard 1 час назад
    This Nextcloud Alternative Caught Me Off Guard
    Опубликовано: 1 час назад
  • What is “spaghetti” code? 5 лет назад
    What is “spaghetti” code?
    Опубликовано: 5 лет назад
  • Google's Return to Office (RTO) 3 года назад
    Google's Return to Office (RTO)
    Опубликовано: 3 года назад
  • OpenAI & Google Just JOINED FORCES - Staff Demand “No Killer AI” 11 часов назад
    OpenAI & Google Just JOINED FORCES - Staff Demand “No Killer AI”
    Опубликовано: 11 часов назад
  • GPT-6 Is Closer Than You Think… Here’s What Changes Everything 1 день назад
    GPT-6 Is Closer Than You Think… Here’s What Changes Everything
    Опубликовано: 1 день назад
  • Interview question: your first 90 days as tech lead 3 года назад
    Interview question: your first 90 days as tech lead
    Опубликовано: 3 года назад

Контактный email для правообладателей: u2beadvert@gmail.com © 2017 - 2026

Отказ от ответственности - Disclaimer Правообладателям - DMCA Условия использования сайта - TOS



Карта сайта 1 Карта сайта 2 Карта сайта 3 Карта сайта 4 Карта сайта 5