Archive

Archive for the 'PHP'

A salute to Virgil Search Team

Well now passed since my last day of advice I can say from the Matrix, without having to come to hear me say thank you, great, etc.. the past three years in the group's search of Virgil were very beautiful. We often talk of Italian companies as entities that ape the New Economy American, who are ready to copy everything but they can not create anything.

I invite you to look at how it changed the interface of the search engine Virgilio last year. All of this is the work of the good guys, that even with their faults, have virtues and a passion for their tasks that I have found very few people along the boot.

I'd like to make their names, but privacy prevents me, I would also not my fault that one day their emails were studded with absurd or useless questions.

I tell you that if you talk to discover that they are normal people, not if they pull it and are always available to lend a hand in technology to whoever asks.

Some of them have blogs, but it is not mine to reveal the url, others because they have not been so busy that they can not create it, others are too busy refining the previous blogs on SEO techniques.

Well hello to all the Search, and even the Super Chief, that despite the degree that covers a person is always available and does not mind moments of hilarity with his subjects.

Bye bye

PHP Refactoring - Lez. 4: Extraction of code and elimination of temporary variables

Often we find in the methods of a class of code that can be reused in various parts of the same, or we see that put in that position does not give any intuitive meaning.

An improvement in the readability of the object is to extract this group of rows with a common meaning and place in a method that is invoked whenever the need is present.

Another problem is the presence of temporary variables, which do nothing but increase the risk of bugs and can be replaced by self-documenting code, in the form of a private method of the class.

The following is an example to better clarify the concept:

Continue reading ...

PHP Refactoring - Lez. 3: Methods of a class

2 commenti November 12, 2008 Nicholas 2 comments

As regards the methods of a class, also applies in this case the naming convention outlined above for the properties of the class itself. We repeat them below for convenience:

  • If consists of a single word, all lowercase, for example, currency ();
  • If made ​​of many words the first letter of each, from the second, in uppercase, all lowercase other, for example addElement ();
  • The method name must be self-explanatory.

Continue reading ...