Re: Re: TURBOPY cloud framework + IDE beta available NOW

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Oct 30, 2012 at 7:33 AM, marco@xxxxxxxxxx <marco@xxxxxxxxxx> wrote:

>
> In times of testability and several design patters, the use of static
> calls is
> really outdated.
> I understand that you can read and write the invocations of the methods
> much
> faster, but you should think more to the future on that point.


What?

Where is it written that the use of static calls is really outdated?
Functional programming is on the rise, and this is largely because of the
virtues of testability, scalability, and simplified patterns. Using a class
to organize a set of static functions can benefit the code in PHP (allow
for autoloading in PHP because functions can't be autoloaded, essentially
serves as a child namespace, etc.) whilst maintaining the benefits of a
more functional approach (unit testing purely written static functions is
much easier, putting all IO tasks in separate components makes for cleaner
modules, etc.)

I try to emulate functional approaches in PHP, such as what you'd find in
Scala, Clojure, or Haskell, and static calls in PHP can facilitate this
approach.

While OOP is one way to approach programming, it's not the only way. Even
Rasmus has said he leans procedurally:
http://toys.lerdorf.com/archives/38-The-no-framework-PHP-MVC-framework.html

Adam

-- 
Nephtali:  A simple, flexible, fast, and security-focused PHP framework
http://nephtaliproject.com

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux