Skip to main content
Share Your Experience: Take the 2024 Developer Survey
24 votes

How far can you push Object Oriented Programming?

I think the principle that all getters somehow violate oop principles at some fundamental level is wrong. If I have a string class and I want to know how long the string is by calling getLength does ...
chubbsondubs's user avatar
17 votes

How far can you push Object Oriented Programming?

This is not a getter Just because a method has get in its name doesn't mean it's a getter; nor does renaming a getter to eg say fetchName stops it from being a getter. In fact, the getItem method is ...
falsedot's user avatar
  • 295
10 votes
Accepted

How far can you push Object Oriented Programming?

However, some boundaries, like library boundaries, make it impossible to move the method and so you move data. I agree. Sometimes you do not (or can not) know the behavior that will be attached to ...
Robert Bräutigam's user avatar
10 votes

How far can you push Object Oriented Programming?

I'll take a stab at it but I'll just touch on the hash table question. Firstly, the person that replied to you, is an advocate of Object oriented domain driven development (coined by him) and ...
Ced's user avatar
  • 589
6 votes

Is it good practice for object APIs to be required to be called in sequence to gather information?

Your coworker is right. Constructors should give you a fully initialized and usable object. I also understand why you don't want parsing to happen in the constructor, because it can throw an exception....
Greg Burghardt's user avatar
5 votes

How far can you push Object Oriented Programming?

You can't infer OOP from a line of code This question is a bit of a semantic puzzle in what it's asking. But that not every line of a program can be purely object oriented. Yeah, because object ...
Flater's user avatar
  • 51.7k
2 votes

How far can you push Object Oriented Programming?

Does this count as a "pure" HashTable? Note that any data container, like an array or hash table, can expose a ForEach method that takes a function pointer as argument and call that function ...
Ccm's user avatar
  • 1,589
2 votes

How far can you push Object Oriented Programming?

I almost responded with an answer similar to this on the other question and decided not to. I've been tempted twice, I'll bite. What are we even arguing about here? Why do we do Object Oriented ...
Jared Smith's user avatar
  • 1,925
1 vote

How far can you push Object Oriented Programming?

The actual question you are asking is: "How far can you push the "Tell, don't ask"-principle." The answer is, you should push it as long as it improves encapsulation, but you can ...
JacquesB's user avatar
  • 59.7k
1 vote

How far can you push Object Oriented Programming?

My view is that OOP primarily exists to permit decentralised designership of software. That is, it's intended to facilitate the ability of separate teams to design and maintain software components, ...
Steve's user avatar
  • 8,959
1 vote

Should an object know its own ID?

Because I like real world analogies: It would be decidedly more efficient if people kept their passports (or other identifying documents) on their person, instead of them being stored in some separate ...
Flater's user avatar
  • 51.7k

Only top scored, non community-wiki answers of a minimum length are eligible