Good programming practice

I read Randall Hyde Write Excellent Code (Volume 2), and I found this:

[...] its not a good programming practice for creating monolithic applications, where all the source code appears in one source file (or is processed by one compilation) [...]

I was wondering why this is so bad?


Thanks to everyone for your answers, I really want to accept more of them, but I chose the most synthetic one, so anyone who reads this question will immediately find the necessary things.

Thanks guys;)

+3
source share
13 answers

Because everything is so crowded.

If you have separate files for individual things, you can find and edit them much faster.

, , .

+3

, , , , , - . , , , API. , , , .

, C. , , , , , "" "" . "" , .., "" , API. "", , "" , API. "" , , , API. - "" , SQL- , "" .

+4

() .

+3

, , .

, , , .

+3

:

  • -, . .
  • . " " " ".
  • , . ( ) .
+3

, HTML CSS " ", , .css,.js .html : .

+2

. . , . , .

, , , , .

, ( ), , ( ).

+2

​​ : , . , , .

, , , -, COBOL FORTRAN . , .

- - . OO , , , .

+1

. " -" , , . , ..

0

, - . .

0

, , . , , , . , DLL, . , , , .

0

, . , , .

, .

, 3000- . . , , .

0

I think that you have never worked in a large company with 6,000 lines of code in one file ... and every couple of thousand lines you see comments like /** Do not modify this block, it critical */, and you think that the error is, you come from this block. And your manager says: "Yes, look at this file, somewhere in it."

And the code breaks all those great OOP concepts, has dirty switches. And like fifty participants.

Lucky.

0
source

Source: https://habr.com/ru/post/1782775/


All Articles