News for hackers. Stuff that matters.
Re:A Plea for Lean Software (1995) [pdf] by Jtsummers on Monday June 28, 2021 @10:28AM (#27662440)
> Modularity brings a lot of baggage with it, like duplication of code and lifecycle management, along with increased resource usage (ironic, as the article is mainly about reducing resource usage).

I just can't conceive of how modularity, in general, causes duplicate code rather than reduces it. And this is before considering something like generic code which could potentially further reduce duplication. Every time we've been deliberate about using modularity in projects it ends up creating libraries that reduce the total amount of code across projects. Even if it's just in one project, good modularity has been used to reduce a lot of duplication.

Re:A Plea for Lean Software (1995) [pdf] by ChrisMarshallNY on Monday June 28, 2021 @10:35AM (#27662527)
As I mentioned above, if the module is expressed as a code extension, then it is, sort of, "free." It is compiled into the main code body.

But, for example, say we are talking about a communication module. One module may use a well-known library as a bundled dependency, and another module may use the same one. They may be smart enough to use dylibs, in which case, you have the potential for "DLL hell," or they may use static libs, in which case you have duplication of code, and maybe resource contention.

Re:A Plea for Lean Software (1995) [pdf] by Jtsummers on Monday June 28, 2021 @10:41AM (#27662602)
Ok, so it's a conflict of meaning.

I would not consider static libraries to be duplication of code. Duplication of assemblies or compilation unit, sure, but not code. The code itself has not been duplicated.

Re:A Plea for Lean Software (1995) [pdf] by ChrisMarshallNY on Monday June 28, 2021 @10:48AM (#27662698)
Fair 'nuff.
Re:A Plea for Lean Software (1995) [pdf] by madpata on Monday June 28, 2021 @02:08PM (#27665376)
> I just can't conceive of how modularity, in general, causes duplicate code rather than reduces it.

Yeah, like my node_modules folder doesn't contain tons of duplicate code.

/s

Re:A Plea for Lean Software (1995) [pdf] by Jtsummers on Monday June 28, 2021 @02:20PM (#27665552)
Modularity doesn't cause that. Modularity doesn't inherently reduce duplication either. But modular code offers opportunities for reuse (or clearer opportunities for reuse) that non-modular code does not (or where the reuse potential is so obfuscated that it may as well be non-existent).
Re:A Plea for Lean Software (1995) [pdf] by BBC-vs-neolibs on Monday June 28, 2021 @11:36AM (#27663245)
Others have already pointed to the distinction between code duplication and runtime duplication.

Regarding the development experience:

I think it's a tug and back-and-forth kind of dynamic.

Modularity has exactly the kind of effect you talk about, until it doesn't.

At some point, the cost of communication (between people!) responsible for different modules can increase until it's a net negative to try to adapt a module, or even find out it exists and is suitable.

Of course, a monolithic project of comparable size has likely collapsed from its weight into a ball of mud.

Development tools have come quite a ways, but the science of getting teams to develop software together, perhaps not so much.

Re:A Plea for Lean Software (1995) [pdf] by ChrisMarshallNY on Monday June 28, 2021 @04:03PM (#27667142)
> Development tools have come quite a ways, but the science of getting teams to develop software together, perhaps not so much.

Yup. I think I'll put that on a T-shirt.