⬆️ ⬇️

Comparison of the number of code popular frameworks

Hi, Habr. Every year the number of frameworks increases, forks appear, some become fashionable, and some go out of fashion. Of course, different frameworks provide the developer with different opportunities, which primarily depend on the developers, their ideas, the chosen architecture, the availability of documentation ... and of course the size of the framework. Here we also will talk about this parameter today - I will ask all interested under kat.







Let's look at the question from the perspective of a novice. Here he has already learned the basics, he writes something on the “native” php. Gradually comes to such a thing as "framework". And now he is already interested in this question, which frameworks are the most popular, which have the documentation in Russian, and which have the community. However, there is still such a parameter as complexity or threshold of entry. And if he asks for advice on the forum, then he will most likely be advised by Codeigniter or Kohana (more rarely Yii) than Zend Framework or Symfony. And this is quite logical and normal.

')

Is a large volume framework good or bad? What is better: good speed or great architecture and great features? We will leave these questions for the following articles, and today we will look at the smallest and largest and most voluminous frameworks. And we will count the number of lines and the number of files.



In the network you can find information about the number of lines of a framework. But this information seemed to me unreliable and rather outdated (for 1-2 years I consider a large gap in the it industry), so I decided to get this data myself by counting. This raises the question: what exactly will we consider? Reflecting on this question, I came to the conclusion that the following parameters should be counted:







For this purpose, a small php script was written that recursively got all the files in the folder, opened them and counted the number of lines. Also simultaneously save the number of files.



Popular frameworks (if I forgot your favorite one - write, add) and several CMS / CMF for clarity took part in the experiment. When measurements were used the latest versions from the sites of developers.



As a result, I received the following data:



Object of studyFullyPhp files onlyOnly php files (without third-party modules)
Kohana 3.3.0
of files1283862471
rows18322811902356874
Codeigniter 2.1.3
of files352147147
rows887245152551525
Yii 1.1.13
of files200516211571
rows653970614712573114
Zend Framework 2.1.3
of files207019631963
rows276248272957272957
Symfony 2.2.0
of files571835832247
rows498788418988253408
CakePHP 2.3.0
of files1012654654
rows251125238350238350
FuelPHP 1.5.2
of files700473455
rows1667309607473118
Drupal 7.2.0
of files1056269269
rows314574150999150999
Joomla 3.0.3
of files475316511651
rows517145303996303996
Wordpress 3.5.1
of files1085447447
rows312529192473192473




And if you find an approximate number of lines per file (the calculations used data "only php files without third-party components"):



Object of studyLines / file (average)
Kohana 3.3.0120.7515924
Codeigniter 2.1.3350,5102041
Yii 1.1.13364,8084023
Zend Framework 2.1.3139,0509424
Symfony 2.2.0112,776146
CakePHP 2.3.0364,4495413
FuelPHP 1.5.2160,6989011
Drupal 7.2.0561.3345725
Joomla 3.0.3184,128407
Wordpress 3.5.1430,5883669




So let's analyze the data. The largest (by the number of files) in the standard package is the symfony framework, and the largest one is Yii. The most concise (least files) is Codeigniter.

According to the average number of lines in the file, the frameworks were divided into 2 groups: 110-160 lines in the file (Kohana, Zend, Symfony, FuelPHP) and 300-500 lines in the file (Codeigniter, Yii, CakePHP), and the middling and not. Most likely this is due to the architecture and you should not take it very seriously.



As for the CMS / CMF, the results are very expected and may contain a large error, because They include a fairly large number of elements related to the frontend.



In conclusion, I would like to note that the results turned out to be quite predictable. However, strongly focus on such a parameter as the size of the framework is not worth it. The programmer, knowing all the pros and cons of each option, must choose a tool for a specific task and use its advantages.



UPD: The comments suggested comparing the number of characters without comments. I did the following test: only php files, no comments, hyphenation, count the number of characters (utf-8 is taken into account).



Object of studySymbols (no comments, hyphens, third-party libraries)
Yii 1.1.1313248904
Symfony 2.2.05769403
CakePHP 2.3.05365166
Zend Framework 2.1.35334742
Zend Framework 2.1.3 (without Res / lang)4924887
Yii 1.1.13 (without i18n data and messages)1811665
FuelPHP 1.5.21209799
Kohana 3.3.0841022
Codeigniter 2.1.3616417

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



All Articles