How best to fit everything in one php file or something to share?

How to do write the complete code in a single file or as a divide less are used in one file, which is often in another. And just load the require_once . And another question if you podgruzhat is it not the same what to write in a single file?
June 10th 19 at 16:13
2 answers
June 10th 19 at 16:15
The question is very abstract.
Do as you (and those who may be working with Your code in the future) easier.
If all the code is +-10 lines to divide it makes no sense :)
In other cases, to divide the code have meaning. The easiest option - duplicate to make things out into separate functions/classes.
just wondering what the advantages of separation, in reducing the server load, increase speed or ease of development and readability for other developers? - emie74 commented on June 10th 19 at 16:18
In 90% of cases, separation of code into modules/functions/files is done for programmers. Car care how to read code. The programmer is easier to work with the code, broken into meaningful parts, rather than a giant monolithic text (like book, split into chapters, the chapters divided into paragraphs. Paragraphs broken into sentences, etc.)

PS: of course, performance is also affected. But, if You ask such a question, and I don't expect we are talking about more or less a medium or large app, where it will be noticeable. - dean.Stoltenberg65 commented on June 10th 19 at 16:21
logical, thank you) - emie74 commented on June 10th 19 at 16:24
well, roughly speaking a code string on 600 if all sasaguchi in single file, and this is not the final product, so from here and a question) - emie74 commented on June 10th 19 at 16:27
June 10th 19 at 16:17
If you think software, it is better not to divide. Uploading new file - always an extra operation for the server.
But it is almost never possible to put the code into a single file. So about uploading files as a necessary evil. But if it can be avoided - better to do it.
well, roughly speaking a code string on 600 if all sasaguchi in single file, and this is not the final product, so from here and a question)
In addition, some functions work with third-party tools, and from there I only need the results) - emie74 commented on June 10th 19 at 16:20
Cm. above. This is the case when you need to divide to structure the files. But it does not improve the operation of the program. - dean.Stoltenberg65 commented on June 10th 19 at 16:23

Find more questions by tags PHP