Saturday, December 29, 2007

Some major design themes from around the web

I'm new to the field of web development, and I've been learning a lot by reading articles and blogs by those who seem to be leaders in the field. What I've found is that there are correct ways and incorrect ways to apply the technology that's available. Here's what I've learned so far.

It is imperative to separate content and style. This refers to HTML (the content) and CSS (the style). In the early days of the internet, content was simple, consisting entirely of text. When graphics-based browsers came out (Netscape (RIP) with the first major browser in 1993), there had to be a way to tell the browser how to display the text, hence HTML (hypertext markup language) was used to "mark up" the text for the browser, telling it how to display different elements. As things got more advanced, this ran into serious problems, so CSS (cascading style sheets) came along. The idea now is that HTML marks up the content (but doesn't tell the browser how to handle that content), and CSS defines how the marked-up content looks.

Use AJAX to streamline the user experience. AJAX stands for Asynchronous JavaScript And XML. It's a method of allowing a web page to request information from a server and insert that information into the web page without requiring a full refresh. This allows a user to click on objects, open sub-trees, and otherwise call information without reloading a page. This makes a web page more like an installed computer application, and less like a traditional web page.

Use a PHP framework to separate models, views, and controls. This is just like separating content and style, but on a deeper level. The model refers to the structure of the code, the view refers to how the page renders, and the controls refer to the actual commands that are within the code. Separating these three elements into distinct layers (and into their own documents in their own folders) allows an application to grow while maintaining a clean code base. However, it's a complicated process, and is best suited for very large web sites. I guess I need to make a detailed plan of each page of my own site before I can decide whether or not to use this method. If I do use, there are many frameworks to choose from (in addition to coding my own, which is way beyond me right now): Symfony, CakePHP, and Zend. Symfony appears to have the most complete documentation as now (including a published book), CakePHP I successfully installed, and Zend is probably great too. All the message boards I perused seem to agree that no one framework is better than any other. Use to taste.

Speaking of frameworks, what about Ruby on Rails? RoR uses the Ruby programming language, extant since 1993 but only exploding in popularity today. As far as I know, the language is entirely object oriented, which PHP is not. PHP5 supports object oriented programming, but doesn't force it on you. Those who use Ruby (the language) and Ruby on Rails (the framework) tend to proselytize like Mac users. They say it's the greatest programming language in the world, but unfortunately it's untested (at least compared to PHP). RoR espouses the MVC framework, just like CakePHP and other PHP frameworks, so I'll stick with PHP instead of learning another programming language. Ruby and RoR seem to be great, and I look forward to using them someday. Just not for this project.

No comments: