Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

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

Posts: 6,442
Name: James
Location: In the ocean.
Trades: 0
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
 
 
Register now for full access!
Old 12-29-2007, 08:21 AM Re: Why ;?
dansgalaxy's Avatar
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
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.
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
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
Ultra Talker

Posts: 322
Trades: 0
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
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
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

Please login or register to view this content. Registration is FREE
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,442
Name: James
Location: In the ocean.
Trades: 0
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
Defies a Status

Posts: 6,521
Name: Dan
Location: Swindon
Trades: 0
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!
__________________
Discounted Web Hosting With XDnet!
>> Get 25% of hosting~ Promo: Webmaster-talk <<

Please login or register to view this content. Registration is FREE
dansgalaxy is offline
Reply With Quote
View Public Profile Visit dansgalaxy's homepage!
 
Reply     « Reply to Why ;?

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB 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.99913 seconds with 11 queries