Slashdot Mirror


User: harry_f

harry_f's activity in the archive.

Stories
0
Comments
6
First seen
Last seen
Profile
(view on slashdot.org)

Comments · 6

  1. The Template View on PHP Template Engines? · · Score: 2, Interesting

    The notion of templating in PHP (or any web platform) is described by Martin Fowler in Patterns of Enterprise Application Architecture as the Template View.

    Implementation of the Template View is examined in some detail at http://wact.sf.net/index.php/TemplateView, which begins looking at "Why use templates" then examines different styles of templating, in terms of their markup and the API they provide to populate the template with data. The purpose is to lay this discussion to rest once and for all.

    Where PHP's concerned, the real question is why has everyone (and their dog) written their own template engine? In an ad hoc survey we counted over 80 public domain template enignes "out there"

    What's even more puzzling is why 90% of them all look the same with markup like;

    {if $font="bold"} Hello World! {else} Hello World! {endif}

    ...and a pinhole API like;

    $tpl->set('font','bold');

    My guess at the reason why is public here

    .

    As to what template engines in PHP are actually worth using, there are only two IMO;

    The first is PHP itself - use some self discipline and keep the pages where code gets mixed with HTML to the most basic PHP syntax - just the flow control statements like if/else, while and foreach.

    The second is any which can offer templating capabilities similar to Java's JSTL or ASP.NET. Which is where WACT comes in. Check the examples to get the idea.

  2. Re:this is fantastic - Petstore!?! on C# 2.0 Spec Released · · Score: 1

    "One of Microsoft's examples is the classic petstore program. ITs only 1/4th the amount of code from the Java version."

    The .NET petstore is a joke and has probably done more to damage Microsoft's cause with Java developers they were hoping to convert.

    The Java Petstore is there to show how to apply J2EE design patterns to build a layered and maintainable application.

    The .NET Petstore disregards about 10 years of design theory and takes every short cut it can, hence less lines of code. Prime example is the SOAP interface, which instead of using an underlying data model layer, contains hard coded queries. Change the database schema with the .NET petstore and you'll be hunting through the code looking for what's been broken.

    More: Petshop.NET: An Anti Pattern Architecture

    There's alot of angry Java coders out there as a result, and these guys make alot of the decisions, these days, on where blue chip IT spending goes.

  3. Re:heh on PHP Usage in the Enterprise · · Score: 1

    See that's where I differ - I'd rather trade enforced checks for greater productivity - guess that depends on the environment you work in and whether you prefer to hand code or use an IDE.
    But for checking, I prefer unit testing. Bruce Eckel makes an interesting argument that compiler checks are just a subset of Unit Testing, in Strong Typing vs Strong Testing.
    There's a similar discussion going on at Artima right now with C#'s creator arguing checked exceptions are bad while Java's co-inventor says checked exceptions are good.
    Sloppy coding is in the hands of the developer IMO, not the hands of the vendor.

  4. Re:heh on PHP Usage in the Enterprise · · Score: 1

    Agreed - there's alot PHP can learn from ASP.NET, in particular where Web Forms are concerned which is a great way of templating. It's a great class library.
    What's a little depressing about .NET though is it's commitment to static typing (or lack of commitment to dynamic typing). MS isn't really doing anything with JScript on .NET and various attempts to port languages like Perl and Python to .NET seem to have floundered, many stating performance issues e.g. Python for .NET
    Of course a verbose, statically typed language sells IDEs.
    Anyway - my guess is someone will have a solid implementation Web Forms in PHP within then next 6 months.

  5. PHP software development market - USD 5.6 billions on PHP Usage in the Enterprise · · Score: 2, Insightful

    There are 75.000 PHP development companies in the world, totalling 150.000 professional developers. Each company creates 12 websites per year on average, and one website takes approximately 32 work days to be completed.

    The average price of a PHP dynamic website is USD 6.000, and a regular company receives USD 75.000 income from PHP development per year. By multiplying this with the number of companies in the world, we can estimate the size of the PHP software development market - USD 5.6 billions.


    Potentially that's a massive market to anyone selling PHP related tools (and their aren't many). Of course that's based on the questionee's estimate.

    Zend is throwing the number "500,000" PHP developers around. That might be accurate - Interakts survey made the assumption that you worked for a PHP development company and had clients. That ignores, for example, those building intranets for internal use only, which my, guess is a significant number.

  6. Re:The code is the data! on PHP Usage in the Enterprise · · Score: 1

    One tip of the typing front, if you want a comparison which looks at value AND type, use === rather than == phpMyAdmin is one of the first generation of PHP apps and I agree is full of classic hacks but it works perfectly for it's intended purpose. If you want to put together a well designed PHP app, you really need to pick a one of the available PHP frameworks, unless you want to spent alot of time re-inventing wheels. eZ Publish is worth examining as is Interakts Krysalis (a port of Apache's Cocoon to PHP) although both "tie" you into quite deeply to their way of doing things. On the more "lightweight" framework front, it's worth investigating ISMO or WACT. But if you're really dying, try this: http://pear.php.net/python: "This extension allows the Python interpreter to be embedded inside of PHP, allowing for the instantiate and manipulation of Python objects from within PHP."