Are functions meant to encapsulate the boilerplate code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Are functions meant to encapsulate the boilerplate code?

I read that boilerplate code is the type of code which appears again and again in the program. So can we conceptually say that the purpose of functions in the program is to encapsulate the boilerplate code?

3rd Jun 2019, 6:45 AM
Ali Anwar
Ali Anwar - avatar
1 Answer
+ 3
yeah, when you write the function you don't need to rewrite th3 code over and over again all you need to do is call the function wherever you need it, as many as you like
3rd Jun 2019, 8:19 AM
✳AsterisK✳
✳AsterisK✳ - avatar