Live data from Hacker News

Fifty Shades of OOP

lesleylai.info

111–119 of 119 posts

Re: Fifty Shades of OOP

#111
post #106
post #96

Earlier quoted context omitted.

I don't think anyone sets out to make an anemic domain model, it just happens. Lots of developers start with POJO's for JPA models and then never advance them into being full fledged objects when the requirements develop.

Surely that's a conscious design decision? Deciding to create data-carrying POJOs with JPA annotations is a valid strategy. Mixing in a bunch of logic and non-JPA state with them is a recipe for disaster. If you want your classes to Do Stuff, you have to design them to Do Stuff. I dislike the term "anemic domain model", it casts a value judgment which I think is unwarranted. There's a spectrum from anemic to obese (f…

I genuinely believe its not a conscious design decision. Most people never properly learn how to turn things into objects. I've seen this happen in many projects across many companies. They simply just write procedural code without centralizing their logic anywhere.

Re: Fifty Shades of OOP

#112
post #110
post #108

Earlier quoted context omitted.

"You don't end up with a tidy hierarchy this way, but I'm not sure you'd end up with a tidy hierarchy using inheritance, either." Well, I am sure, that all the graphic libaries I ever used, had this inheritance model. (The graphics libary I build, as well.) The libaries I have seen, that used a different model, I did not really like and they were also rather exotic, than in wide use. But I am willing to take a look a…

None of the graphics libraries you've ever used were built with mixins, decorators, or multiple inheritance? I confess I never went too deep with GUI toolkit programming, but Swing, for instance, definitely uses decorators (e.g. JLayer). Neither Go nor Rust have inheritance, so any graphic library implemented in those languages will be inheritance-free; ditto anything in a functional language, for the most part. In g…

I mean if you writing joe slop tax softare you can use whatever mixin decorator singleton factory performance be damned, slop doesn't need performance, in fact, is frowned upon in slop developers as too showy and flashy, puts people off.

Now if you're say writing a high performance game, rendering engine, then maybe you want to squeeze out another 10 frames per second (FPS) but not committing resources to the overhead of that mixin decorator singleton factory facade messenger design pattern and just have some concrete tight C or assembly loop at the beating heart of it all

Re: Fifty Shades of OOP

#113
post #65

Earlier quoted context omitted.

The problem with that definition is that modern languages like Rust, Go, and Javascript fall between the cracks here with de-emphasizing things like classes and inheritance while still providing things like generics, interfaces, encapsulation, etc. For example, Javascript was influenced by a few languages, one of which was a language called Self which is a Smalltalk like language where instead of instantiating classe…

Well, C++ also has higher-order functions and lambda expressions, and yet we don't call it a functional programming language.

Are you sure?

Search for "Functional Programming in C++: How to improve your C++ programs using functional techniques".

Re: Fifty Shades of OOP

#114
post #113
post #65

Earlier quoted context omitted.

Well, C++ also has higher-order functions and lambda expressions, and yet we don't call it a functional programming language.

Are you sure? Search for "Functional Programming in C++: How to improve your C++ programs using functional techniques".

Yes. It's by standard a "general purpose" programming language, not a "functional" language, and it definitely corresponds with the IEEE definition for OOP (in contrast to the mentioned Rust or Go languages). I thought I would give a clear example that the fellow would immediately understand. However, I seem to have underestimated the postmodernist tendencies of today's world.

Re: Fifty Shades of OOP

#115
post #114
post #113

Earlier quoted context omitted.

Are you sure? Search for "Functional Programming in C++: How to improve your C++ programs using functional techniques".

Yes. It's by standard a "general purpose" programming language, not a "functional" language, and it definitely corresponds with the IEEE definition for OOP (in contrast to the mentioned Rust or Go languages). I thought I would give a clear example that the fellow would immediately understand. However, I seem to have underestimated the postmodernist tendencies of today's world.

If it's a general purpose language and not a functional language just because it has function features, then why would it be an 'OOP' language just because it has 'OOP' features?

Re: Fifty Shades of OOP

#116
post #114

Earlier quoted context omitted.

Yes. It's by standard a "general purpose" programming language, not a "functional" language, and it definitely corresponds with the IEEE definition for OOP (in contrast to the mentioned Rust or Go languages). I thought I would give a clear example that the fellow would immediately understand. However, I seem to have underestimated the postmodernist tendencies of today's world.

If it's a general purpose language and not a functional language just because it has function features, then why would it be an 'OOP' language just because it has 'OOP' features?

Correct. (did I say something else?)

Re: Fifty Shades of OOP

#117
post #48
post #17

Earlier quoted context omitted.

Inheritance is just the unnecessary coupling of composition and polymorphism.

Delegation is a very useful part of composition. Almost all OOP languages have two techniques to delegate some methods to another object: - manually write a bunch of forwarding methods and remember to keep them updated, or - inheritance.

...yes? Hence me saying that 'composition' and 'polymorphism' have often been unnecessarily coupled together in 'inheritance'?

Compare: Ruby mixins or Go embedded struct fields.

Re: Fifty Shades of OOP

#118
post #50

Earlier quoted context omitted.

Python was a mistake if you ask me ¯\_(ツ)_/¯

Python is the worst programming language except for all of the others.

I don’t know man. It’s honestly the last thing I would choose. There is literally always something else that is more appetizing.

Re: Fifty Shades of OOP

#119
post #25

Earlier quoted context omitted.

HN doesn't allow image replies, but if you were to image search "smug meme" you would find any of them to be an appropriate response to this useless post of yours, and imagine I put it here for your convenience

Hilarious that you're literally trying to outsmug me, and failing. THe irony. It burns. lol

*The
Post reply on HN