Monthly Archives: October 2011

“Bad” programming style

if($totalrowsModel == 0 && $formType == 2)
{
// Procedure 1
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt && $product!=”” && $spec !=”” && $PSID == $randomURL)
{
// Procedure 2
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt)
{
// Procedure 3
}
else
{
// Procedure 4
}

This is a typical bad programming style that does not converge to a
location. It is called “spaghetti program”. I need to exclude some
access to database but it seems like I must put the condition at
multiple locations.

if($totalrowsModel == 0 && $formType == 2)
{
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt)
{
if($product!=”” && $spec !=”” && $PSID == $randomURL)
{
// Procedure 2
}
else
{
// Procedure 3
}
}
else
{
// Procedure 4
}

At least, the conditionals must be formatted this way.


60% Reduction in file size

The long lines of codes before the contents will show poorer performance in terms of CEO points of view. This is due to the design of the pages created by the previous user and it will take much effort to remove it. Let alone commented out copied codes here and there, will hinder the robots from registering the site to appropriate keywords.

I hate to look at these copied and commented out codes. It is not even clear which css file is doing what. Duplicate file imports should be removed, of course. Empty anchor tags must be removed. This mixture of css and js codes — beyond my tolerance level. Tags in upper and lowercase is style problem, but there are no rules in file naming. What could “styles.css” mean? The common css for every file? All of these mean that I must look for every components to figure out which css file is defining which components. The file name has to correspond to its size if it has it in in it.

In all, his code only shows the lack of the notion of

– the notion of scope
– structured coding
– class notion that has introduced to PHP

This is reduandant.
if($formType==1)
{
include(‘includes/functions/email/email.php’);
}
else
{
include(‘includes/functions/email/email.php’);
//include(‘includes/functions/email/emailSpec.php’);
}
likewise.

There is no footer.

Now I achieved 60% reduction in file size.


Melodrama-loving bored Jackie and her manga characters

— I just said I do not think it is appropriate to wrap VFD modules in chocolate bar. That is all.

— The sales records — should be judged not by the years he’s in this company, I believe, since it is not easy to evaluate the performance by the look of it. Understanding the customers’ needs etc. The sales reps seem to understand better.

No, I do not need your apologies. Your plot, is just base, vulgar, and foolish, that is all.

There is no RS232C connection, either.