News for hackers. Stuff that matters.
Re:Signs of Crappy PHP Software by _Lemon_ on Sunday July 04, 2010 @10:50AM (#1485758)
$db is something different altogether, in my code I have a cheap Database class and each model creates a new one -- but it relies on the MySQL functions it uses to re-use the database connection. So in reality it's the same thing.

The problem with not using a constant where it's necessary is that you're communicating the wrong thing to someone else or even yourself 6 months down the line. You might want to re-evaluate what you see as "ugly code" especially if it changes how you write the code.

There are no comments on this comment yet.