Pear.PHP Standards Validation<

liunx

Guest
<!-- m --><a class="postlink" href="http://pear.php.net/manual/en/standards.php">http://pear.php.net/manual/en/standards.php</a><!-- m -->

Does anyone know of a validator that checks for standards defined in the link above? Either a program or client-side like W3's validator.

If not, do you think it will be an impossible task for my friend, who can program in C++, to make a validator program? I would imagine that he would simply program it to take in code, check for certain patterns of strings based on a "database" of functions in PHP, and alert upon findings of certain incorrect patterns. Anyone here with experience in this? This is all speculation, so if it's a ridiculous idea, please tell me now.it would be a waste of time I would think. sure people try to follow pears standard but everybody has their own way of doing it.

personally I can't stand the way it handles the {} on things.


if ()
{

}

// I do not like it that way.

if () {

}

//that is half the standard as it has the space after the "if" but it doesn't follow the {} standard.


if you did write something than I wouldn't be bothered with it. people write code how they want to read it. some like to do it all on one line, some don't. and I don't believe you will get them to change.im with you scoutt! i hate
if
{
}

it just pisses me off for some reason!!
i always use
if {
}yeah, I think it is hard to read for some reason.

also when they have an "else" in it.


if ()
{

}
else
}

{


seems that the "else" is sitting all by itself. looks stupid and confusing.Well boys, not trying to make you go nuts (not really :D ), but I love my if/else 's like this:


if ()
{
// blabla
}

else
{
//blabla
}

This way I can see which "{" belongs to which "}" at the glimpse of an eye.i like this

if (...) {
//sdf
} else if (...) {
//sdfsdf
} else {
//sdfsdf
}

i think thats the easiest was to read and scan.Well, let's just say it's a matter of taste :D .

As long as you put lots of comments in your code, I'll read it ;)

Do you guys do


while($foo < $blah) {
// do stuff
}

or

while($foo < $blah)
{
// do stuff
}


I guess the first, right?first one is right. wel fro me anyway. but coments are not part of the standard so it doesn't matter if you do it or not. comments are for you to remember why you did what you did :)I didn't even read that deep into the validation standards. I actually follow the...

if () {
blah
}

And if I have to change the way I do that, forget the PEAR standards. Thanks for the advice.
 
Back
Top