My colleague writes code on PHP, and uses as a constant ... attention - static methods -
i.e. instead of:
const my_const = 0;
he writes:
public static function my_const() { return 0 };
my former colleagues, front-end developers, doing in javascript, because there no constants, in php? in opinion, if language have constants, should use them.
i want send him link question, arguments.
writing method return same value senseless. of course better pratice use constans. when @ perfomace it's faster when declare know won't change constant.
i agree hakre don't argue idiots bring level , beat experience.
i read somewhere in php constans not fast. should read article.
http://planetozh.com/blog/2006/06/php-variables-vs-constants/
Comments
Post a Comment