RE: [PHP] Better standards in PHP-coding

2002-04-22 Thread Maxim Maletsky \(PHPBeginner.com\)

Also very true.



Sincerely,

Maxim Maletsky
Founder, Chief Developer

www.PHPBeginner.com   // where PHP Begins




-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: Monday, April 22, 2002 6:50 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Better standards in PHP-coding


On Monday 22 April 2002 08:07, Maxim Maletsky wrote:
> I think standardization within the company is what important.
>
> I prefer tabs because when I have to delete a part of the line, I just

> hit back button once - not four times.

I prefer an editor which allows me to tab using spaces and to delete the

appropriate number of spaces when backspacing :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Logic is the chastity belt of the mind!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread Jason Wong

On Monday 22 April 2002 08:07, Maxim Maletsky wrote:
> I think standardization within the company is what important.
>
> I prefer tabs because when I have to delete a part of the line, I just
> hit back button once - not four times.

I prefer an editor which allows me to tab using spaces and to delete the 
appropriate number of spaces when backspacing :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Logic is the chastity belt of the mind!
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Better standards in PHP-coding

2002-04-21 Thread Maxim Maletsky


I think standardization within the company is what important.

I prefer tabs because when I have to delete a part of the line, I just
hit back button once - not four times.

But anyhow, programming style is the personal preference for every
programmer. There recommendations and team-wise standards, but that has
nothing to do with the general idea.


Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com




> -Original Message-
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 1:57 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Better standards in PHP-coding
> 
> (Just got back from the weekend)
> 
> Just my 2c worth
> 
> IMHO, as long as the code is indented "properly", it doesn't matter
where
> the braces are, just be consistant. Personally, I prefer to put the
opening
> brace on a new line, but I can just as easily read other people's code
when
> the opening brace is on the same line (as long as it's indented
properly).
> 
> As for indenting - I prefer using spaces and this ensures that my code
will
> look the same in someone else's editor as it does in mine. There are
people
> here, in the company, that use tabs and have set their tabs to be 4
spaces,
> I have my tabs set to 8 spaces - really plays havoc when they indent
quite a
> distant :(
> 
> Also, with one line statements, I prefer to place it on the same line
as the
> statement that requires it (ie, function, if/else, while, do, etc).
But,
> again, as long as the coder is constant, I find it just as readable
when the
> statement is on a new line, surrounded by braces or not.
> 
> So what I'm basically saying is - choose a style that suits you, and
be
> _consistant_ with it - oh, and make sure you indent your code, there's
> nothing worse than trying to read code that's not indented, or
indented all
> over the place!
> 
> Martin
> 
> 
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 21, 2002 9:10 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Better standards in PHP-coding
> 
> 
> Hi
> I like the following form, not sure how much time gets wasted in
parsing
> but it's easy > for me < to follow :)
> 
> while(something):
>  if(something else):
>  yada;
>  else:
>  forget it;
>  endif;
> endwhile;
> 
> Tom
> 
> 
> At 11:51 AM 21/04/2002, Frank wrote:
> 
> >"The nice thing about standards is that there are so many to choose
> between".
> >
> >Subject: Uses of block markers in coding
> snip
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Better standards in PHP-coding

2002-04-21 Thread .ben

> From: Martin Towell [mailto:[EMAIL PROTECTED]]



> So what I'm basically saying is - choose a style that suits you, and be
> _consistant_ with it - oh, and make sure you indent your code, there's
> nothing worse than trying to read code that's not indented, or 
> indented all
> over the place!
> 
> Martin

hear, hear!

 .b

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Better standards in PHP-coding

2002-04-21 Thread Martin Towell

(Just got back from the weekend)

Just my 2c worth

IMHO, as long as the code is indented "properly", it doesn't matter where
the braces are, just be consistant. Personally, I prefer to put the opening
brace on a new line, but I can just as easily read other people's code when
the opening brace is on the same line (as long as it's indented properly).

As for indenting - I prefer using spaces and this ensures that my code will
look the same in someone else's editor as it does in mine. There are people
here, in the company, that use tabs and have set their tabs to be 4 spaces,
I have my tabs set to 8 spaces - really plays havoc when they indent quite a
distant :(

Also, with one line statements, I prefer to place it on the same line as the
statement that requires it (ie, function, if/else, while, do, etc). But,
again, as long as the coder is constant, I find it just as readable when the
statement is on a new line, surrounded by braces or not.

So what I'm basically saying is - choose a style that suits you, and be
_consistant_ with it - oh, and make sure you indent your code, there's
nothing worse than trying to read code that's not indented, or indented all
over the place!

Martin


-Original Message-
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 21, 2002 9:10 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Better standards in PHP-coding


Hi
I like the following form, not sure how much time gets wasted in parsing 
but it's easy > for me < to follow :)

while(something):
 if(something else):
 yada;
 else:
 forget it;
 endif;
endwhile;

Tom


At 11:51 AM 21/04/2002, Frank wrote:

>"The nice thing about standards is that there are so many to choose
between".
>
>Subject: Uses of block markers in coding
snip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Better standards in PHP-coding

2002-04-21 Thread .ben

I prefer the following:

function doThing()
{
strFoo = 'bar';
}

nice and tidy.

at the end of the day, as long as code is commented, consistant in layout
style, and works... that's enough.  aint it?

 .b

> -Original Message-
> From: Frank [mailto:[EMAIL PROTECTED]]
> Sent: 21 April 2002 02:52
> To: [EMAIL PROTECTED]
> Subject: [PHP] Better standards in PHP-coding
>
>
>
> "The nice thing about standards is that there are so many to
> choose between".
>
> Subject: Uses of block markers in coding
>
> GNU recommends a standard with block-markers aligned under each
> other and a
> number of people - including myself - find it senseless and
> counter-progressive to keep up an older standard resting from old
> days and
> doing the programmer a disfavor.
>
> Too many programmers continue to use a style that originates back to the
> days where dumb terminals with one-line memory and line-editors
> was common.
>
> Those days it could take long time to submit a line to the mainframe. I
> have tried it myself and in worst-case situations it could take
> up to half
> a minute to submit a line.
>
> So naturally we put more things into one line. Statements like
>
> if (tempratureM1>=tempratureSTP) {cout << "Warning! Cooling needed";
> log(tempratureM1, "Warning);};
>
> all in one line.
>
> When editors became a little faster people started to write:
>
> if (tempratureM1>=tempratureSTP)  {
>cout << "Warning! Cooling needed"; log(tempratureM1, "Warning); }
>
> which is nicer to look at but would take many seconds more as one
> more line
> has to be submitted.
>
> - - -
>
> Nowadays few people have any problems with waiting for a CR.
>
> But for mysterious reasons a rest from the old forced "standard" remains
> among people who use C(++) like languages.
>
> It is still standard to write
>
> if (some_expression) {
>statements;
>...
> }
>
> What the "{" - the marking of the beginning of a block that should be
> indented - is doing in the end of the line nobody has yet been able to
> explain me.
>
> Why, then, are functions not written as
>
> function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
>   statements
>   ...
> }
>
> ?
>
> In other block-structured languages you of course align
> block-markers under
> each other, allowing for easy scan.
>
> if expression
> begin
>statement;
>...
>...
> end;
>
> I have yet to see anybody write
>
> if expression begin
>statement;
>...
>...
> end;
>
> - - -
>
> Does it matter? Oh, yes it does. A lot. As teacher I know from experience
> that programmers has a harder time tracking their own block with a number
> of "{"s dancing far out of sight in the right side of the screen. This is
> not a matter of experience. No experience can ever make it
> equally fast to
> control structures based on vertically aligned block-markers contra those
> where the marker can be found anywhere on a line.
>
> As an amusing result of the weird practice it has been necessary to
> recommend a standard where the { }-pair is always used, even though there
> is only one statement following an if:
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) {
>oneStatement;
> }
>
> instead of simply
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>oneStatement;
>
>
> Why the need for the extra "{ }"s?
>
> Of course because the the difference between
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>oneStatement;
>
> (correct) and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
>oneStatement;
>
> (wrong) is easily overlooked because of the block marker put away
> to the right!
>
>
> But nobody overlooks the difference betweeen
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>oneStatement;
>
> and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>{
>oneStatement;
>
>
> where the missing "}" shines in the eyes.
>
> - - -
>
> We can only hope that some major standard-setters for PHP should make a
> rational decision about what standard to choose and not just keep
> "what we
> are used to" for the disadvantage of future generations of programmers.
>
> http://www.gnu.org/prep/standards.htm
> http://cs.nmhu.edu/personal/curtis/cs1htmlfiles/essentialssec6.htm
>
>
> Best regards
>
> SFM
> U5com Co Ltd.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread Tom Rogers

Hi
I like the following form, not sure how much time gets wasted in parsing 
but it's easy > for me < to follow :)

while(something):
 if(something else):
 yada;
 else:
 forget it;
 endif;
endwhile;

Tom


At 11:51 AM 21/04/2002, Frank wrote:

>"The nice thing about standards is that there are so many to choose between".
>
>Subject: Uses of block markers in coding
snip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread The_RadiX

Yes thank you Jason..


I could have.. But I was busy..

And _usually_ my posts here are somewhat ignored so I thought better than to
spend _too_ much time on it..


Thanks anyway..


:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 21, 2002 5:53 PM
Subject: Re: [PHP] Better standards in PHP-coding


> On Sunday 21 April 2002 11:26, The_RadiX wrote:
>
> >  Hard in email to show as the character spacing is not equal like good
text
> >  editors..
>
> Set your mail client to use a fixed width font -- Lucida Console is my
> preferred font.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Q: Do you know what the death rate around here is?
> A: One per person.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-21 Thread Jason Wong

On Sunday 21 April 2002 11:26, The_RadiX wrote:

>  Hard in email to show as the character spacing is not equal like good text
>  editors..

Set your mail client to use a fixed width font -- Lucida Console is my 
preferred font.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Q:  Do you know what the death rate around here is?
A:  One per person.
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-20 Thread PHP freak


Change "terrible" to "readable" and I agree completely!

A carriage return and tab is the same size as two space-bar spaces, but is MUCH easier 
to read.

It's when you're going through someone ELSE's code that you start to appreciate things 
being all clearly spaced out with all nested things in their own indent.




> that whole wasting of lines:
> 
> if(exp)
> {
>   yabba
> }
> else
> {
>   yadda
> }
> 
> is terrible..

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Better standards in PHP-coding

2002-04-20 Thread michael kimsal

Mark Charette wrote:
> Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
> memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
> in this business and still I hear them argue.
> 
> Perhaps a cb style program for PHP so people can write any blasted style
> they feel like and then have another programmer transform it into _their_
> OTB style.
> 
> _My_ "coding standards" may not be _your_ coding standards, but mechanical
> transformations can pretty much make it all moot.
>

Cool - thanks.  I seem to have posted twice on accident, but you
summed up much better what I tried to say, but quicker!  :)
This guy got on my few remaining nerves this evening.  :)



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Better standards in PHP-coding

2002-04-20 Thread Mark Charette

Hehehe. And I thought the OTBSW (One True Brace Style Wars) had passed into
memory back some 10 or 15 years ago! Lo! They resurface yet again! 30 years
in this business and still I hear them argue.

Perhaps a cb style program for PHP so people can write any blasted style
they feel like and then have another programmer transform it into _their_
OTB style.

_My_ "coding standards" may not be _your_ coding standards, but mechanical
transformations can pretty much make it all moot.

Mark C.

> -Original Message-
> From: Frank [mailto:[EMAIL PROTECTED]]
>
> "The nice thing about standards is that there are so many to
> choose between".
>
> Subject: Uses of block markers in coding
>
> GNU recommends a standard with block-markers aligned under each
> other and a
> number of people - including myself - find it senseless and
> counter-progressive to keep up an older standard resting from old
> days and
> doing the programmer a disfavor.
> >



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php