Jean is an Internet and Multimedia specialist with a keen interest in music, technology, business, sports and psychology.
Jean Galea
Internet Consultant in Malta
Jean Galea: entrepreneur and internet specialist. Holding an M.Sc. in Multimedia & Internet Computing from Loughborough University, Jean specialises in web design and development, email marketing systems and general internet consultancy.
XHTML Right Now launched
XHTML Right Now is a specialised service of conversion from Designs to XHTML and CSS code. The site provides an easy explanation of the conversion process as well as forms enabling customers to upload their designs and obtain a quick quote on their work.
The style used on this website is quite informal and aims to make the user feel comfortable in exploring the information regarding this technical conversion process.
Naming Conventions I Use and Recommend
With so many different coding styles in use by developers nowadays, I would like to suggest some ideal naming conventions that I have found useful and practical myself.
In HTML and CSS, Camel Case notation eg. myTestclass can be far less than ideal as it might be difficult to spot errors, consider for example the difference between myTestclass and myTestClass which is not so easy to identify but will result in your styles not being applied, and possibly hours of frustration. I prefer using lower case for all elements, with dashes to separate multiple words, e.g. my-test-class. I think it’s far more readable and faster to type than having to introduce capitalised letters.
For simplicity and consistency, I use lowercase characters for all CSS code including elements, classes, and IDs. As for whitespace in CSS I use the following format:
body {
font-size: 20px;
line-height: 150%;
}
If needed CSS code can be minified to increase performance, however while developing I like to use the style above as I find it the easiest for me to read.
Form elements should be named for what they are, not how they work. If you decided to change a radio button to a check box in the future, you will see why having originally named it something like radio-answer turns out not to be such a great idea after all.
PHP Conventions I Use
Take a look at the Zend and PEAR standards and naming conventions:
PHP Naming Guidlines - Zend Framework 1.9+
Classes – PascalCase (UpperCamelCase)
Special Considerations: Class names must match the name of the directory on the file system that contains the class file. Names are to be AlphaNumeric only with the exception of an ‘_’ which is only to be used to show separation in the path. If you have a class file named Car.php in the path ‘/Models/Car.php’ then the class name would have to be Models_Car.
Interfaces – PascalCase (UpperCamelCase)
Special Considerations: See Classes.
Functions and Methods – camelCase
Special Considerations: AlphaNumeric only with exception of ‘_’ as described here. Names must describe behavior of function or method. Methods that are declared with private or protected visibility modifier must start with an _.
Variables – camelCase
Special Considerations: Names should describe the data in the variable. Variables declared with private or protected visibility modifiers must start with an _.
Constants – ALL_CAPS
Special Considerations: AlphaNumeric and ‘_’ are allowed however ‘_’ must be used to separate words in constants.
Code example:
define("CURRENT_YEAR", date('Y'));
interface Transport
{
public function getDescription();
}
class Models_Car implements Transport
{
private $_make = 'Ford';
private $_model = 'Mustang';
private $_year = 1967;
private function _findAge()
{
return CURRENT_YEAR - $this->_year;
}
public function getDescription()
{
$desc = $this->_year . ", " .
$this->_make . " " .
$this->_model . " is " .
$this->_findAge() . " years old.";
return $desc;
}
}
$car = new Models_Car();
echo $car->getDescription();
Apart from the above conventions by Zend, it is also acceptable to use the following naming structure for functions:
function my_function($args) {
}
Notes:
Pascal Case -> ThisIsPascalCase (Also Called Upper Camel Case)
Camel Case -> thisIsCamelCase (Also Called Lower Camel Case)
Virtual Business Cards (vCard)
We have recently launched our vCard creation service, enabling you to have your very own personalised vCard and domain for only 40 Euro.
What is a vCard?
vCard is a file format standard for electronic business cards. vCards are often attached to e-mail messages, but can be exchanged in other ways, such as on the World Wide Web. They can contain name and address information, phone numbers, URLs, logos, photographs, and even audio clips.
It cane be thought of as a normal business card with the added bonuses of it being dynamic, instantly downloadable and very easy to share without any cost. You can update it from time to time with new information and images, making it much more versatile than your traditional business card.
The example above shows a vCard I have created for myself. As an alternative to this blog, it serves as a quick bite-sized introduction to myself and the services I offer. It also includes contact details and links to my various social profiles. Such vCards are also useful for small businesses such as hair stylists, or professionals like interior designers. They can also be used to attractively showcase examples of your work through photos that enlarge nicely when clicked upon.
Want a vCard or mini-site?
Contact me now and I’ll show you how I can help you promote your services through the use of a vCard or mini-site for yourself or your business.
Using CSS to Generate Footnote Links for Printing
When generating stylesheets for print purposes one problem is that by default a user would not be able to see links included in the content. However we can use a script to detect all links present in the content and then present footnotes with the linked pages so users printing your page will still have the possibility to see where you are linking to from your content.
This article is probably the best tutorial / script to help you achieve this effect.
How to Create Snippets with Adobe Dreamweaver CS4
This video tutorial shows you how to make use of Dreamweaver CS4’s Snippet capability. I will be showing you how to create a Doctype snippet.
Thanks for reading, please leave comments if you have any additional ideas...



