Skip to content

Day: September 2, 2017

You are the worst programmer in the world

You, yes you, are the worst programmer or web developer in the world. Without a shadow of a doubt. In someone’s opinion. The thing about programming or building anything is that it’s almost entirely subjective. Of course there are certain things which are categorically bad like lazy developing, obvious bugs, security vulnerabilities and terrible performance (both server side and client side). The point of this article, really, is to ask the question: Why are we, as a community, so judgemental? There are plenty of controversial topics, when you get into web development. Factory patterns vs dependency injection vs just using classes/objects.…

2 Comments

Quick and Easy PHP Singleton

Hi guys A really short one today, just because someone asked me about it a couple of days ago. I also though it potentially best to avoid something as controversial as my last post about Eloquent and the Single Responsibility Principle, which caused a bit of a stir during the week. So, you want to make sure you only ever use one specific instance of a class (maybe a DB connection) and need a quick and easy way to do it. Personally, this is the technique I would use: <?php class MySingleton{ // This will hold the instance of the…

4 Comments