Friday, December 24, 2010

The Flexibility of PHP

I have been using PHP for 4 years now and I like to think I know it pretty well by now. It's a great language, it is open source, has regular updates and fixes, and has a great online manual.

What you also get when you talk to other developers who use other technologies is that it is non-complied and uses the 'Spaghetti' coding style where you have SQL in with your code, along with the formatting of the results returned from the database and all your HTML.

Well, for them and other people who are looking to learn a Server side Web Programming language, PHP is not sub standard, PHP is flexible - let me explain. People are also under the opinion that PHP is an easier language to learn than many other languages and yes it can be, but only because it is flexible and allows you to explore it from a number of different angles.

First, let's take a look at the 'Spaghetti' option, yes it is a little in efficient and yes it CAN be hard to edit if you have to come back to it in the future. But if you are new to programming and web development then it is the perfect way to start. You can learn the other (multi-tier) methods when you feel a little more comfortable. When you first learn to program, learning using a procedural manner is a great way to learn a language, the way it behaves and how logic determines specific conditions. Once you have these skills mastered, you can then start to apply them to more advanced methods, i.e. Object Oriented Programming.

For those who have never seen a bit of PHP 'Spaghetti' Code it looks a little like this:

<?php
    $SQL = "SELECT field1 FROM table";
    $query= mysqli_query($databaseLink,$SQL);
    while($row = mysqli_fetch_array($query,MYSQL_ASSOC)) {
       echo '<div class="tableResult">'.$row['field1'].'</div>';
   }
?>

The other option is to use a multi-tiered approach which could use Object Oriented Methods. When you use this approach, it works around the basis of separating code into different sections. When I first learnt OOP I used a two tier approach as I was a freelance developer and as such I thought that it was the best way to go. My two tier approach could very be different from another developer's 2 tier approach, but again, this is the flexibility of PHP. My 2 approach worked on the basis of keeping my Application Logic and my presentation in 1 tier and my business and data logic in another tier. When I created an application, I would follow this method and it served me well, across numerous (and large) applications. If I wanted to use a class, I would invoke it in the logic based file, the results would be sent back and the logic based file would process, format and output the results. The next example uses a separate database class but premise is the same, that the database and application classes from the controller or or input decision file.

//database class
class database {
public function retrieveResults ($SQL) {
$rows = array();
$query= mysqli_query($database,$SQL);
while($row = mysqli_fetch_array($query,MYSQL_ASSOC)) {
$rows[] = $row;
}
return $rows;
}
}

//application class
class application {
public function getTableData() {
$SQL = "SELECT field1 FROM table";
$useDatabaseClass = new database();
$results = $useDatabaseClass->retrieveResults($SQL);
return ($results);
}
}

//calling script
$useApplication = new application();
$getData = $useApplication->getTableData();

foreach ($getData as $row) {
echo '<div class="tableResult">'.$row['field1'].'</div>';
}

Then there is the 3 tier approach - one popular name for it is the MVC approach. This is where you separate application logic, data handling and presentation in to their three separate components. This is useful to use when you on any project, but I found it of most useful since I have been working in a design agency, as I work on multiple projects on any one time and front end guys who work there need to access many of the view files. Please note that the way you call scripts in reality would probably not look like the above, these are just for illustration purposes. In reality, if you use an MVC framework or you create your own, you would more likely extend your base classes rather invoking them using the new keyword.

The three tier is very similar to the two tier approach. Except that the $getData array is passed through to another file which outputs the results using the foreach loop. That's it, the hard work is really done when you move from one tier to two tiers, the third tier (the view tier) is really just a minor extension of the controller tier, which in my opinion works in tandem with the Model or Business Tier. The view or presentation file can be loaded in a number of ways, using include() or require() or even eval().

A few last words, when you start down your PHP developer career, do not let anyone tell you which method to use, weigh up the situation and make an informed decision. I like to build my online applications using 3 tiers using codeigniter as the MVC framework, but I still write single standalone scripts when I feel the situation needs it

Labels: , , ,

Wednesday, November 3, 2010

My top CSS tips

In CSS there is usually more than way to skin a cat. Some people use certain methods, some use others. If you a way of styling that works, whose to say it is wrong. Do not let people tell you are doing it wrong.

I originally created this page as my top 10 tips but still continues top grow on a weekly basis. This post is not a tutorial page, more of a reference for those CSS coders who may be between the beginner and intermediate stage.

Add some consistency

Reset all your core elements to use the same set of basic rules, as some elements show different amounts of padding/margin by default in different browsers, i.e.

div, p, ul, li {margin: 0, padding: 0;}

Types of element

The main two types of styling elements are block level elements and inline elements. The main difference between a block element and inline elements are that block level elements will take up all the space within their parent element until instructed otherwise through CSS. And remember you can change the display type using your CSS.

The big difference between padding and margin

Remember that when dealing with elements. Margin is outside the element and padding is inside the element.

Use single Lines in your style sheet

Write your CSS in single lines, it may look prettier when you write your code, but when you have 300 hundred defintions, it can be extremely infuriating to scroll through your page with all those code blocks.

Browser specific CSS

You can override styles for different browsers by browser and version, check here for a really good list that gives you code examples for numerous

Overriding styles

Make use of !important when you are struggling with you need to override a style, here is an example:

color: #FF0000 !important;

Important Shorthand techniques

Use shorthand techniques when you can. For example, let's take a look at margin (you can substitute padding here if you want to):

Margin-top: 10px;
Margin-right: 5px;
Margin-bottom: 15px
Margin-left: 4px;

Can be written like this:

Margin: 10px 5px 15px 4px;
Top, right, bottom, left

You may also use another shorthand technique for margin/padding when the top/bottom and left/right use the same values:

Margin: 10px 5px;

Or if you want to apply the same value to each side you can use:

Margin: 10px;

The need for negativity

Using negative margins can in some cases be beneficial when you want to position an element just once when you don't want to change the larger majority of elements.

Generic classes

If you think that you will be adding similar styles to a number of different spans, like color. Create a generic class that adds those colours, i.e. if you know that you will be using multiple validation areas then this may be beneficial

Using multiple classes

You can only assign one ID per element however you can apply multiple classes to an element and is suprisingly easy to do, you just separate the class names using a space. Combining classes can save you repeating definitions and save you time in the long run, for example:

<div id="elementID" class="class1 class 2 class3 class4">My Element</div>

Bullet Points Images

If you want to use an image on a bullet point, you have more control over the image if you do the following. Set the list-style-type to none an add a background-image attribute. The main reason being that you have more control over the background than the normal bullet image as you can use background-position to make sure it looks perfect.

Install the Firebug Add-on for Firefox

This will save you a tonne of time as you can (amongst other things) edit your CSS/HTML on the fly which you allows you to test and try your changes before applying them to your style sheet. There are developer tools for Chrome and IE, but in my opinion neither of them come anywhere near as close to Firebug!

Labels: , , ,

Wednesday, August 11, 2010

Should all web developers work in SEO first

First a little background about myself. I first learnt HTML back in 1999 and was immediately blown away by the instant results of it. You added a likely bit of mark up and boom you saw the results in your browser - images, headers, tables the lot. Some quick code and it was like you could paint with the text in a matter of minutes, for someone with zero artistic ability it was a great feeling to see your ideas rendered on a screen. Not that the designs were anything to get excited about, but it was enough to get me hooked in web design.

Anyways, after a few years playing around at university I thought it was high time I get myself a job in the field that I studied for. After being put in touch with a company through a friend in 2005 I was thrust head first into the wonderful world of SEO (Search Engine Optimisation).

A very large part of SEO centres on the construction of the web page. There are so many ways that you can build a web that it would take me about a thousand years to go through them all. This article really is a piece about how SEO can help make you a better developer through best practice.

This blog post is based around a site I took on from a client who had invested thousands of pounds in to a website and was getting very little traffic. He came to me as I had built a number of smaller sites for a mutual acquaintance that had performed very well in the search engines and asked me if there was anything I could do. I took a look at the website and while it had been developed to a very high standard, the optimisation was severely lacking. After going back to the customer, I asked the customer what happened and it was down to the project manager that was employed to manage the job wanting to over-engineer the site, thus bogging down the original developer. A large part of the blog is information, but I will, also add in the example of the rebuild, where I can. There are so many more SEO techniques you can employ in addition to what I mention below. This case study is more of what I did when I rebuilt and the main areas we concentrated. Further more, there was about 1,200 pages in the database, this information went largely unchanged when it moved to its new home, I mention this, because like with all tests, the monitoring of all elements and variables is essential. Please also note that HTTP 301 redirects were used to make sure that no links were broken and that the busiest pages were mapped to forward to their new home. Non-essential pages were mapped to the home page.

Page construction

One of the first things that I learnt was how the construction of page can affect the optimisation of a page. In the beginning of my own development I used the very common technique of using tables to create the pages layout (even now, people still use this method) rather than the current element and CSS approach that I use now. When I made the switch to developer, not only is easier to keep your design separate from your source code but also makes for a more optimised page. When Google crawls a page it's not interested in the font sizes of your text or what colour it is, it just cares about the content and how this content fits in to the grand scheme of how Google sees the web. Not that layout is the only important part of page. Page Elements, div tags, H1, H2 and all the other primary tags should be used to create the perfect web page. If you took this idea to the extreme, then only those developers who can create ultimate optimisation should create web pages. This is of course not true, but you can get my point which is when you work in SEO you learn best practice that will help you no end if you change career path and become a developer.

Using jQuery/JavaScript to help improve your page's content and or functionality

Let us look at another example; you want a fully functional and flashy slide down menu based at the top of your page. Or the customer wants to have a mission statement at the top of the page that whilst essential to the brand is not necessarily optimised text. A developer without this experience must put the HTML in to the page and think nothing more of it, whereas a person who keeps SEO in mind knows the most optimised text should be towards the top of the page. This us where the SEO primed developer would use jQuery or JavaScript to load the HTML in to the DOM instead. In this situation, we get the best of both worlds as we have our text at the top in terms of presentation and our Google read source code remains uncluttered and optimised.

Another area I would like to touch on is the URL structure of a website. A great many, many people have argued about URL structure and how it affects SEO, all I can do is talk about how it affected the site I rebuilt for my client. I took a look at the existing URL structure and it was based around a 6 folder deep directory structure, which would have been almost impossible for the Search Engines to crawl, especially as there were 1,200 pages spread amongst them. Whenever I build a site, I keep the site as simple as possible. The site now goes no further than 3 folders deep and each page links to its siblings so that each page had hundreds and hundreds of links going to it.

I have not created this entry to boast but is more of a case study of how well a site can do when developed even when it has been completely rebuilt with SEO in mind with some figures to back up the theory.

OK, here are some of the figures for the rebuild, figures post rebuild, figures pre-rebuild a few reminders of some of the facts:

Pages in site: 1200
Domain Age: 4 years
Months since rebuild (at time of writing): 5 months
Development Language used pre-rebuild: PHP
Development Language used post-rebuild: PHP
URL rewrites in place pre rebuild: Yes
URL rewrites in place post rebuild: Yes

Average Visits prior to rebuild per month: 1,500
Average Visits post rebuild per month: 8,200

Yeah, you read that right, the site has had a 550% jump in traffic since the rebuild and the customer is now starting money from, something he wished he had been able to do when he first had the site launched. Yes, the traffic is still not huge, but the 550% increase in traffic in only 5 months is certainly a step in the right direction.

In conclusion I'm not saying that it is essential to have 10 number of years in SEO to become a web developer but it is important to know how to create a well formed page in terms of optimisation. When you consider how competitive the Search Engine Results Pages are and considering it is the developer that will help you attain these positions - it becomes even more important that these developers know how important optimisation is when developing a website.

Labels: , , , ,

Wednesday, June 2, 2010

What is it be a web developer?

This piece is not about the history of the web, more about how the web grows and how new technologies constantly change the nature of what it means to be a web developer.

The Internet is growing (nothing new there with that statement). When a new idea or piece of technology springs up, developers are needed to be able to write software for it so that the new innovation gains ground and popularity.

The term 'web developer' came about because the web became the most sought after use for the Internet. When this happened people wanted to access information quickly and reliably. As a result web developers started programming on systems and servers that could dish out this information in a better way. With the integration of databases and server side coding, it allowed websites to move on from the stateless nature of HTML that is when Tim Berners-Lee developed it.

As time has moved on the web has gone from strength to strength. The other huge leap forward was advent of Javascript, a programming language that allowed coders to manipulate the pages that users saw in their browsers. This allowed websites to start behaving more the more traditional applications that ran on PCs and other computers. Of course it was only matter of time when the two started to inter mingle to give us even better applications and lo and behold Ajax sprang up when Microsoft created the XMLHttpRequest Object which allowed developers to send asynchronous requests to servers without the page reloading, thus enhancing even further the web experience. Ajax was designed to work with both XHTML and XML so that information could be injected and updated quickly and using less resources. Why reload the whole page when you only need to change the information in a single element? XML and the many web services created to use it allowed people to integrate information from website to another in a standardised way and crossed the divides that sprung up from the use of different systems.

The web didn't stop there over time, newer ideas and innovations continued to spring up all over the shop and applications became more and more complex. Social Media started to come in to the main stream and integration between web sites and applications became more and more common. MySpace and Facebook started to come to fruition and the web continued to make new ground with many people that had considered the web to be a fad with those 'young people'.

With the advent of Ajax it allowed applications to be made and resemble desktop programs, but there was a problem that became apparent as time went on. As with most javaScript functionality it had its problems with the numerous browsers that were available in the market. It was also quite code intensive and lots of testing was usually needed to make sure code with all browsers. That is where my topic pops up and that topic is jQuery. jQuery is a javaScript framework and has ironed out many of the problems that made javaScript such a pain to work with in the first place. DOM traversal, Ajax calls and element selection was made easier and standardised, no more cross compatibility testing to make sure things worked in firefox and IE. Debugging and development time has become vastly decreased, something of which, if you are a business can be passed on when you quote your customers for work.

So what is the future for the web. Well in my opinion, the future is becoming smaller. Well it is terms of the web. Mobile technology is becoming more and more common and I think that is where a lot of the future innovations will lie. Apple and Google have both moved into the mobile phone market and making a lot of people think about using their mobile device as the primary device for accessing the Internet. I myself have bought a mac mini to develop applications for iPhone as I want to keep with up with how the market is changing. I haven't actually created an app yet as I have too many commitments in other areas but the area between desktop applications and web applications are coming together quicker than ever, something of which I think will change the web and the Internet forever.

Labels: , , , , , ,

Wednesday, July 15, 2009

My PHP development Book List (Advanced)

Advance your PHP knowledge...

I hope you all enjoyed my recommendations on PHP books for beginners. I now give you my list for more advanced books that will take you further into the world of PHP programming and development.

1. I touched upon this book in the beginners book list, but feel like it should be mentioned upon more here. Advanced PHP 5 by Larry Ullman would be the first book I would start to read if I was to go in to more Advanced PHP 5 programming and the reasons are as follows. It has great reference chapters on XML, Ajax and OOP - all of which I would recommend you move on to with more detailed books (some of which are listed below). Each chapter is (relatively) light weight and will give you a good grounding in the subject.

2. The next book I would take a look at is PHP Object-Oriented Solutions by David Powers for friends of Ed. This is a brilliant book, I didn't learn OOP from this book, but from looking at it retrospectively I wished I had. It's great book to learn from and (chapter 2 especially) works as a great reference manual should you need it.

You quickly realise when you are building your applications that you often have retype lots and lots of code. OOP is based on code reusability and modularity so that once you have classes in place, the hard work is done. OOP is also good for those who have to keep one eye on the profitability of their business i.e. free lance developers. With OOP in PHP, you can use common classes so that your time can be utilised in a more efficient manner.

I recommend OOP to all people learning PHP, it may take you more time in the early stages when you are designing and building your class, but once the classes are finished you will find your projects running far smoother. Getting one's head around OOP can be tricky so, unless you can do it in another language I would leave this until you really feel comfortable with the language before you proceed.

3. To learn Ajax with PHP I would use Ajax And PHP Building Responsive Web Applications by Cristian Darie et. all. If you managed to master many of the concepts in JavaScript and PHP then this shouldn't be too hard a book to digest. Not only does teach you about Ajax and how to use it with PHP and MySQL, it also gives you real life examples of concepts that can be used in most modern websites.

N.B. I would suggest that you work through at least some of the chapters in the previous book as this Ajax book does use PHP OOP concepts.

Ajax is a brilliant concept and again, it is something that I would recommend all developers to at least try. Not only does it add that all important visual flair to pages, it also has other benefits too. If server loads are an issue, either through the amount of data or instructions they can handle it helps as only the parts of a page that are needed are sent from the server, rather than the server having to send the whole page again.

Labels: , , , , , , , ,

Tuesday, July 14, 2009

My PHP development Book List (Beginners)

Learning PHP and web development from scratch...

Learning a new language can be difficult, especially when you haven't got someone looking over your shoulder trying to help you. That is why we have text books and believe me, some are definitely better than others. This is not just a statement based on 1 example, there were numerous times throughout my time at university that we were given a recommended reading list and the books that were supposed to help, were in fact just being endorsed by some unscrupulous lecturer who wanted to line their pockets - though this could never be proven. If you are reading this as a student, then please before you buy a book that has been 'recommended' take a look at some reviews on web sites that are freely available, after all £30 of your loan cheque is quite sizeable. I have numerous books that were truly awful and have never seen the light of day since the 13 times I attempted to read them.

Anyway, back to the subject at hand:

Here are a list of books I would use to start learning PHP and web development from scratch. You may disagree with me and that's fine, I may open comments on this post, so please do leave me your choices. You may find that I recommend the same published on numerous occasions, I am endorsing any published over another and all recommendations are purely my opinion based on my own experiences.

1. Start at the beginning - Learn (X)HTML - I was a fresh faced first year when I started learning HTML and loved it almost immediately. I had never done any real programming at this point and found it awe inspiring that you could write something in Notepad, refresh it in a browser and there you go, rendered immediately and outputting your thoughts to the world. The book I used for this was by a lady named Elizabeth Castro called 'HTML 4 for the World Wide Web' which was published in 1999 by Peachpit Press. It has of course been updated for the modern age of W3C standards and is now called HTML, XHTML, and CSS by the same author. This is a fantastic book, moves a manageable pace and unlike then will help you learn HTML and CSS all in one go, rather than how I learnt the two technologies years ago when CSS was just a bit of an extra to be used in your HTML. Technically HTML isn't programming, you are writing Markup but it will get used to many things that as a programmer will be using later on in your career i.e. attributes, properties (in CSS) and referencing different parts of your code.

2. It's another Peachpit publication, this time from Larry Ullmang. PHP and MySQL is now in its third editon and is still going strong. I have had to buy this a couple of times (different editions) as I still use for it a little bit of reference. My first edition was worn out very quickly, constant flicking through the pages and index to find what I need took its toll and as a result my first copy is in numerous parts.

Larry is a great programmer and teacher (as I have mentioned in other posts) as he can teach without laying too much on the student. He also has another more advanced PHP book which will advance your knowledge over a number of key subjects, i.e. OOP in PHP and Ajax with PHP. I would recommend that you build a number of sites first before you tackle that book as it can be heavy going in places. The advanced book is definitely more of reference manual and can be dipped in and out of, rather than the PHP MySQL which I would recommend reading in its natural order.

3. Now that you have hopefully sites coming together. I would recommend taking a look at JavaScript. Javascript has had its ups and downs (mainly due to unscrupulous coders and hackers) but has since had a well deserved revival. I like Javascript, it adds an extra dimension to a web site and makes a site feel more like a desktop application than a website (even more so when Ajax is used). However it can be a quirky language, some of the naming and referencing conventions can be tricky, but once you get the hang of it, you will love it.

JavaScript as well as being a programming language for your browser, it also gives you access to the DOM (Document Object Model) and when you learn to manipulate it, can give you some really impressive looking results.

The reason I have added Javascript after PHP is that it looks rather similar to PHP in terms of the code and that with PHP you only have to worry about 2 or 3 real events. Page Load and then GET and POST. JavaScript has many more events and uses objects (HTML elements etc) to add to its functionality.

So the book I recommend for learning JavaScript is the JavaScript Bible (now in its 6th edition) by Danny Goodman et al. A brilliant book, set a good pace and has a massive reference section for you to look almost every property, method and attrbute in the language. It also teaches you about the DOM and how to create scripts that affect it, so is a very good all round.

There are more books that I have used but I will talk about them in my next post. These books will move in to more advanced areas including Object Oriented Programming, Ajax and a few other areas.

Labels: , , , , , , ,

Friday, July 10, 2009

Dreamweaver - an excellent way to start your web development career

My love/hate relationship with Macromedia/Adobe Dreamweaver

I have since moved on from Dreamweaver but for some jobs it is still a very useful tool. A lot of pro developers hate Dreamweaver and in many cases they have a point. However like many things in life, when people get an idea or an opinion it can be very hard to change. I feel like I am an open minded person that believes in using the right tool for the right job.

Dreamweaver is an excellent program created by a great time of programmers and designers. It has a fantastic interface and it makes site creation available to the masses. When I first started using DW I thought the program was amazing and I was very impressed with how well it created dynamic pages with such a minimum of effort. Also it gives a person a very good look at how server pages work along with some basic interaction with databases and really does ease them in to the whole server side world of the web. It has been created to use many different models including ASP[.net] with MS SQL Server or Access; PHP with MySQL on different servers including IIS and Apache and is therefore a very adaptable piece of software.

Dreamweaver also allowed you to use the WYSIWYG side that allowed you to combine the design and the server side parts all on one page. This was indispensible for a person who had some HTML experience but hardly any server coding experience.

OK, on to the bad points. For people who can code their own apps in a server side language this piece of software will no doubt infuriate them. It writes a lot of code (sometimes needlessley) and creates huge amounts of script to do some very simple operations. This is Dreamweaver's main issue for seasoned developers and like I said it is understandable, but if used sensibly Dreamweaver can still have its place in a developers arsenal.

It is also is quite inflexible with the way creates files in to its structure that it uses for database connections - but this is only a minor issue.

I mentioned on the blog front page that I hope to use this blog to help a business be more profitable. Dreamweaver fits in to this idea perfectly. As a developer, a significant amount of time can be used on the inital stages when design meets the site structure. You can create classes, functions and all manner of time saving techniques to try and make site development more streamlined but if you want to speed up this stage I still stick by Dreamweaver. One of Dreamweaver's finest tools is its ability to help you create CSS and how it can fit in to your site development. CSS in Dreamweaver will allow you to (when your elements are in place) to add an atribute and it will allow you to see immediately how it affects the site's layout rather than loading and refreshing in a browser. If you are creating a site that uses a non-standard layout, this is a fantastic way to do things and will no doubt help you at many stages in the design/structure. Of course you need a fairly good understanding of CSS, but once you have that - page layout becomes a whole lot easier.

Labels: , , , , ,

PHP - A New Start in my development

Using PHP to develop websites

So here I was, a brand new book (PHP 4/MySQL by Larry Ullman for Peachit Press) in front that promised me how to learn PHP and create dynamic websites. I had, of course already created dynamic website using classic ASP but I wanted to use PHP and use it well. Many of the concepts mentioned early on in the book just reiterated how to do things that were already common to most programming languages. The common if, else, echo and so on and so forth and these chapters were a breeze and I sailed through the first few chapters in a matter of hours.

However when I started to meet new ideas and concepts I was starting to slow down as the new information had to absorbed and understood for future use. Things like arrays and functions were, though not ultra complicated were new to me as I had learnt ASP in such a disjointed way that this new approach was very heavy going.

With functions in PHP there were new ideas and concepts that had to be understood - like variables within a functions, parameters and the idea of whether or not it is even worth writing the function in the first place! When it came to arrays and using them in PHP, this was such a refreshing change. I had used arrays in ASP but they were, I felt a little clunky, with PHP they feel flexible and you can manipulate them in so many ways (thanks to PHP's inbuilt functions).

I have to say Larry Ullman is an excellent teacher and his books are very, very good and without him I think learning PHP would have been a lot more difficult, so thanks go out to him. I have bought many of his books and it's a testament to his skill at writing technical text books that I keep buying updated versions as there are so many useful bits of information in them.

Labels: , , , ,

Thursday, July 9, 2009

On the road to becoming a PHP developer

My Learning Curve on the road to becoming a web developer living in Burnley, Lancashire...

When I came to web programming my background primarily lied in SEO, but thanks to the requests of my employer I found myself having to learn (Classic) ASP using VBScript as he needed a specific application to be built in-house. This was a bold step from my employer but he must have seen that I had the ability to learn this [archaic] language and allow me the time to start down the programming/scripting road. I felt I was up to the challenge as I had played with a couple of languages at University including C++, JavaScript and HTML and therefore proceeded on to the aforementioned project.

Fortunately, prior to this I had already become proficient in the use of the application Dreamweaver by Macromedia. When I started to create server side apps using Dreamweaver it became apparent that, whilst Dreamweaver was excellent at creating server scripts for beginners it was creating extremely bloated scripts. Now this is not, I repeat not, a slur on Macromedia/Adobe as I realised that the scripts had to be like this to make sure they worked on nearly all servers/machines as a newbie wouldn't have the know-how to fix and issues that cropped up.

In conjunction with the ASP VBScript server, I learnt MS Access - one of many the many choices you can use with DW. Again I had a little knowledge of SQL and of RDBMS (Relational Database Management Systems) from university when I used a very old language called clipper. As a result I found it to be no real problem using the comparatively ultra modern MS Access. After a few weeks of creating this in-house application I was creating session based pages, login scripts and many other components all based around common programming techniques i.e. if, else, then etc. etc. It was also at this point I noticed that ASP/VB used a small number of Objects/classes to build its server connections and saw the obvious benefits they offered - but more on Object Oriented Programming (OOP) later.

I decided to learn a new language and really try develop my skills as a developer. I also knew at this point that Classic ASP was never going to cut it as a language to take my forward in my career (especially as one of my friends was raving about .NET) and I had to make a decision on which language to use for my web development projects. I looked at the options and chose PHP (which was being championed by a colleague) which was standing at version 5. I looked at all the articles I could find and made my decision and decided to use PHP rather .NET. There were reasons for this and they are listed below:

1. It was open source and cheap to create a working server using Linux/Apache at home compared to IIS/Windows Server.
2. The language - Most of my prior knowledge had been in writing procedural code instead of using OOP and I thought PHP was a better choice as it gave me the choice to do both. PHP was at version 4.xx and did have a limited support for OOP and with PHP 5 (which had much better support for OOP) on the horizon it became the deciding factor.
3. The PHP manual - a complete and definitive source for every function in the PHP language with user contributed notes. From my ASP/VB script days I knew that whilst Microsoft did its best to maintain its support, pages were often moved and I found myself going round in cirlces.
4. I could step up to using OOP when I felt I was ready and not from the outset.
5. SEO was in grained in me and I knew that PHP was proven when it came to creating more Search Engine friendly pages.
6. MySQL was free and MS SQLServer was (back then) very, very expensive and cost way beyond what I was earning. -- Edit -- In fairness to MS you can now download free (albeit limited) versions of Visual Studio and the MS SQL server interface.

These are only a few of reasons I chose PHP over .NET, but over the rest of my posts you will see how I moved on and I hope that my posts can try and help you become more than you are at the moment. I will list books, resources and a few other snippets to try and make your career/hobby that little bit better :-)

For people who are a little more interested in how PHP and how OOP and developing re-usable sites/models can contribute towards a more profitable business there will be plenty here for you too. After all, a large majority of websites are used to create profits and the more you can squeeze out of them the better.

Labels: , , , ,