> However, my biggest area of expertise is with PHP based web development, typically with MySQL DBMS systems, and I'm passionate about the Codeigniter framework and jQuery library for JavaScript.
@BenjaminGruenbaum if thats a "technical lead in IBM" then I am second coming of Jesus and reincarnation of Krishna all rolled up in one sex combination
> my biggest area of expertise is with PHP based web development, typically with MySQL DBMS systems, and I'm passionate about the Codeigniter framework and jQuery library for JavaScript.
@bwoebi Does PHP have the same ability to do initialization and actual construction like Python? What I mean by this is that Python has __new__ and __init__ where you usually implement __init__ but you can also do __new__ which gives you control over actual creation and not just initialization.
Building an object by calling a static method, while not optimal is not as horrible as most static things. However if you've already extracted creation logic into a factory because you have logic there - why make it static? It's less testable.
@BenjaminGruenbaum Yeah I agree. I do not like when I see a library that people say is good for a certain task and then it is full of static methods. It makes me lose a bit of faith in the person who made the library
@David static methods are not really that horrible in small to medium code bases if they don't have considerable side effects - static properties on the other hand...
I would be using that spyc library now if it was not for the static methods putting me off. I will probably just have to use it because I sure as hell am not going to create a YAML parser
@BenjaminGruenbaum Would you put class constants as static properties?
And you can't declare functions to be abstract in a real class.
e.g.
class AbstactClass {
abstract function getInfo();
}
class RealClass {
function getInfo() {
return 'stuff';
}
}
@IvoPereira To force you to implement functions for the derived class.
It's basically a way of setting up a contract that the derived class has to fulfill, while still allowing all the classes that extend the abstract class to share some functions.
er - and obviously "class AbstactClass" should be "abstract class AbstractClass"
/* trying to call us1.php.net/manual/en/generator.throw.php */
$ php -r 'call_user_func(["Generator","throw"]);'
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'Generator' not found in Command line code on line 1
@MadaraUchiha I was expecting some warning: Strict Standards: Non-static method Generator::throw() should not be called statically, assuming $this from incompatible context in Command line code on line 1
@NikiC I have also tried Php 5.5 new Password Hashing but that's a bit CPU load increasing if there are symontaneous 1000 users sign in as shared server hosting. lolwut.