let him use it :) maybe he has the newest quad cores running on his server - then it wont even me measurable. otherwise it might probably be slightly noticeable. who cares.
we all agree that it doesnt make much sense to use a html helper for simple html markup. i good IDE will even show forgotten closing tags (which cant be done using html helper functions). indends display the hierarchic structure - html helper creates an array that is not very easy to "read". but if thats the way he wants to go - no problem. like jemery said, just because its available does not mean it is ment to be used this way. On 19 Sep., 08:55, Jeremy Burns | Class Outfit <[email protected]> wrote: > Nope - it's a great tool but in my opinion (and other experienced Cake > developers too, it seems) it has to be used with caution. Just because it CAN > do some things doesn't mean that you HAVE to use them. I can't see any sense > in doing this: > > <?php echo $this->Html->tag('div', $this->html->tag('h1', 'Here is my > heading.', array('class' => 'main-heading')), array(class => 'my-class')); ?> > > ...when this does the same thing: > > <div class="my-class"><h1 class="main-heading">Here is my content.</h1></div> > > Its less characters, easier to read (especially for non-Cake people) and it > doesn't use the component (so will perform better). > > So if you have conceded on the performance angle, why would you still want to > code this up? If wrap the html helper code up in another wrapper you are just > adding complexity and slowing everything down. I don't have any data, but I'd > bet that straight html beats coded html in any race. > > It definitely has its uses; but to a man with a hammer in his hands > everything looks like a nail. > > No attitude on my part; just passing on my opinion. Sharing is caring. > > Jeremy Burns > Class Outfit > > [email protected]http://www.classoutfit.com > > On 19 Sep 2010, at 07:28, Evan R. Murphy wrote: > > > > > I had already conceded that there may be performance issues with this > > approach, I just wanted more data on the severity of it. I'll do some > > profiling myself, but if anyone has knowledge about this they can > > share, I'd really appreciate it. > > > I'm puzzled by this attitude I'm reading (perhaps I'm misreading?) > > that it's a ridiculous proposition to use the HtmlHelper. The thing > > ships with CakePHP, and it's promoted pretty heavily in the Cookbook. > > If it's such a bad tool, isn't this at least a common misunderstanding > > among new Cake programmers? > > > Thanks, > > Evan > > > On Sep 19, 12:30 am, Jeremy Burns | Class Outfit > > <[email protected]> wrote: > >> You are focussing your efforts in the wrong place. Your time spent > >> pressing keys on the keyboard is a fraction of the time that your code > >> will be rendered across the interweb. If you have a library that you are > >> loading up which in turn loads up a component and then runs some functions > >> just to output a simple <div class="foobar"></div> statement you are > >> introducing massive overhead at run time (caching and so on set aside). > >> What is the problem with just doing the job right in the first place, or > >> even better using an IDE that helps you with this shortcuts? > > >> To build a good program the efficiency has to be in the finished product, > >> not in use of your time. > > >> Jeremy Burns > >> Class Outfit > > >> [email protected]http://www.classoutfit.com > > >> On 19 Sep 2010, at 02:58, Evan R. Murphy wrote: > > >>> On Sep 18, 7:50 pm, cricket <[email protected]> wrote: > >>>> Better to extend HTMLHelper. > > >>> I like that idea. Could you help me understand how you might extend > >>> HtmlHelper to make available these global functions (or perhaps even > >>> better, put them in some kind of namespace)? I'm new to PHP, so it > >>> wasn't clear to me how to write such functions in a class. Public > >>> methods seem to be the default. > > >>> Thank you, > >>> Evan > > >>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > >>> with their CakePHP related questions. > > >>> You received this message because you are subscribed to the Google Groups > >>> "CakePHP" group. > >>> To post to this group, send email to [email protected] > >>> To unsubscribe from this group, send email to > >>> [email protected] For more options, visit this group > >>> athttp://groups.google.com/group/cake-php?hl=en > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
