Skip to main content
Share Your Experience: Take the 2024 Developer Survey
17 votes

Is it wise to rely on optimizations?

Both :-) Seriously, premature optimization can be a problem - you might wind up spending hundreds of hours optimizing a routine that is only run once/week. Also, fully optimized code is often harder ...
Dan Pichelman's user avatar
15 votes

Did Dijkstra intend for code modularization, when he wrote about separation of concerns?

Separation of concerns is an abstract way of thinking that consist in considering separately things that do not have to be related. Modularisation (separating unrelated group of functions into ...
Christophe's user avatar
  • 77.9k
14 votes

Splitting up a very large function/program into smaller functions. Effective?

As someone who recently did just that, refactored a few long sheets of code into a set of small functions, I can attest it is effective. I assume you heard about the Unix principle: "do one thing and ...
9000's user avatar
  • 24.3k
9 votes

Did Dijkstra intend for code modularization, when he wrote about separation of concerns?

I would suggest that, whilst the paper is of historic interest, what Dijkstra meant by the term "separation of concerns" over 40 years ago is not particularly relevant today. Nowadays it is used ...
David Arno's user avatar
  • 39.3k
9 votes
Accepted

Splitting up a very large function/program into smaller functions. Effective?

Since each function usually relies on some input provided from a previous function, either a returned value or a global variable or whatever else your language uses - it often only works, and makes ...
DaveGauer's user avatar
  • 1,287
8 votes
Accepted

Modulizing vs Performance benefits

A module should isolate change. The module boundary should act as a firewall against a design change propagating into the rest of the system. Therefore a module should fully encapsulate a design ...
candied_orange's user avatar
7 votes

Why is it so bad to read data from a database "owned" by a different microservice

Over the last 20 years I've seen a few large modular database designs and I've seen the scenario suggested by David quite a few times now where applications have write access to their own schema/set ...
Rob Bygrave's user avatar
7 votes

Splitting up a very large function/program into smaller functions. Effective?

Yes, this is generally a good idea. Smaller functions are usually easier to read and understand, and are potentially reusable in different contexts. It is true that the process of refactoring can ...
FrustratedWithFormsDesigner's user avatar
6 votes

How to cleanly separate different parts of a software application?

There is always something of a logical coupling between the business logic and database. Your efforts should be focused on preventing a physical coupling. For example, take the very basic business ...
John Wu's user avatar
  • 26.6k
6 votes
Accepted

What is module in Software engineering context?

A module can be an abstract unit of implementation, e.g. larger than an object, perhaps a collection of interacting objects.  Modules are meant to be more loosely coupled with each other than the ...
Erik Eidt's user avatar
  • 34.1k
5 votes

Splitting up a very large function/program into smaller functions. Effective?

it often only works, and makes sense in context with the previous function. A change to a previous function would often obviously destroy functionality in the second function. If that is the case, ...
Michael Borgwardt's user avatar
5 votes

Splitting up a very large function/program into smaller functions. Effective?

Since each function usually relies on some input provided from a previous function, either a returned value or a global variable or whatever else your language uses - it often only works, and makes ...
John Wu's user avatar
  • 26.6k
5 votes
Accepted

Put functionality in same executable with command-line flag, or put it in a separate executable?

Don't go with separate executables if it means duplicating stuff that now has to be kept in sync. If anything create different "front ends" to access it. I've solved exactly this problem by offering ...
candied_orange's user avatar
4 votes

Splitting up a very large function/program into smaller functions. Effective?

However is this actually effective for a programmer? Functional programming languages do everything with functions. Even a language with little support for functional programming should be able to ...
Michael Shaw's user avatar
  • 5,116
4 votes

How to cleanly separate different parts of a software application?

Make sure your Business Model objects are in thier own library which does not reference any ORM or database clients. Use the Repository pattern and only reference interfaces to the repositories in ...
Ewan's user avatar
  • 76.4k
4 votes
Accepted

How can customer specific implementation be handled?

You really don't want customer specific branches/forks. Multiple main branches are a pain to maintain. In some cases they are really needed - for example, when you are trying to stabilize a release or ...
Idan Arye's user avatar
  • 12.1k
4 votes
Accepted

Leo Brodie's "Interface Component"

Rule #1 when reading any programming or computer science text: "interface" never refers to the Java interface construct. (Rule #1b: except when the text is specifically about the Java language. And ...
Jörg W Mittag's user avatar
4 votes
Accepted

Is it wise to rely on optimizations?

There are 2 very different kinds of optimisations. The first is micro-optimisations. These are things like (e.g.) changing x = (y * 4 + z) / 2 into x = y + y + z / 2, or x = y % 8 into x = y & 7. ...
Brendan's user avatar
  • 3,955
4 votes
Accepted

Did Dijkstra intend for code modularization, when he wrote about separation of concerns?

Dijkstra is making an explicit statement about how to think. Program (and process) modularization - and it's desirability - is perhaps a result of that thinking, but the key point he is making is how ...
MCL's user avatar
  • 64
4 votes
Accepted

Parnas' Paper on Modularization and Workflow Engines

Why is the "new" (in 1971) approach better ? The second approach, which is the one that Parnas recommends, will ensure the principle of separation of concerns. In other words, identifying ...
Christophe's user avatar
  • 77.9k
4 votes
Accepted

Switching out implementation source files in C project

The normal practice when mocking functions in C (or otherwise using different implementations) is to use different .c source files in your build process. Normally, header files are not replaced. If ...
Bart van Ingen Schenau's user avatar
4 votes
Accepted

Modular monolith vs microservices for hybrid multi-tenancy

To me, the question about customization is orthogonal to the micro services/modular monolith question. I.e. they are not really related. From what I have read the main benefit of micro-services seem ...
JonasH's user avatar
  • 5,544
4 votes
Accepted

Modular Design affects compilation time

Kind of. The tricky part is the role of header files. The C/C++ compilation model handles one "compilation unit" at a time. Roughly, there is one compilation unit per .cpp file. Different ...
amon's user avatar
  • 134k
3 votes

Making an existing project modular

I want to answer this but the thing is, does modular really refer to how your going to separate programs into repositories? Usually a program being modular would refer to a program and its ability to ...
Rhys Johns's user avatar
3 votes

Is it wise to rely on optimizations?

I think you have a wrong understanding about optimization, so here are some facts about it: First of all, optimization is completely irrelevant for 99% of your code! That is the most important fact ...
cmaster - reinstate monica's user avatar
3 votes
Accepted

Multiple DLLs vs Multiple EXE's in a project that needs to be modular (web browsing automation)

As you are mentioning .exe as the executable suffix, I assume you are working on Windows. Here, it is (at least in principle) possible to dynamically load and unload dynamic libraries, either via ...
dasmy's user avatar
  • 473
3 votes
Accepted

Modular programming: module inter-dependency

It looks to me you created a synchronous messaging system. If you make BridgeService a queue you will have something very common and proven, it will be asynchronous and the decoupling will be even ...
Martin Maat's user avatar
  • 18.4k
3 votes

Modular programming: module inter-dependency

In short It looks nice. But in reality, you just shift the problem, transforming inter-module dependencies in an interface segregation issue, that might ultimately end-up in object-oriented spagetthi-...
Christophe's user avatar
  • 77.9k
3 votes
Accepted

Shared library and modules with versioning

You asked this in a pretty broad fashion, so here is an equally broad answer: it depends. In smaller systems, #1 will be usually desirable, since it reduces configuration management efforts and ...
Doc Brown's user avatar
  • 209k
2 votes

Is it wise to rely on optimizations?

Why is this important to you? Is anyone complaining that something is not fast enough? You have limited time to do things. Unless speed is really of concern, your priority should be correctness, and ...
gnasher729's user avatar
  • 45.7k

Only top scored, non community-wiki answers of a minimum length are eligible