• You are not logged in. | Login

Post a reply

December 28, 2006 1:30 pm

admin
Administrator
Administrator

Discuss article: "21 errors of a PHP-programmer. Part I."

You can discuss that article here

Discussed article: "21 errors of a PHP-programmer. Part I."


 

 

March 30, 2007 12:45 pm

mambojim
Member
Ranks

Re: Discuss article: "21 errors of a PHP-programmer. Part I."

Comment of an editor concerning inconvenience of FastTemplates would be very desirable (this is my and not only my subjective opinion). Instead of them I would recommend you Smarty.


 

 

April 2, 2007 7:21 am

Stre@m
Member
Ranks

Re: Discuss article: "21 errors of a PHP-programmer. Part I."

As to the comments, I have more sympathy with the point of view that in most cases comments are sign of the fact that code should be refactored.
As for me, in this example with optimal (from the author’s point of view) number of comments some of them are obviously needless:

// For the correct functioning of this algorithm
//quantity of massive elements must be equal to
// the quantity of elements in relative probabilities massive
This should be replaced with a set of assertions in the checkout version of a program, ASSERT etc.

// Notice: we don’t use $idx because
// we don’t need access to the single elements
// of the massive weights
This comment is relatively useless (although in this concrete case this is a rather doubtful question)… An experienced programmer won’t need it to realize how this all works. An inexperienced one will have to examine code anyway.


 

 

April 2, 2007 7:53 am

Conker
Member
Ranks

Re: Discuss article: "21 errors of a PHP-programmer. Part I."

As to the templates… Often they make information output more difficult. Templates are rather suitable for the so called form pages where some fields should be replaced with text. If we try, for example, to enter table data divided into some columns, we are going to have troubles with templates at once. Templates limit flexibility of the information output. It seems to me to be better to divide each page into two PHP-files one of which contains HTML with output insertions only and another one – the whole page’s logic.


 

 
  • Actions
  • Top
ITCrimea. Ukraine Web Development Company. Professional Developers and Web Designers Team
Custom Web Designs, Internet Applications, E-Commerce Websites, Interactive Sites, Database-Driven Sites and Services