News for hackers. Stuff that matters.
Re:PHP: A fractal of bad design by TylerE on Tuesday April 10, 2012 @12:23PM (#3822937)
In PHP, if you forget the check, and have error reporting turned off (which you should), you'd never KNOW you forgot the check, because missing it is only a logic error, whereas an exception blowing up a python script will be caught by the runtime.
Re:PHP: A fractal of bad design by maratd on Tuesday April 10, 2012 @12:49PM (#3823090)
> have error reporting turned off (which you should)

No, you should not. You should never have error reporting turned off. You should certainly have it set to not display errors to the client, but all errors should be sent to a log, preferably syslog, and they should be reviewed. Your code shouldn't generate any errors.

Re:PHP: A fractal of bad design by TylerE on Tuesday April 10, 2012 @01:26PM (#3823326)
I'm just calling it what php.ini calls it.

The settings related to displayed errors in the page are error_reporting and display_errors. The error logging is a totally sperate group of keys starting with log_

Re:PHP: A fractal of bad design by maratd on Tuesday April 10, 2012 @02:06PM (#3823519)
Yes, I know. Like I said, error_reporting on (set to E_STRICT) and display_errors off. And yes, where the error goes is a completely different question.
Re:PHP: A fractal of bad design by taytus on Tuesday April 10, 2012 @01:20PM (#3823300)
"You should never have error reporting turned of"

Sorry bro, if you have ever put code on production with error reporting on...you are doing it wrong.

Re:PHP: A fractal of bad design by corford on Tuesday April 10, 2012 @03:23PM (#3823922)
Are you insane?

In production, you should have error_reporting set to something like: E_ALL & ~E_DEPRECATED

And then:

display_errors = Off display_startup_errors = Off track_errors = Off html_errors = Off ignore_repeated_errors = Off ignore_repeated_source = Off log_errors = On error_log = /path/to/log/file (or syslog)

Re:PHP: A fractal of bad design by karolist on Tuesday April 10, 2012 @02:48PM (#3823757)
He specifically mentioned you should have errors logged instead, not displayed to the client. You're quoting only the part that leads to your insult.
Re:PHP: A fractal of bad design by maratd on Tuesday April 10, 2012 @02:04PM (#3823510)
I have and since I write the code, I expect zero errors. And that's what I get. When there are errors, that code needs to be fixed. Tell me more, bro.
Re:PHP: A fractal of bad design by angersock on Tuesday April 10, 2012 @01:15PM (#3823256)
"You should never have error reporting turned off."

Ha. Ha ha. Ha ha ha.

Tell me more about maintenance programming and legacy production systems.