Y
Y
Yan Aleksandrov2020-12-06 15:40:51
PHP
Yan Aleksandrov, 2020-12-06 15:40:51

Why is the library so heavily "smeared"?

Getting to know FastRoute . The library is prepared to work with compozer. But that's not the point. The total weight of the library is 26 kilobytes. The number of files in the library is 17. That is, each file is 1-2 kilobytes in size.

Explain why the developer "smeared" the library? Sorry, I didn't find a suitable expression. What are the advantages of such coding? For me, this is wildly inconvenient.

The developer of the library is a certain Nikita Popov, who has added a lot of features to PHP itself in recent years, so it's hard to doubt his competence.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daria Motorina, 2020-12-06
@glaphire

As already said in the comments - everything is correct, the classes are divided by area of ​​responsibility. According to PSR, too - you need to break the classes into separate files and name them correctly. The weight of the package plays a secondary role.
Even if we discard modern standards, then classes up to 500, ideally up to 200 lines, are simply easier to read in the IDE and git with diffs and merge requests - it's faster to find what belongs to what)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question