|
Posted by Jerry Stuckle on 12/17/91 11:55
Mladen Gogala wrote:
> On Sun, 13 Aug 2006 15:45:51 -0400, Jerry Stuckle wrote:
>
>
>>Sooner
>>or later it will come back to bite you.
>
>
> Nope. Sooner or later they'll fix PHP to start doing output buffering by
> default.
PHP isn't broken. It shouldn't have output buffering by default - no
other language does, for instance. And doing so would break other
applications which depend on immediate output.
And BTW - it doesn't even have to be PHP which causes the output to be
sent. A space or new line character before the first "<?php" is enough
to do it. And PHP isn't even involved.
> I've had pages working without a hitch on Linux or Solaris and
> reporting "headers already sent" on Windows 2000.
I rest my case. If they were coded properly you wouldn't have that problem.
> Making every programmer
> aware of intricacies of a convoluted and unnecessarily restrictive
> protocol is not a solution.
A good programmer's job includes an understanding of the environment
under which he's working.
> Things must be doable through normal
> programming, without counting bytes.
Yep. Zero bytes output, no headers sent. 1 byte output, headers sent.
> Your "solution" is like dieting by
> maniacally counting calories - it seldomly works and usually creates more
> problems then it solves.
Nope. It solves ALL the problems. And it doesn't artificially hide the
problems cause by poor coding practices.
> Calling header() is not an unusual request, it's
> like calling a subroutine to jump to another page.
Agreed.
> I couldn't care less if
> headers are already sent. I just want another page, period.
If you were a real programmer, you WOULD care about whether the headers
have been sent or not.
> I'm a DBA, programming is not my primary business.
That explains a lot. Might I suggest you stick with DBA work and let
programmers do the programming?
> I need to get things
> done, lots of them and quickly. Things must work, but nobody will come
> back complaining to me because of few KB of address space more consumed by
> the httpd processes.
Fine. I get things done quickly, also. And they work - correctly.
> I use PHP because Perl CGI module is very complex
> and the very nature of Perl executing things like `ls /tmp` before the
> variable substitution is made.
And Perl has the same "problem" as you call it, as PHP. Any output, and
headers have been sent.
> I'm still using Perl for the CLI stuff, but
> PHP is my primary web interface. In other words, I started using PHP
> because Perl was too complex and it took me too long to develop and
> bulletproof my scripts.
OK, PHP is easier. But that doesn't mean sloppy programming is good.
> Following headers religiously and studying trifle
> details like that would defeat the purpose. The purpose, may I remind you,
> is to develop web applications quickly and not to practice programming
> religion.
Not at all a programming religion. It's an understanding of the
environment under which you're working, and the actions and limitations
of that environment.
> Programming religion is, just as is the case with any other
> religion, a guidance and a moral compass when consumed in small doses, but
> can also be debilitating, if followed fanatically and to the letter.
>
And so can stupid and asinine programming practices.
I hope you don't have such a cavalier attitude towards your DBA work as
you do programming. If so, I pity your employer.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
[Back to original message]
|