I know a couple of Java programmers that will find this helpful. Thanks.
What Java really needs is a KitcheSink class. I'm pretty sure there's already one in PHP.
Addition of 1 and 1 in PHP
21–30 of 89 posts
Re: Addition of 1 and 1 in PHP
#22Yes this is a good joke until you realize there is no other way to get some level of type safety in PHP other than adding a bunch of unnecessary classes.
Re: Addition of 1 and 1 in PHP
#23Re: Addition of 1 and 1 in PHP
#24This is so funny. The author's description is great on github, really fooling you at times. Even if this isn't intended as a joke, the dedication to doing something fun to prove a point got me thinking about over engineering design patterns too.
Relevant: http://me.veekun.com/blog/2013/03/03/the-controller-pattern-... (by the same dude who wrote "PHP: A Fractal of Bad Design", no less)
Re: Addition of 1 and 1 in PHP
#25Yes this is a good joke until you realize there is no other way to get some level of type safety in PHP other than adding a bunch of unnecessary classes.
Re: Addition of 1 and 1 in PHP
#26What about subtraction now?
Re: Addition of 1 and 1 in PHP
#27Also, in what version could we expect ability to handle 2 digit (or more!) numbers?
Re: Addition of 1 and 1 in PHP
#28Re: Addition of 1 and 1 in PHP
#29Reminds me of something I wrote a few months ago on how to detect negative numbers: http://stackoverflow.com/a/11910993/1329367 but obviously the one above has much more value add and follows better design patterns.
Re: Addition of 1 and 1 in PHP
#30What if I need to add 2 and 1? Is there a lib for that? Or would this one need to be completely refactored? Also, in what version could we expect ability to handle 2 digit (or more!) numbers?