Reply
Old 12-29-2007, 01:49 AM Re: Why ;?
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
Jeremy, you seem to use the same coding standards I do. The only difference is I prefer 4 spaces for indentation. I have found that it is easier for me to read that way.
joder is offline
Reply With Quote
View Public Profile
 
Old 12-29-2007, 08:21 AM Re: Why ;?
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,166
Name: Dan
Location: Swindon
Well said Jeremy.

im a fan of using curly braces on their own lines i find it much more readable.
and personally i think the amount of lines is trivial.

I think in most cases i think that if you can write minimal code but still make it neat and readable is always preferd.

some of the code i have seen where i look and go wait a minute why have you got something like this:
PHP Code:
if(con1)
{
if(
con2)
{
echo 
'con1 and con2 are true';
}

when just having
PHP Code:
if(con1 === TRUE && con2 === TRUE)
{
echo 
'con1 and con2 are true';

etc...anywya simple things like that bug me especially when i think almost all the time its been on scripts which the coder has sold often for a bit of money.

im currently recoding a mccodes script which frankly is awful in places, mate paid 12£ for it and i refused to pay anything because i knew i would have to do so much work to it and i was right!

anyway going a bit of track here.

bottom line i think that while there are tons of materials online to teach you php i dont remember any decent ones to telll you the best and most readable ways and shall we say the grammer of coding. which is as important sometimes as the functionability.
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Old 12-29-2007, 04:19 PM Re: Why ;?
Truly's Avatar
Extreme Talker

Posts: 214
Cool responses. Im not complaining, I dont mind adding ";" Im just overly curious about trivial things .
Truly is offline
Reply With Quote
View Public Profile
 
Old 12-29-2007, 06:30 PM Re: Why ;?
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 984
Name: Jeremy Miller
Location: Reno, NV
Quote:
Originally Posted by dansgalaxy View Post
... and personally i think the amount of lines is trivial.
Completely agree.

Quote:
Originally Posted by dansgalaxy View Post
... some of the code i have seen where i look and go wait a minute why have you got something like this:
PHP Code:
if(con1)
{
if(
con2)
{
echo 
'con1 and con2 are true';
}

when just having
PHP Code:
if(con1 === TRUE && con2 === TRUE)
{
echo 
'con1 and con2 are true';

Yep. The first code segment bothers me too.
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 12-29-2007, 10:14 PM Re: Why ;?
joder's Avatar
Flipotron

Posts: 6,443
Name: James
Location: In the ocean.
Quote:
Originally Posted by dansgalaxy View Post
bottom line i think that while there are tons of materials online to teach you php i dont remember any decent ones to telll you the best and most readable ways and shall we say the grammer of coding. which is as important sometimes as the functionability.
Here is one that is used by many php developers
http://pear.php.net/manual/en/standards.php

One used by the Zend PHP Framwork
http://framework.zend.com/manual/en/...-standard.html
joder is offline
Reply With Quote
View Public Profile
 
Old 12-30-2007, 08:06 AM Re: Why ;?
dansgalaxy's Avatar
Eat, Sleep, Code

Posts: 6,166
Name: Dan
Location: Swindon
Can i just say something:

okay someone on here who is learning PHP was talking to me and on his code he has some funny bits which were completely pointless and when asked its because he thought it was right because the colours on his editor went differant.

hehe

colours are a guide not a law people!
__________________
Personal UK Webhosting
Get 25% of ANY shared package for life ~ Promo: webmaster-talk (only for members!)
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Why ;?

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14053 seconds with 11 queries