Object Overloading in PHP5

August 7th, 2007 : Austin Smith

One of my biggest complaints about PHP5 is that you can’t do genuine object overloading, you can only fake it using the __call() method and its brethren. The crappy part about __call() is that if you want to do anything complex, you end up reinventing the wheel in a big if, elseif… else block, or maybe a switch statement. It’s not well suited for real overloading, Java style. We’re better off just using func_get_args() at the top of a method and choosing different paths based on what we find in the function arguments. But that too can get overwhelming. I thought of a solution which I find interesting. I’m not saying it’s right, or even a good idea, but it comes as close to real overloading as anything, is quick enough to use, and demands strict variable typing. Read the rest of this entry »

Tags:

What Language Should I Learn Next?

June 11th, 2007 : Austin Smith

Every year, I learn two new languages and write (or at least design) one; I’ve done this for four years now and I keep up my skills in each language. I usually take about a month per language. I always learn one in January and one in June (well, June 21 to the end of July actually) January, I learn a language I don’t want to know but feel like I should. My birthday is in June, so I feel like it’s a good point to reward myself with a “candy” language. Help me pick a new language to learn! Read the rest of this entry »

Tags: