Re: [PHP] How to write code: how wrong am I?

2011-02-25 Thread tedd
At 11:04 AM -0700 2/22/11, Alexis wrote: On 22/02/11 09:40, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 16:15, Robert Cummings wrote: If you switch to vertically aligned braces you will have an easier time matching up open and close braces... if (something) { // Code here } It's trivial t

Re: [PHP] How to write code: how wrong am I?

2011-02-25 Thread tedd
At 9:13 AM -0500 2/22/11, Robert Cummings wrote: On 11-02-22 08:58 AM, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 14:11, Jay Blanchard wrote: It is an interesting concept Dotan, what is the goal? Who is the page targeted to? The goal is to have every open and close bracket matched, and not h

Re: [PHP] How to write code: how wrong am I?

2011-02-23 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 19:03, Paul M Foster wrote: > Not a bad idea for HTML, not so great for PHP. Some of what you're > trying to solve/avoid can be handled by a decent editor, one that does > syntax highlighting and/or does brace and parenthesis checking. It > doesn't require an expensive IDE.

Re: [PHP] How to write code: how wrong am I?

2011-02-23 Thread Tamara Temple
On Feb 22, 2011, at 5:29 AM, Dotan Cohen wrote: I wrote a short page on how to actually type of code that one writes, it can be found here: http://dotancohen.com/howto/write_code.html The point that I stress on the page is that first you close an element, then you fill it's contents. The page

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread la...@garfieldtech.com
On 2/22/11 12:04 PM, Alexis wrote: On 22/02/11 09:40, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 16:15, Robert Cummings wrote: If you switch to vertically aligned braces you will have an easier time matching up open and close braces... if (something) { // Code here } It's trivial to match us

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Alexis
On 22/02/11 09:40, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 16:15, Robert Cummings wrote: If you switch to vertically aligned braces you will have an easier time matching up open and close braces... if (something) { // Code here } It's trivial to match using this style since you only

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Paul M Foster
On Tue, Feb 22, 2011 at 01:29:30PM +0200, Dotan Cohen wrote: > I wrote a short page on how to actually type of code that one writes, > it can be found here: > http://dotancohen.com/howto/write_code.html > > The point that I stress on the page is that first you close an > element, then you fill it

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 16:15, Robert Cummings wrote: > If you switch to vertically aligned braces you will have an easier time > matching up open and close braces... > > if (something) > { >    // Code here > } > > It's trivial to match using this style since you only need to scan one axis. > Th

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 09:06 AM, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 14:58, Robert Cummings wrote: I'm more likely to do this stuff for HTML than PHP. However, I do sometimes lay out the structure of some conditionals/functions before fleshing them out so that I can do some early testing... but I

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 08:58 AM, Dotan Cohen wrote: On Tue, Feb 22, 2011 at 14:11, Jay Blanchard wrote: It is an interesting concept Dotan, what is the goal? Who is the page targeted to? The goal is to have every open and close bracket matched, and not have to worry about what is still open. This is

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 15:00, Andy McKenzie wrote: > I'll be the first to tell you that I'm not a great programmer, so my > take may not be worth a lot.  However, this is pretty close to how I > write.  Not exactly, but close.  I also always label open and closing > brackets on everything, unless

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:58, Robert Cummings wrote: > I'm more likely to do this stuff for HTML than PHP. However, I do sometimes > lay out the structure of some conditionals/functions before fleshing them > out so that I can do some early testing... but I always fill the conditional > as I'm do

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:15, Marc Guay wrote: > It's an interesting idea (a different take on coding best practices) > but I find the PHP example to be laborious and time consuming with > little benefit.  If I'm typing an IF statement, I hope to god I know > what the condition is before I start

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Dotan Cohen
On Tue, Feb 22, 2011 at 14:11, Jay Blanchard wrote: > It is an interesting concept Dotan, what is the goal? Who is the page > targeted to? > The goal is to have every open and close bracket matched, and not have to worry about what is still open. The page was specifically written for a friend wh

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Andy McKenzie
On Tue, Feb 22, 2011 at 6:29 AM, Dotan Cohen wrote: > I wrote a short page on how to actually type of code that one writes, > it can be found here: > http://dotancohen.com/howto/write_code.html > > The point that I stress on the page is that first you close an > element, then you fill it's content

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Robert Cummings
On 11-02-22 06:29 AM, Dotan Cohen wrote: I wrote a short page on how to actually type of code that one writes, it can be found here: http://dotancohen.com/howto/write_code.html The point that I stress on the page is that first you close an element, then you fill it's contents. The page has examp

Re: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Marc Guay
It's an interesting idea (a different take on coding best practices) but I find the PHP example to be laborious and time consuming with little benefit. If I'm typing an IF statement, I hope to god I know what the condition is before I start typing it. Creating the if/else structure first and then

RE: [PHP] How to write code: how wrong am I?

2011-02-22 Thread Jay Blanchard
[snip] The point that I stress on the page is that first you close an element, then you fill it's contents. The page has examples in HTML and PHP. I would like to know what the experienced programmers here think about this. Am I going about it wrong? [/snip] It is an interesting concept Dotan, wha