Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8790463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:39:39+00:00 2026-06-13T22:39:39+00:00

This is just a general help question, I’m trying to know What is the

  • 0

This is just a general help question, I’m trying to know What is the advantage of having a set of small functions in a C++ application’s code over having one long complex function containing all the statements necessary to solve a problem ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T22:39:42+00:00Added an answer on June 13, 2026 at 10:39 pm

    Edit Credit for this mnemonic goes to the commenters in the OP.

    Breaking big functions up in to several smaller ones can lead to MURDER! Which, in this case, might be a good thing. 🙂

    M – Maintainability. Smaller, simpler functions are easier to maintain.

    U – Understandability. Simpler functions are easier to understand.

    R – Reuseability. Encourages code reuse by moving common operations to a separate function.

    D – Debugability. It’s easier to debug simple functions than complex ones.

    E – Extensibility. Code reuse and maintainability lead to functions that are easier to refactor in 6 months.

    R – Regression. Reuse and modularization lead to more effective regression testing.


    There are a few potential benefits to breaking big functions up in to smaller functions. In the order they fell out of my brain:

    1. It encourages code-reuse. Often in large functions you have to do more-or-less the same thing many times. By generalizing this in to a single common function, you can use that one block of code in multiple places.

    2. Code-reuse can aid in robustness and maintainability by isolating potential bugs to one place rather than several.

    3. It is easier to understand the semantics of the function when there are fewer lines of code and a bunch of calls to well-named functions.

    4. If you are opposed to functions with multiple return points, breaking big functions up can help reduce them.

    5. It helps to identify and isolate (potential) problems with subtle data dependencies that are otherwise hard to notice.

    It’s important to note however that you take the good with the bad with this. There are also a few potential drawbacks to breaking big functions up:

    1. If the big function worked before, trying to modularize it may create defects.

    2. In multithreadded applications, you might introduce deadlocks and race conditions if your synchronization policies are subtle or just plain wrong.

    3. You might introduce a performance hit from the function calls.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is just a general PHP question. Does it help or hurt to have
Just a general curiosity question. Why is this namespace System.Collections.Generic added by default in
i just want to know a general information about this particular information. Any good
It's likely that this is just a general Python Tkinter question, not necessarily a
This question is just out of general curiosity. I've just noticed it when working
In general, what kinds of design decisions help an application scale well? (Note: Having
This is a very general question, so I won't be providing any code as
Ok another WPF question, well I guess this is just general .NET. I have
MSDN is a nice place to get vague, general information on this, with just
I fear this just may not be possible, but I'm trying to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.