-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
2010/3/22 Michal Čihař michal@cihar.com:
Hi
Dne Fri, 19 Mar 2010 13:30:47 -0400 Marc Delisle marc@infomarc.info napsal(a):
for those who are not aware, Rasmus Lerdorf has an interesting article:
http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html
I need to study it more, however I believe that we should take these ideas into account while discussing any MVC move for phpMyAdmin.
Well it is interesting article, but using PHP this way requires lot of discipline. Basically he is right that using another template layer in PHP, what is itself basically template language is overhead. However having option to use arbitrary code will lead to some hacks at some place and you will end up mixing view and controller layers.
So I'm all for real template language which will really limit what can be used in it (though most of template languages for PHP I've seen do still allow any code).
Writing good code is always about discipline, if you don't have the discipline to apply the same coding style, think about the best solution in the long run and don't go for the quick and dirty, use comments where necessary, write documentation, ... then using a templating system or any other tool is not going to solve that. ;) If we would choose for a templating system, it should be for the right reasons (useability, being suitable for PMA needs, ...), not to enforce developers to keep logic and output/layouting seperate. Because that leads either to frustration, or to the templating system not being used.
I think this guy makes a good point, that you don't necesarily have to use a 'true' templating system. It is a possibility, but if it is too complex, or doesn't allow you to do what you want it to do, it's better to look for another system, or even create a custom one, maybe even a coding guideline.
I haven't used a templating system before, but I'm interested in it. But I think the MVC concept is more important, than using just any templating system. As choosing a system for PMA will affect a big part of the current code, I think it's a good idea to look for the best fitting solution (but that's a discussion that's going on in a different thread, I think), before rushing into just any system.
Greets,
Dieter