Can a loosely typed language be considered true object oriented?
Can a loosely typed programming language like PHP be really considered object oriented?
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
Would this be considered dependency injection? [closed]
Closed 12 years ago.
Object Oriented Programming: getters/setters or logical names
I’m currently thinking about an interface to a class I’m writing. This class contains styles for a character, for example whether the character is bold, italic, underlined, etc. I’ve been debating with myself for two days whether I should use getters/setters or logical names for the methods which change the values to these styles. While I tend to prefer logical names, it does mean writing code that is not as efficient and not as logical. Let me give you an example.
Is there an “ask for only what you need” interface principle?
I have grown into using a principle for designing and consuming interfaces that says basically, “ask for only what you need.”
is ‘protected’ ever reasonable outside of virtual methods and destructors?
so, suppose you have some fields and methods marked protected (non-virtual). presumably, you did this because you didn’t mark them public because you don’t want some nincompoop to accidentally call them in the wrong order or pass in invalid parameters, or you don’t want people to rely on behaviour that you’re going to change later.
Should an image be able to resize itself in OOP?
I’m writing an app that will have an Image
entity, and I’m already having trouble deciding whose responsibility each task should be.
Name for this antipattern? Fields as local variables [closed]
Closed 10 years ago.
Functional programming readability [closed]
Closed 7 years ago.
Is functional programming a superset of object oriented?
The more functional programming I do, the more I feel like it adds an extra layer of abstraction that seems like how an onion’s layer is- all encompassing of the previous layers.