CoursesAI WorkshopCompaniesPricingBlogConfAiBotSign inSubscribe
  • Courses
  • AI Workshop
  • Companies
  • Pricing
  • Blog
  • ConfAiBot
Subscribe
  • Courses
  • Companies
  • Communities
  • Blog
  • Gift card
  • Help
  • Shop
  • ConfAiBot
  • Contact
  • Legal notice
  • General conditions
  • Privacy policy
  • Cookies policy

Multiple Returns in a Function: Good or Bad? - #Refactoring

24 December 2015 | screencasts

Why can it be bad to have multiple return points in a function? It is commonly said that "there should only be one return in a function." In this video, we will analyze the reasons behind this mantra and see why, to this day, it lacks foundation in most scenarios :)

Here is the link to the StackOverflow post mentioned in the video to delve deeper into the topic: "Where did the notion of “one return only” come from?." Thanks to Marc Cornellà for bringing this topic to light in a comment on the video about guard clauses, a video I recommend watching if you haven't seen it yet :D

Tags

Clean CodeCode SmellsIntermediateRefactoring
AnteriorInterface Segregation Principle - #SOLID
SiguienteHow they use #Git on GitHub - #scbcn

Pay according to your needs

lite (only monthly)

19 €
per month
  • Access to a subset of courses to lay the foundation for maintainable, scalable, and testable code
  • Company invoice
Popular

standard

24,92 €
Save 121 €
Annual payment of 299 €
per month
  • Full course catalog
  • Receive job offers verified by Codely
  • Company invoice

premium

41,58 €
Save 89 €
Annual payment of 499 €
per month
  • All previous benefits
  • Early access to new courses
  • Discount on workshops

We won't increase the price while your subscription is active