No episódio de hoje discutimos o impacto do uso excessivo de if/else, switch/case, for, while, na legibilidade e complexidade do código. Quais as técnicas você utiliza pra diminuir o uso destas estruturas? Conhece o Padrão Null Object? Guard Clause? Pattern Matching? Aperte o play!
Participantes
Marcio Frayze David
marcio@segunda.tech
https://segunda.tech
https://masto.donte.com.br/web/accounts/138458
https://twitter.com/marciofrayze
Julianno Martins Silva
juliannoms@gmail.com
Código Haskell para calculo da sequência de Fibonacci
fib :: Integer -> Integer
fib 0 = 0
fib 1 = 1
fib n = fib (n-1) + fib (n-2)
Links:
https://m.youtube.com/watch?v=AnZ0uTOerUI
https://java-design-patterns.com/patterns/null-object/
https://martinfowler.com/articles/replaceThrowWithNotification.html
https://refactoring.com/catalog/replaceNestedConditionalWithGuardClauses.html
https://fsharpforfunandprofit.com/posts/expressions-vs-statements/
https://segunda.tech/posts/2020-06-25-oo-design-patterns-serpro/
https://wiki.haskell.org/The_Fibonacci_sequence
https://medium.com/better-programming/refactoring-guard-clauses-2ceeaa1a9da
https://enterprisecraftsmanship.com/posts/fail-fast-principle/
https://medium.com/coding-blocks/tail-call-optimization-in-jvm-with-kotlin-ebdf90b34ec9
https://medium.com/97-things/enums-are-classes-too-bfdd2030cf1d