Using template engine or working with pure PHP?

Asked

Viewed 814 times

0

Currently here in the company we use the Smarty template engine, but it is difficult to find someone who knows how to work with it.

I would like to know the pros and cons of using a template engine analyzing only the following situations

  • Development agility
  • Code organization
  • Difficulty of maintenance

I believe that by assessing these points the question becomes more technical, not based on opinions

I really have to agree that it is still very much based on opinions, but I got a very satisfactory response in the comments.

  • Rodrigo, you just limited the possible answers, but it was based on opinions. Agility is something that does not depend on the language itself but rather on the knowledge of the programmer, the more you know the language the more agility you will have when working with it, as well as the difficulty of maintenance, the more you know, but easy to solve problems/changes. The template engine serves both to facilitate maintenance and to organize html code, it is cleaner without PHP tags.

  • @Filipe also sees the usefulness of the template engine that way, but any programmer from the region I work tells me that the code is "scrambled" and that you can’t understand... we’ve had a lot of clients complaining that we’re using a programming foma that forces them to be trapped in our company in case of maintenance or alterations... although Marty is very simple to understand, have programmers who come here and take 30 minutes to understand how to work with him...

  • 4

    @Rodrigoborth the problem of programmers, is that many have no knowledge of templates and do not go after learning, get stuck in their comfort zones. What happens is they think the world has to suit them and not them for the world. And the customers who complain, are customers who have no technical knowledge to talk about (not that they should be expected to have, but that’s it). If it were me, I would ask them to ask for a third party opinion, who is actually an expert or works as a consultant, to see which practice is best :)

  • @Tafarelchicotti I think with this answer is not worth trying to adjust the question to reopen it :D but a specific client is a guy who "understands" everything programming and has his programmer who "knows everything" also... and as this client is the most income for the company we have to be giving explanations not to lose the client...

  • I understand @Rodrigoborth, but it really gets complicated. But do you have a system manual and technical documentation? Because if you have any document with such features, it is easier to circumvent the customer like this and be able to deliver to the customer something that he can offer to others who are going to maintain the code.

  • @Tafarelchicotti we don’t actually have, first why we don’t have time to write and second why any php programmer who has worked at least 4 months with the language is able to understand the code easily even without knowing Marty... the proof of this is that a stable that started here that never had programmed in php took 1 week to learn how to use the main functions we use in development, the rest was picking up with time, in a month already produced that not even the most experienced...

  • I understand, I understand, but it is that for a client it is worth more documentation than anything else, because it becomes a physical proof

Show 2 more comments

1 answer

1

A framework is a set of good practices for the use of a language, with a specific purpose. This purpose varies according to the language. In PHP, most frameworks are intended to help with web development.

About development agility: PHP naturally has an agility in development. When adding a framework, the developer loses this agility at first. This is due to the fact of the need to learn about the use of the framework. However, after this period of learning, productivity returns to the standard levels for language.

A framework naturally facilitates code organization. Most of the pattern decisions have already been made by the framework developers. You are using other people’s knowledge to streamline your development process.

The difficulty of maintenance will depend on the size of your application. For a small application, using a framework makes little difference. For a large application, a knowledgeable framework will easily understand the general structure of your application. He will still have to learn the business rules of the application. If a framework is not used, the new developer will first have to familiarize himself with the structure that was created, then with the business rules developed.

A framework is good development practice. It is not strictly necessary, but it is something that facilitates the development of an application.

It is always important to choose a framework that is widely used and has good community support, since developing a framework is not a trivial task.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.