In: Computer Science
Is it a good idea to use a template engine that keeps the form of HTML or is abstracting this form away a better notion? In a few paragraphs state
Yes, it is a good idea to use template engines to keep HTML forms.
It has the following advantages :
1) Code Reusability :- You can compile your template into the reusable function. If you want to send the same template again then you just have to write some line of code of the reusable function and then you have to just run the template in that function.
2) Code Organization :- The presentation is the important thing in any field, if your presentation is in a nice way then it will be clearly understandable.
3) Productivity :- Problems like output encoding, iterating conditions, and error handling have already been handled.
4) Code Readability :- If your template has good separation between logic and the presentation, then it is easier to read and understand.
5) Code Debugging :- Due to proper separation of logic and presentation layer, it is easier to debug the code as well.