📜 ⬆️ ⬇️

Disputes about template engines: trolling or clever thoughts?

The reasons were born in the fact that in the tops of specific templates dedicated to reviews they argue on a generalized topic:
Overview of the Quicky template engine: Performance and Flexibility.
MACRO is a flexible PHP template engine with a human face.
The investigation was carried out on the basis of data obtained in the top:
HolyWar: ​​Template engines. Do they need? Are they wealthy? Forum.
results of the investigation under the cut

first voting results:
HolyWar: ​​Template engines. Do they need?
48.67% (128) I am for using template engines and the one that I use suits me.
13.31% (35) I am for using template engines, but the one I use does not suit me.
11.79% (31) I do not use template engines, because there are no “normal” ones.
26.24% (69) I am against the use of template engines in general.
263 people voted. Abstained 57 people.

Top 5 reasons for arguing on the topic of template engines in general:


1. In the overwhelming majority of cases, the basis of the controversy over the topic is whether a logical error lies that “it is necessary to separate logic and output” . This statement is not related to the theme of template engines and in general the developers of large projects are considered to be erroneous.
The correct statement is:
Need to separate business logic and presentation logic

Why do you need it? then to divide the development into parts, to localize responsibility and reduce labor costs for changing one of the components.
This can be done both with the use of template engines and without using them.
Here is an example of the presentation logic problem: #
in this matter, self-taught people who have no substantial experience in large projects and people who have made several major decisions usually argue.

2. The second popular question for the next wave of disputes lies in sucking such a statement:
Quick and smart templates do not prohibit confusing business logic with presentation logic, although they prevent this mixing. #
there is often arguing on the topic: why then these template engines, if they do not prohibit this separation.
in these disputes, proponents of block templates and XSLT are entering the scene.
')
3. It's nice to see how people are beginning to argue fervently on the subject of syntax. Someone likes smarty-like syntax, someone is PHP-native, someone has loved Blitz, an advocate of XSLT, who stands apart from the controversy.

4. Then something amazing happens and people (like self-taught novices and pros) start arguing about speed, it’s amazing that upon close examination to most of those who argue this speed is not important : beginners and self-taught people do not have such loads, and those people who have these loads in most cases have bottlenecks not in the template engine at all. As a rule, 2-3 pros remain in such disputes who have a real interest in this issue and an incredible number of those who want to speak out. Supporters of XSLT do not argue here, they believe that faster libraries will be made soon, and for some reason I believe with them, but not in the word “soon.”

5. also a rather interesting reason for disputes - the statement that PHP is the template language. A very cool such object-oriented template language with work with sockets and shared memory. As a rule, supporters of such a statement are familiar with PHP at the PHP / FI level, and the person who wrote the if ($ obj instanceof Class) is ready to send to the asylum with the words: “what the fuck is this?”

TOP 5 reasons for arguing on the choice of template engine:


1. Standardization and prevalence of syntax
2. Speed!
3. The complexity of the internal code (surprisingly, but mostly those who still have not added anything useful even in Smarty) argue again
4. Dampness / support
5. opportunities (few people are really interested)

Related articles:
brodyaga.habrahabr.ru/blog/30767

For this, I close this topic for myself and promise no longer to burden the public with disputes on the topic of template engines, but lastly I urge all holivarschiki to send HolyWar: ​​Template engines to this topic here . Do they need? Are they wealthy? Forum.

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


All Articles