Introduction to PHP: Includes

This tutorial will introduce you to the PHP include statement, and its almost identical sibling, require.

The include statement is used to insert the contents of one file into the contents of another.

Read the rest of this entry »

Tags: , , , , , ,

Posted June 11th, 2009 in PHP, Tutorials - 31 Comments »

Thoughts on ColdFusion

One of the units I am taking this study period is Internet Design – Dynamic Environments. We have been given the choice between learning either PHP or ColdFusion. Since I’ve already been coding in PHP for a number of years, I have decided to learn ColdFusion. I was originally planning on learning Python this month, but I may have to put that on hold for awhile. I don’t mind learning two languages at once, but I am already learning Japanese, and have commited myself to doing some work on Muse’s Success, and regularly blogging here.

I started ColdFusion learning last week, and I appear to have made some decent progress. I have a basic forum working. I’m not sure how secure it is, and posts are not formatted, not even paragraphed, but I will look into that soon. Compared to when I learned PHP, I’ve made a lot more progress then I did in PHP in the time-frame of about 5 days. Many of the concepts used in one language seem to be able to be applied to another, and I’m attributing it to familiarity of the concepts that my progress has been swift.

Age may also have something to do with it, I was around 13, perhaps 14 when I began learning PHP and it was before I could say I had a solid grasp of HTML and CSS which certainly did not help. I remember being quite proud of myself when I was able to modify existing scripts, and archive desired effects. Even happier still, when in either late 2004 or early 2005 I was able to get my first significantly custom forum script (a GameFAQs spin-off) to run – not modified existing code. The main project before that was a video game database script, somewhat based on Vortex Portal on the back-end.

I am a bit disappointed in myself when I realise its been approximately 5 years since I first began learning PHP, and its still the only language which I work with. I should have attempted to learn another language before now. That being said my hosting environment only supports PHP5, so I won’t be able to use a new language for anything web based without purchasing another hosting account elsewhere.

ColdFusion appears to encourage the mixing of presentation and business logic which I dislike. There is probably a template engine that addresses this.  I also dislike mixing both ColdFusion Markup Language, and JavaScript… I mean CFScript. I would prefer ColdFusion chose one and stuck to it. That ColdFusion works based on tags also means that I cannot produce well formatted HTML (properly indented and nested) without making my source code unreadable, so a lot of unnecessary white-space in the outputted pages is annoying.

Being a fan of open source, I also dislike that ColdFuson is proprietary unlike most other popular web scripting languages. I am somewhat encouraged that there are some open source implementations of CFML. They seem to be more or less compatible with what I have written so far. I wonder if that holds true for more complicated applications. Those interested in ColdFusion but who are put off by it being a proprietary product should check out either Smith or BlueDragon.

I’ve pointed out what I dislike, but there are also things that I like. I like the built in form validation feature. I’m not a fan of the route it takes in implementing this, but it certainly makes producing a working and secure form much quicker. I also like how ColdFusion handles databases. I was initially opposed to it, but the system appears to prevent issues with database details being exposed if the server is miss-configured and exposes the source code. I also like that I only have one interface to work with any supported database. I generally use abstraction in my PHP scripts but ColdFusion does not need this in the first place. I also like that ColdFusion’s error messages are much more useful to me then PHP’s which are rather vague in some cases.

I can’t see myself developing any major projects in ColdFusion, but I am putting enough effort into learning it that this unit shall expand my horizons are far as career choices go once I conclude university. I don’t think I will mind developing in ColdFusion, but will likely continue to prefer PHP, and from the looks of things Python once I get around to learning it.

Tags: , , , , , , , ,

Posted June 11th, 2009 in ColdFusion - 39 Comments »