|
Posted by Steve on 11/01/06 19:44
"Martin Mouritzen" <martin@siteloom.dk> wrote in message
news:kashk2hb0ki4hu1g6t2g7fb4m3o0e7vddm@4ax.com...
| On Wed, 1 Nov 2006 12:48:46 -0600, "Steve" <no.one@example.com> wrote:
|
| >always make sure your html output is sent to the browser in a completely
| >well formatted manner. such as indenting parent html nodes and further
| >indenting child nodes.
| >
| >making sure that html output does not require one to wrap text when
viewing
| >source from a page.
|
| I can see what you mean, but that sounds like an odd guideline to me,
| the browser don't care, and the user probably won't care either. :-)
i don't care about either of them caring. ;^) i care that when i have a
problem i can't debug, i can look at the output via source and spot it from
there.
| >(these two will save you ooodles of time trying to debug output...it is
easy
| >to do and makes you look professional in the process).
|
| I find it a big help in debugging output to have a \n after each line
| in the HTML, but I still think it's somewhat overkill to indent the
| PHP printed HTML with \t.
i don't indent with a tab...just two spaces. however, if you have php code
mingled with php code, having the space indentions helps you know where
you're at even still. but that could just be me.
| >as for php, my goal is to have php parse as little as possible. this
| >includes using ' instead of " when i am not embedding php variables or
| >control characters in a string. ex. echo 'hello world', "hello world\n".
as
| >a general rule though, you want to keep your php code seperate from your
| >html *as much as possible* and only mingle the two when necessary. btw,
have
| >you heard of "short-tags"? rather than the long, drawn-out method of:
|
| Noteable goal, however it only saves you about a millisecond, I find
| it a lot more readable to use ", which is what (most) other
| programming languages use for strings (but perhaps I'm biased because
| I often write in different languages).
php is a peripheral language for me as well. as i am not actually reading a
' or a ", i don't find it more or less difficult to read what each encases.
;^) to each her own though.
Navigation:
[Reply to this message]
|