4

As far as I can tell, the main idea in modular programming is:

program pieces that work well;
complex behaviour results from piece_a and piece_b working together

Though, I am not sure if it means:

write multiple programs;
compile each necessary program into executables;
string together with pipes and shared files

or

write multiple functions;
string together in the mainline of ONE program

  • 1
    In programming it usually refers to parts of the same executable. But the unix concept of having command line tools that do one thing well which can be combined is pretty similar. – CodesInChaos Feb 27 '15 at 19:57
  • so the mainline is the CLI and the functions are what are strung together? – user2738698 Feb 27 '15 at 19:59
  • 1
    Different people may mean different things when using the term. It could be both. I could also argue that a function is a program within a program. – Doval Feb 27 '15 at 20:18
5

The term is independent of any specific implementation. Modular code is cohesive with a well-defined interface. It doesn't particularly matter if that interface is a local function call or a call over the Internet to a REST API.

That being said, when you're talking with someone, you need to determine in context whether you're talking about the general abstract concept or one specific implementation. For example, a C# developer might usually be talking specifically about a class that implements the IModule interface.

2

Consider this: Aren't both "interaction through pipes and shared files" and "interaction through shared memory within a single process" just special cases of "working together"?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.