That's what SMARTY were designed for...



  • @archivator said:

    I realize that this is kind of an out-of-place comment but I just have to ask: what about caching?

    AFAIK, Smarty has a built-in cache mechanism that (supposedly) reduces load times by bypassing reevaluation of the template. While I'm with the "PHP is itself a template language" crowd on the main topic, I keep wondering how this caching can be (easily) achieved in pure PHP.

    Anything obvious that I'm missing?

    The caching has to be used with Smarty because it is a template system built on top of PHP.  PHP itself is already a fairly fast, VM-based language so the speed should be better.  However, PHP also has the option of using an opcode cache which prevents re-parsing of the PHP code.  This would give something like a 10x performance improvement and will definitely outperform Smarty.  Remember, Smarty is built on PHP and it is practically impossible for it to outperform the native PHP templating. 



  •  @belgariontheking said:

    @DOA said:
    Amusingly enough I'm the only one in this little flamewar stupid enough to have actually used a 3rd party template engine.
    I am yet another clueless sheep following the flow. As such I have no real arguments and my only option is to spout random insults. This doesn't really help me, but it's a good diversion from unpleasant activities like having to form an opinion by trying things for myself.
    FTFY

    @bstorer said:

    I was trying to convince some people last week that sugar works better in cars than gasoline. Amusingly enough, I was the only one in that little flamewar to put sugar in my gas tank.
    Yes that's the exact same thing like trying new technologies.



  • @DOA said:

    @bstorer said:
    I was trying to convince some people last week
    that sugar works better in cars than gasoline. Amusingly enough, I was
    the only one in that little flamewar to put sugar in my gas
    tank.
    Yes that's the exact same thing like trying new
    technologies.

    I don't try new technologies just because they're new. I expect whoever is evangelizing said technology to provide a good reason to use it. Thus far, you've provided zero reasons to use Smarty, save for vague half-assed statements. In fact, all you've really accomplished thus far is to thoroughly discredit yourself, by being completely incapable of responding to a single valid criticism.

    Now, even though I don't have years of Smarty experience, I am not unfamiliar with it. I see what it does, and I'm unimpressed. The only things it has going for it are:

    • Designers can't use all of PHP - That's great, but it's really not a primary concern. If it were a concern, I'd just restrict what they can do on the back end anyway.
    • It has a bunch of common functions for stuff like making tables with alternating colors - Such functions are useful, but they don't warrant an entire template system.
    Now I'll ask you again, what great feature am I missing?



  • @bstorer said:

    Now I'll ask you again, what great feature am I missing?
    You're asking me what's the point of a template engine 50+ posts later? Seriously?

    I would tell you, like I told everyone else, to actually try it for yourself and form your own opinion, but you know what? If you hate the idea with such a passion, just don't use the bloody thing.



  • @bstorer said:

    Now I'll ask you again, what great feature am I missing?
     

    Your problem is trying to argue with DOA. Like a few other recent members, he is not here to provide backup to ridiculous arguments he makes.

    Instead, he will make a ridiculous statement, and then jump all over the "you're a troll!" and "people who use insults lose the argument!" bandwagons. It is a pattern of behavior he has used for a while now.

     

    Interestingly enough, he uses the same "Why should you use it? Try it, and you will know" argument that other clueless, brainwashed people do. IOW, he doesn't know why he uses it. But he does, and he feels he needs to defend that and even try and convert some more people into brainwashed zombies.

     

    I advise you give up. He will never actually answer anything, he will just jump all over the aforementioned bandwagons and stir a small reaction from other clueless people who simply want to defend him because everyone is calling him stupid.


  • ♿ (Parody)

    @DOA said:

    I would tell you, like I told everyone else, to actually try it for yourself and form your own opinion, but you know what? If you hate the idea with such a passion, just don't use the bloody thing.
    I've never used either one (most of my web experience has been JSF), but based upon what I've heard in this thread, there's no compelling reason to consider smarty.  A quick browse of their page tells me that it basically is there to enforce separating presentation and business logic, which is apparently already possible (though not enforced) in PHP.  Is there some other magic that happens with smarty?  Something that PHP doesn't have?

    Otherwise, keep it going, this is a really amusing thread to read.



  • @DOA said:

    @bstorer said:
    Now I'll ask you again, what great feature am I missing?
    You're asking me what's the point of a template engine 50+ posts later? Seriously?

    I asked you all the way back here, in my second fucking post in this thread. You've yet to provide anything approximating an answer.


    @DOA said:

    I would tell you, like I told everyone else, to actually try it for yourself and form your own opinion, but you know what? If you hate the idea with such a passion, just don't use the bloody thing.

    Look, if you can't answer the question, just say so. I don't need to try it: I've just given you a clear cut explanation of why I see no need for it. You seem to vehemently disagree, but you can't give me a single justification. MPS has you pegged completely; you're not even sure why you use Smarty, are you? You just feel the need to defend it, but you're way out of your depth. You decide instead to opt for nonsense statements like "Do you even know what a template engine is?" which have no bearing on the conversation, and only demonstrate that you don't understand enough even to know why you're wrong.



  •  @MasterPlanSoftware said:

    <defamation, twisted facts and half-assed attempts at stereotyping>
    Just when I thought you couldn't fall any lower. Oh, and keep locking your posts. It's much easier to post inaccurate drivel without being called on it. 



  • @morbiuswilters said:

    @Carnildo said:

    This confusion is what's causing the flame war here.

    Wrong.  The flamewar is because DOA seems to think he needs a templating language on top of PHP and everyone else realizes that PHP has templating built into it.  End of story.

    Isn't this a case of the "Inner Platform Effect" ??? You know ... starting with some neat API, then growing it big enough that it essentialy becomes a half-baked version of the platform it sits on top of? Kind of like doing taglibs that invoke ... taglibs on Java.


  • @archivator said:

    I realize that this is kind of an out-of-place comment but I just have to ask: what about caching?

    AFAIK, Smarty has a built-in cache mechanism that (supposedly) reduces load times by bypassing reevaluation of the template. While I'm with the "PHP is itself a template language" crowd on the main topic, I keep wondering how this caching can be (easily) achieved in pure PHP.

    Anything obvious that I'm missing?
     

    tip one: If your looking for a caching solution, don't install a templating engine.

    There are many caching solutions too choose from, zend platform has some very good options, especially the partial page caching which works a bit like the php output buffering interface, but instead lets you cache what's in between. Then if you don't have the money for ZP,  zend framework also gives you a few, very easy to use solutions to do your caching. A special mention should probebly go out to memcache because if your building any kind of high preformance site you really want to use that. But really just google php and caching.

    Also not all caching has to be in your code, installing a reverse proxie can give you a massive advantage against high traffic.

     

    Also while i personally don't really see the use for smarty, it does get used a lot, don't ask me why. But in the end its not all that bad, its just a bit like a fifth wheel. It solves some problems better solved by other software and gives you a templating language you don't need.

    It also gives interesting problems when having to integrate two seperate systems that both have their own smarty. (*looking at you serendipity*)



  • @danixdefcon5 said:

    Isn't this a case of the "Inner Platform Effect" ???

    That is precisely what this is.  Everyone but DOA seems to see that.



  • @morbiuswilters said:

     TRWTF is Smarty.  Why do we need a template language for PHP which is itself a template language?

     

     

    Because I hate the visually nausiating:

    &lt;?php echo $foo ?&gt;

    compared to a cleaner:

    {$foo}

    The php powers that be seem to frown on the short tags which would make php templates so much cleaner.

     



  •  @morbiuswilters said:

    @danixdefcon5 said:
    Isn't this a case of the "Inner Platform Effect" ???
    That is precisely what this is.  Everyone but DOA seems to see that.

    Assuming a handful of people are "Everyone" . Still it doesn't change this simple fact:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear



  • @DOA said:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear

    But surely also: Thoroughly understanding the fundamental principles of a particular technology and thereby appreciating that you could not possibly have any requirement for a given intermediate tool = informed judgement?



  • From a quick once-over of smarty's feature lists it basically looks the only thing it has that PHP doesn't is less features.

    Which seems a weird thing for me to say is good, but I can see situations where it would be. Sure PHP is capable of anything Smarty is, but not vice versa. It's basically sandboxing the display layer away from the business logic layer (At least partially, I'm sure if you really tried you could bastardize smarty too, but not as bad as is possible in PHP). So for a development crew who follow best practices the sites would be almost identical. PHP doesn't have built-in sandboxing though to the best of my knowledge, though it might.

    There's many times where I've wanted to insulate my code better from designers than regular approaches allow. I mean sure, you've been great with seperating your logic from display, but along comes the designer who just read his PHP for Beginners book and thinks he knows everything and decides he can implement this new thing he wants without talking to you and put code to dump the contents of a file as HTML into your display layer... (That said, I wouldn't feel safe not reviewing changes from a designer who'd do that before they went live, smarty or not)

    That said, I'd personally still choose PHP and simply review templates for 99% of purposes, but I can feasably see that 1% of times where that feature might be good. Even then, I'd need more research before I'd say smarty's the best choice (Having never used it myself :P)

    Disclaimer 1: I have not coded anything beyond personal interest pages in PHP, most my webpage experience is ASP or .NET based. I'm not claiming to be an expert on PHP.

    Disclaimer 2: This isn't an agreement with DOA, and I kinda don't want to post this because it might be interpretted as agreeing with him. There's a big difference between weighing pros/cons of a system and going "Zomg it's great! Anyone not using it must be stupid. Why? Cause it's awesome" :P



  • @fyjham said:

    Which seems a weird thing for me to say is good, but I can see situations where it would be. Sure PHP is capable of anything Smarty is, but not vice versa. It's basically sandboxing the display layer away from the business logic layer (At least partially, I'm sure if you really tried you could bastardize smarty too, but not as bad as is possible in PHP). So for a development crew who follow best practices the sites would be almost identical. PHP doesn't have built-in sandboxing though to the best of my knowledge, though it might.

    And then they added:




    I've used Smarty. It works quite well. It can be useful if you have a HTML monkey that can write and view HTML, but does not understand PHP. Then he can view his pages 'offline' and the smarty tags just show up as text. It also forces you to use default constructs (unless you use the {php} tag) which improves the overall style of the code.



    Then again, my current php pages are a mess of php parts embedded in HTML, cause that's much easier to write for myself. Just don't hand it to anyone else for maintenance.



  •  @Zagyg said:

    @DOA said:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear

    But surely also: Thoroughly understanding the fundamental principles of a particular technology and thereby appreciating that you could not possibly have any requirement for a given intermediate tool = informed judgement?

    Fair enough. Nothing wrong with informed judgement. We certainly can't have hands-on experience with every technology out there. And not everyone needs a template engine.

    It's just that, unlike certain people here, when my expertise on a subject amounts only to an informed opinion, I'm not arrogant enough to get into a flamewar with people that have actual experience on the subject.



  • At a company I used to work for it was decided to write an admin screen to let admins modify their templates through the web. The big benefit of Smarty in this case was the additional security of knowing admins couldn't execute any arbitrary PHP code. So if an admin password got out the person couldn't drop a little back door in the bottom of some template file that would go unnoticed. The only time this is a real benefit is when the application in question is designed with the knowledge that people with little to no programming experience will be making design changes to templates. Smarty still does not, however, have any good arguable use in applications designed to be used by people with programming knowledge.



  • @DrJokepu said:

    @DOA said:

    Maybe he means graphics designers? In my personal experience the vast majority of their expertise lies in using Dreamweaver and the like. Asking them to add their HTML to the PHP framework is usually like giving a 7 year old gunpowder and telling him to build his own fireworks. Even if he can figure it out, it will most likely end in tears.

    Unfortunately I have yet to meet a graphics designer that's interested in learning to use a template system, Smarty or otherwise. Their philosophy is usually "If I can't drag-n-drop, I aint using it".

    The one who should be electroshocked here is the person who asks a graphic designer to do any development at all. They are graphic designers. Not developers. A graphic designer -by definition- cannot do development, and a software developer cannot do graphic design. That's the whole point of specialization. It is just unfair to expect people to do stuff they are not trained to or don't have the affinity to do. Personally, I never will be able to sell cars, neither to catch criminals, nor to design graphics. That's because software development is my profession and I suck at everything else, including Photoshop, Dreamweaver and the rest.

    To be honest, I am sick of the arrogant elitist mentality of "everybody else is stupid" in the IT/Software Development Industry. It is really unprofessional and should be grown out already.

     

     You're just reiterating the quote, though. Graphic designers shouldn't develop; that's what template engines are for.

     However, if a graphic designer is also a web designer, he has to be proficient with template systems, HTML and CSS. If he isn't, he should crank out a prototype in a graphical program like Photoshop and leave it for someone else to implement. Drag&Drop-generated templates are usually an abomination just as drag&drop-generated programs are.



  • @DOA said:

    And not everyone needs a template engine.

    PHP HAS A TEMPLATING ENGINE BUILT IN.  PHP HAS A TEMPLATING ENGINE BUILT IN.  PHP HAS A TEMPLATING ENGINE BUILT IN.

     

    @DOA said:

    It's just that, unlike certain people here, when my expertise on a subject amounts only to an informed opinion, I'm not arrogant enough to get into a flamewar with people that have actual experience on the subject.

    Believe me, I have far more experience building web apps than you do.  I know all about templating engines, PHP and Smarty.  Just because I don't use Smarty you assume I don't know anything about it.  I don't use it because I know a lot about it and can see it is nothing but a useless layer atop PHP.



  • @morbiuswilters said:

    @DOA said:
    And not everyone needs a template engine.
    PHP HAS A TEMPLATING ENGINE BUILT IN.  PHP HAS A TEMPLATING ENGINE BUILT IN.  PHP HAS A TEMPLATING ENGINE BUILT IN.
    So you keep telling us. Yet <php code><html><php code> and Smarty templates are two completely different things.
     

    @morbiuswilters said:

    @DOA said:
    It's just that, unlike certain people here, when my expertise on a subject amounts only to an informed opinion, I'm not arrogant enough to get into a flamewar with people that have actual experience on the subject.
    Believe me, I have far more experience building web apps than you do.  I know all about templating engines, PHP and Smarty.  Just because I don't use Smarty you assume I don't know anything about it.  I don't use it because I know a lot about it and can see it is nothing but a useless layer atop PHP.
    Maybe you're the one making false assumptions? How exactly can you compare experiences when you don't know the first thing about mine? Not to mention my initial point is still stands:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear.

     



  • @DOA said:

    So you keep telling us. Yet <php code><html><php code> and Smarty templates are two completely different things.

    "Completely different things"???  You are so full of shit.  They are different by a few characters, for fuck's sake.

     

    @DOA said:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear.

    I am inclined to conclude that you are actually illiterate and just reply with random gibberish.  I have experience with Smarty from an analysis perspective.  I have rigorously investigated various frameworks and templating systems that were presented to me.  I know what I am talking about.  You have yet to provide a single reason to use Smarty instead of PHP.  NOT ONE SINGLE FUCKING REASON.  If your next reply does not contain a bullet list of reasons to prefer Smarty over PHP I will consider this argument over and myself the victor.  I hate to win by default but it's obvious you aren't even trying to debate this.



  • @morbiuswilters said:

    @DOA said:
    So you keep telling us. Yet <php code><html><php code> and Smarty templates are two completely different things.
    "Completely different things"???  You are so full of shit.  They are different by a few characters, for fuck's sake.
    Again... hands-on experience says it's a little more complicated than that.@morbiuswilters said:

    @DOA said:

    Arguing about a technology you have zero hands-on experience on = talking out of your rear.

    I am inclined to conclude that you are actually illiterate and just reply with random gibberish.  I have experience with Smarty from an analysis perspective.  I have rigorously investigated various frameworks and templating systems that were presented to me.  I know what I am talking about.  You have yet to provide a single reason to use Smarty instead of PHP.  NOT ONE SINGLE FUCKING REASON.  If your next reply does not contain a bullet list of reasons to prefer Smarty over PHP I will consider this argument over and myself the victor.  I hate to win by default but it's obvious you aren't even trying to debate this.

    Analysis perspective you say? I have actually used the software. As for winning the argument that is in fact you greatest problem. You spend your time trying to win arguments instead of listening. If you need "a single reason to use Smarty instead of PHP" all you have to do is read the thread.

    Unfortunately there's no bullet list in this reply so you might as well return to the petty little world you seem to live in safe in the knowledge that you are "the victor". I'm sure they have a parade ready for you there.

     



  • @DOA said:

    Again... hands-on experience says it's a little more complicated than that.

    You have provided no examples of this.  None whatsoever.

     



  • @DOA said:

    you are "the victor"
     

    morbiuswilters certainly appears to be. Also, I appear to be, since my synopsis of your behavior has been proven 100% true.



  • @MasterPlanSoftware said:

    <font color="#dd0000" size="6">morbiuswilters certainly appears to be.</font>

     

    IS THAT FIREWORKS I HEAR?  AND A MARCHING BAND?



  • @morbiuswilters said:

    Game Over! I win!
    Good for you! Here's some candy, now go play with the other kids

    @morbiuswilters said:

    IS THAT FIREWORKS I HEAR?  AND A MARCHING BAND?
    Sounds more like a blowjob from MPS.

    @MasterPlanSoftware said:

    Also, I appear to be, since my synopsis of your behavior has been proven 100% true.
      Speaking of profiling I'm pretty sure I've mentioned in the past the fact that you Must. Have. The. Last. Word.

    I guess my synopsis of your behavior has been proven 100% true as well.



  • @DOA said:

     Speaking of profiling I'm pretty sure I've mentioned in the past the fact that you Must. Have. The. Last. Word.

       

    Didn't you just get the last word? Congrats!     



  • @DOA said:

    Here's some candy
    God I hope it's not smarties.@DOA said:
    @morbiuswilters said:
    IS THAT FIREWORKS I HEAR?  AND A MARCHING BAND?
    Sounds more like a blowjob from MPS.
    We have a homophobe here?@DOA said:
    @MasterPlanSoftware said:
    Also, I appear to be, since my synopsis of your behavior has been proven 100% true.
      Speaking of profiling I'm pretty sure I've mentioned in the past the fact that you Must. Have. The. Last. Word.
    Yep.  And now I'm stealing it from you.  BOOM!  HEADSHOT!



  • @belgariontheking said:

    We have a homophobe here?
    No, far be it from me to deprive you of blowjobs from MPS.@belgariontheking said:
    Yep.  And now I'm stealing it from you.  BOOM!  HEADSHOT!
    wtf...

     



  • I've used templating systems for other languages that lack built-in templating features. The only thing PHP-templating lacks compared to those templating systems is that it lets you go far beyond the bounds of good-practice for templating. If you are working with other people who may not be up-to-snuff on best practices, using a templating language like Smarty might make sense, because it forces them to use good practices. However, if you already know what you're doing and are going to use proper templating anyway, there's no reason not to use PHP. Why take the time to learn the syntax and intracies of the templating system, when you can do it just as well in regular old PHP?



  •  This is the best thread I've seen on this forum in all my lurking.

    I don't like Smarty, but I work with a lot of people that do. They swear by it, I just hope I'm never asked to maintain any of their sites.



  • @belgariontheking said:

    @DOA said:
    Speaking of profiling I'm pretty sure I've mentioned in the past the fact that you Must. Have. The. Last. Word.
    Yep.  And now I'm stealing it from you.  BOOM!  HEADSHOT!

    My last word would be "locked". As in "thread locked".


Log in to reply