View Single Post
Old 05-11-2011, 10:20 AM   PM User | #4
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,517
Thanks: 45
Thanked 440 Times in 429 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Hi guys

Yeah I generally see the following two styles as being the same thing:
PHP Code:
function test_b()
    {

    }

function 
testb()
{


I know it is technically different but the braces are still on their own lines so i see it as the same thing. I've always found it easier to understand though if they're indented from the function / class delcaration. I've never liked style A as its just too hard to understand, debug and most of all deal with $end errors. I have no idea what anyone likes about that style and why so many people use it. I can work with it, but i always end up copying the code from one notepad++ tab to another, formatting it my way, working on it, formatting it back and then pasting it back in.

Hopefully the screen shots in this thread will enlighten others
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is online now   Reply With Quote