207k views
4 votes
One more thing explain why this program would be better written using a function

look my previous q1

User Loukaswho
by
7.0k points

1 Answer

4 votes

The key use is for mental chunking, to help you grasp what complex software does.

By naming a small function according to its outcome/overall purpose, you reduce the amount of stuff you need to mentally juggle.

It's one of the many tools available to divide and conquer complexity.

Same way as a TV is full of complex stuff, but you press on, and plug into the wall plus an aerial, hdmi and WiFi. You don't talk about how the inside works to make higher level discussions possible

User Palash Kosta
by
7.0k points