Chris
We had a chat about this over at sydney.ug.php.net and position : divided; :D The one you mention is discussed among others at http://www.kafejo.com/komp/1tbs.htm. I prefer the BSD style as you get:
if()
{
...
}//end if
else
{
... }//end else
And the braces are all lined up which makes for great readability of where conditionals end. I also comment conditional ends.
CSS is different as you are only applying rules rather than conditionals and nested conditionals. As long as you are consistent and document what is done then there should be no problem when handing over or sharing a project codebase.
Doing this
#obj { position : absolute; color : cyan; border : 1px dotted yellow;}
#nav { color : green; }
#ihaterealitytv { color : black; background-color : white; }or this
#obj
{
position : absolute;
color : cyan;
border : 1px dotted yellow;
}
#nav { color : green;
}
#ihaterealitytv
{
color : black;
background-color : white;
}
is more prefarable to this:
#obj
{
position : absolute;
color : cyan;
border : 1px dotted yellow;
}
#nav { color : green; }
#ihaterealitytv {
color : black;
background-color : white;
}If you are working in a team, deciding on the bracing method for these types of languages is probably the first thing to be worked out amongst coders.
Cheers James
Chris Stratford wrote:
Hey Everyone,*****************************************************
This is a great debate in Perl, C++, PHP... Its all the same with CSS too!
I *HATE *It When People code with the curly brackets like this:
/div.row span.left { float: left; text-align: left; font-weight: bold; color: #fff; width: 49%; } /
I prefer to code like this:
/div.row span.left { float: left; text-align: left; font-weight: bold; color: #fff; width: 49%; }
/What is your preference????
See I hate when things dnt Line up... I love having nicely formatted code.
Sorry - I hope this standard doesnt make this off topic. I would just like to know what you like, and dont like. It will be interesting to see what your opinions are!
-- Chris Stratford [EMAIL PROTECTED] Http://www.neester.com
***************************************************** The discussion list for http://webstandardsgroup.org/ *****************************************************
The discussion list for http://webstandardsgroup.org/
*****************************************************
