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

  • SEARCH
  • Home
  • 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 8891915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:51:38+00:00 2026-06-14T22:51:38+00:00

I am a solo developer on a large C++ library that I use for

  • 0

I am a solo developer on a large C++ library that I use for research (I’m a PhD student). Let’s say the library has a bunch of classes that implement cool algorithms: Algorithm1, Algorithm2, etc. I then write a bunch of C-style functions that are stand-alone “scripts” that use the library to either test the recently added functionality or to run simulations that produce plots that I then include in wonderfully-brilliant (I’m in denial) journal publications. The design of the library follows good software engineering principles (to the best of my knowledge and ability), but the “scripts” that link the library from main.cpp do not follow any principle except: “get the job done”.

I now have over 300 such “scripts” in a single file (20,000+ lines of code). I have no problem with it, I remain very productive, and that’s really the ultimate goal. But I wonder if this approach has major weaknesses that I just have learned to live with.

// File: main.cpp

#include <cool_library/algorithm1.h>
#include <cool_library/algorithm2.h> 
...
#include <cool_library/algorithmn.h> 

void script1() {
    // do stuff that uses some of the cool library's algorithms and data structures
    // but none of the other scriptX() functions
}

void script2() {
    // do stuff that uses some of the included algorithms and data structures
}

... 

// Main function where I comment in the *one* script I want to run.
int main() {
    // script1();
    // script2();
    // script3();
    ...
    script271();

    return 0;               
}

Edit 1: There are several goals that I have in this process:

  • Minimize the time it takes to start a new script function.
  • Make all old script functions available at my finger tips for search. So I can then copy and paste bits of those scripts into a new one. Remember this is NOT supposed to be good design for use by others.
  • I don’t care about the compilation time of the script file because it compiles in under a second as it is now with the 20,000 lines of code.

I use Emacs as my “IDE” by the way, in Linux, using the Autoconf/Automake/Libtool process for building the library and the scripts.

Edit 2: Based on the suggestions, I’m starting to wonder if part of the way to increase productivity in this scenario is not to restructure the code, but to customize/extend the functionality of the IDE (Emacs in my case).

  • 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-14T22:51:40+00:00Added an answer on June 14, 2026 at 10:51 pm

    If I were you, I would split that huge file into 300 smaller ones: each would have just one scriptNN() and main() calling just it.

    Now, when you have it compiled, you will have 300 small scriptNN executables (you may need to create appropriate Makefile for this though).

    What’s nice about this – now you can use these script executables as building blocks to be put or called by other scripts, like bash, python, perl, etc.

    EDIT Explanation how this design allows to address your goals.

    • Time to start new script function – simply copy one of existing files and tweak it a little.

    • Make all old script functions available at my finger tips for search – emacs can do multi-file search across all other script files you have.

    • I don’t care about the compilation time of the script file – it does not matter then. But you will have all of them available to you at once, without editing one big main() and recompiling.

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

Sidebar

Related Questions

To start, let me say that I'm a beginner and this program is my
I have a django project that I have been working on as a solo
I'm a solo developer, working in a local Git repository. For backups, I want
I'm currently working on a program that analyses a wav file of a solo
For a solo developer using Visual Studio 2010 beta 2 is TFS Basic a
Given I'm: a solo developer using VS2008 Professional looking for Microsoft-produced source control (I'm
I'm a solo developer and always have been, but I've been learning lately about
I have a large and challenging C++ project that I plan to undertake, one
I'm a solo developer running Visual Studio 2008 and looking into MSBuild to improve
I'm a solo developer looking into a tool such as MSBuild/NAnt to improve my

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.