DEV Community

Farnazsr77
Farnazsr77

Posted on

c++

What's the difference between multiple source files and coding on one source file?

Top comments (1)

Collapse
 
txai profile image
Txai

I think it's all a matter of organization and readability. When your project becomes bigger it gets tricky to find information when you have only a single cpp file. Imagine you're debugging a calculator app, trying to solve some problem with the sum functionality and you're not familiar with the code: it's easier to find where to debug if the code is organized into multiples source files, each with a corresponding responsability like, for example, sum.cpp; subtraction.cpp and so on