Tagged Questions
3
votes
4answers
392 views
Reusable VS clean code - where's the balance?
Let's say I have a data model for a blog posts and have two use-cases of that model - getting all blogposts and getting only blogposts which were written by specific author.
There are basically two ...
6
votes
3answers
647 views
What is the difference (if any) between (null != $object) and ($object != null) when using PHP?
I am used to Java and therefore always think conditions are interpreted from left to right, i.e. there is a vital difference in null != $obj and $obj != null
Now this seems not to be the case with ...
3
votes
3answers
362 views
Is there a limit on how many global consts are used before an application is considered bad programming?
Basically, I develop websites, some large with many crud operations, etc...
However I've gotten into the habit of storing re-usable data as a constant in my PHP applications
I currently have 44 ...
1
vote
1answer
137 views
Condition based function declarations
I recently came across a weird piece of code
if(foo == bar){
function foo_bar(){
// Function definition
}
}
Is this a good practice of coding ?
6
votes
2answers
338 views
Are there any good use-cases for variable variables?
Today I encountered this little PHP gem called variable variables.
$literal = "Hello";
$vv = "literal";
echo $$vv; // => prints "Hello"
Are there actually any real use-cases for this language ...
3
votes
5answers
506 views
How to convince my boss to switch to OOP PHP? [closed]
We have been trying for months to convince my boss to switch to OOP php, but each time, he takes out his previous experience with programming and convinces us other wise.
i need to talk like a boss ...
1
vote
3answers
372 views
Formatting PHP, what works more efficiently?
I was just wondering what makes PHP work faster. I have a few methods that I always go and do, but that only improves the way I can read it, but how about the interpreter?
Should I include the curly ...