[plug] Learning PHP advice

Shannon Carver Shannon.Carver at P-S-T.COM.AU
Wed Feb 22 09:36:43 WST 2006



> -----Original Message-----
> From: plug-bounces at plug.org.au [mailto:plug-bounces at plug.org.au] On
Behalf
> Of Daniel Foote
> Sent: Wednesday, 22 February 2006 8:54 AM
> To: plug at plug.org.au
> Subject: Re: [plug] Learning PHP advice
> 
> > I must agree with Patrick here. The php manual is VERY good,
> > (especially compared to the perldoc...). Having  a local copy on my
> > machine has been very useful, and I still refer to it, even though
PHP
> > is the language I work in most.
> > I basically took my C/FORTRAN/Perl... knowledge, started coding php,
> > looking up the manual for function names, and syntax, and it was all
I
> > needed! Of course, some other things, I've taken longer to develop,
> > for example MySql PHP application's, which I do work in, but took
> > awhile to work out the best approaches.
> 
> 
> I've been programming PHP for a while now; I taught myself with the
> PHP manual. I quite like PHP, it's a neat language, and allows you to
> quickly build things. (But I am far from an expert...)
> 
> However, it's quite easy to turn PHP code into "spaghetti code" (as so
> called by a colegue), when mixing PHP code and HTML. My solution to
> this problem, which I only discovered in the last few months, is to
> use a templating engine. I recommend Smarty - http://smarty.php.net.
> 
> Smarty is written in PHP and compiles templates down to PHP code, so
> after the compilation (which is cached) the templates run really fast.
> It seperates the "application logic" from the "presentation".
> 
> On the DB side, I would also recommend looking at PEAR
> (http://pear.php.net). Again, this is written in PHP, and it contains
> all sorts of very useful additional functions - the only one of which
> I'm using is the DB layer. It's basically a DB abstraction. When you
> use it, you can easily switch between databases - quite a few are
> supported (at least MySQL, Postgres, Oracle, DB2, Access, and a few
> others). In a project I finished a few months ago, I was able to
> switch directly between Postgres and MySQL with no PHP code changes -
> and only one change to a SQL query (to get around a Postgres
> "difference").
> 
> The Smarty + PEAR + PHP combination has worked for me. Very well in
> fact. I'm currently working on two projects using these things.
> 
> Now if I only had some "graphic design" skills to make the output not
> look like some hideous abomination...

It's interesting you say that actually because I was thinking the same
thing, only a few months ago.  I'm in no way a designer (or an
arty/design minded person), but after being in the position of
completing several projects on my own, design and all, I've been getting
into it more and more recently.

I've always been interested in Photoshop, but its only in the past few
months that I've started learning "the little things" that go into
design, especially in web format (things like correct gradients and
shading on borders, buttons etc etc).  Once again, I'm no designer, but
with a little bit of practise, I've found that I've been able to make
page designs that are fairly good to look at, and still serve the same
purpose as a functional web application.

When it comes down to it, I'm a backend person (in a development sense
of course), I'll always prefer the grunt work, with the code and
database manipulation, but being able to do the design as well, I've
found extremely rewarding.
> 
> Have fun...
> 
> Daniel.
> _______________________________________________
> PLUG discussion list: plug at plug.org.au
> http://www.plug.org.au/mailman/listinfo/plug
> Committee e-mail: committee at plug.linux.org.au




More information about the plug mailing list