News for hackers. Stuff that matters.
Re:Signs of Crappy PHP Software by DjDarkman on Sunday July 04, 2010 @12:17PM (#1485871)
It's a few lines of code, I would not call that complex. And the usage is.

GlobslSingleton::set('Something Meaningful',$unique_var);

and

GlobslSingleton::get('Something Meaningful');

I don't think this is complex at all.

This doesn't force you to use $unique_var as a variable name(I know it can be worked around). One of the biggest problem with globals is that they can crash and burn if someone else's code purges it by accident.

Also my pattern allows 'load on demand', I can incorporate it in if I'd want to, your does not.

Re:Signs of Crappy PHP Software by lox on Monday July 05, 2010 @07:35AM (#1487974)
Might I suggest something like Config::get('look_ahead') rather than GlobalSingleton? The design pattern used to implement something is generally far less useful than the purpose of the thing in terms of a name.
Re:Signs of Crappy PHP Software by DjDarkman on Wednesday July 07, 2010 @03:56AM (#1493668)
Of course.