Up next


How Many Lines Of Code Should A Function Have?

1 Views
Published on 12 Dec 2016 / In Film & Animation

What Programming Language Should Programmers Learn In 2019? ?
??https://www.youtube.com/watch?v=CwaSHqAWPUU
What Programming Language Should Programmers Learn In 2019? ?
??https://www.youtube.com/watch?v=CwaSHqAWPUU
Should You Comment Your Code?: https://www.youtube.com/watch?v=ErW6fEvulAc
Clean Code Book: https://simpleprogrammer.com/CleanCodeBook

How Many Lines Of Code Should A Function Have?

Writing code is definitely an art. It is far from being something automatic. This is so true due to the fact that every software developer writes a different code, based on their personal experience and how they perceive it is the best practice for writing it.

So, one of the most asked questions I receive is how a code should be written and what are the best practices for writing code.

In this video I'll discuss a little bit more about how many lines of code should a function have.

This is such a particular code and a quote from Code Complete Book sums it up really well:
"From time to time, a complex algorithm will lead to a longer routine, and in those circumstances, the routine should be allowed to grow organically up to 100-200 lines. (A line is a noncomment, nonblank line of source code.) Decades of evidence say that routines of such length are no more error prone than shorter routines. Let issues such as depth of nesting, number of variables, and other complexity-related considerations dictate the length of the routine rather than imposing a length restriction per se."

Wanna know more about how many lines of could should a function have? Watch this video and find out!

If you have a question, email me at john@simpleprogrammer.com

If you liked this video, share, like and, of course, subscribe!

Subscribe To My YouTube Channel: http://bit.ly/1zPTNLT

Visit Simple Programmer Website: http://simpleprogrammer.com/

Connect with me on social media:
Facebook: https://www.facebook.com/SimpleProgrammer
Twitter: https://twitter.com/jsonmez

Other Links:
Sign up for the Simple Programmer Newsletter: http://simpleprogrammer.com/email
Simple Programmer blog: http://simpleprogrammer.com/blog
Learn how to learn anything quickly: http://10stepstolearn.com
Boost your career now: http://devcareerboost.com

Show more
Responsive image

Log in to comment


0

Up next