OpenWaterAnalytics / EPANET

The Water Distribution System Hydraulic and Water Quality Analysis Toolkit
MIT License
279 stars 204 forks source link

Suggestion: each source file with its header? #675

Closed jburguete closed 2 years ago

jburguete commented 2 years ago

The code has general header files (i.e. funcs.h for functions). These headers are big and slow the compilation if included in every source file. Moreover, many source files have extern definitions because some functions are not defined in the header files. It is more common in general projects that each source file has its corresponding header file. Then, source files can benefit from shorter and more specific header files.

LRossman commented 2 years ago

The basic structure of the EPANET code hasn't changed much since it was first written almost 30 years ago, before encapsulation and object oriented designs became popular. Some six years ago a new OWA project, epanet-dev (not to be confused with the devbranch of this project) was begun to modernize the EPANET code base using object oriented C++. Rather than spending time on re-engineering the EPANET 2 code base I believe it would be more beneficial to direct such efforts to completing and improving epanet-dev (so it can become EPANET 3).

jburguete commented 2 years ago

I am a good C programmer and I can contribute to improve and modernize C codes. Nevertheless, in C++ I am a very mediocre programmer. It will be much more difficult for me to contribute.