#Object Oriented Programming Sucks
1 messages ยท Page 1 of 1 (latest)
alr
An explanation of why you should favor procedural programming over Object-Oriented Programming (OOP).
I watched that the other day
You know oo has a set of core principles
im gonna dislike that video with all my family accounts!!!
๐
Abstraction
Inheritance
Polymorphism
Encapsulation
might be one more that I forgot about
all of these principles are about abstracting away detail
which yes, it does simplify the complicated process of fiddling something into a working state
but as soon as you introduce multi threading and concurrency object orientation becomes utterly raw excruciating pain
one side of OO yells at you that you should abstract away details right?
yea
on the contrary side, its crucially important for you to expose details of object's state and the design of your system when it enters concurrency and multithreading
if not, there's an immensely huge chance you will encounter concurrency update problems due to no thread safety
and such
and to be fair
any real program running Java takes advantage of multi threading
so ye
both sucks and is awesome
yeah makes sense
@deft linden rate my code
I'm not one to rate, but sure
- where the readme ๐
its not a public project
whats the point of Registry
its just for fun
also
consider to favor BiConsumer<? super String, ? super T> to BiConsumer<String,T>
Registry pattern
uhhh
well
6/10
your registry is just a map
yeah - ngl in this case it shouldn't be used. its just a glorified hashmap
which people appear to hate but i personally dont
not a glorified hashmap
LOL
just a map in principle
its used as one
and abstraction
anyhow lets move on
its for one thing - redis
I assume using Optional is justifiable at least
not for multiple storage types
you don't have to have the whole project abstracted for it to be good
Could have an interface for the Redis class to decouple it from possible dependents and to make it mockable
anyhow
sysdm its not bad at all
im just looking at it from an enterprise oo pov
yes from my limited knowledge its cool
but
COMMENTNAJSDFNJABWEFJBAJWEBF
where da comment
comments are bad
no
its never sth great
comments are there to assist us when we FAIL to express ourselves in code
and if you write clean code
if someone knows java and has knowledge they should be able to see what it does
^^^^
you most likely wont need any comments
yes
BUT
additionally, they rot because no fcking one maintains them
you IDE even colors them in background-dont-look-at-me colors
its a private project
lmaoo
Lmao
but yes 2hex, nothing can be as helpful as a great comment, on the contrary nothing can be as miserably bemusing as a bad comment
and btw if comments decided how clean your code is, then it would be really easy to write clean and good code
// does stuff
yeah they dont make it clean
it makes it simpler
more stupid
well
for stupid people
most of times you will find ways to express yourself in code
using the name of functions, and variables and annotations etc
most of times you will ways for people to not understand what you wanted to express yourself in code
forgor
how so
btw @west parcel
rate
ok i got chu
as conclure said though
Idk, most of the time I consider my classes extendable since if I were to test them and so on
public sealed interface TriceratopsStages permits TriceratopsStages.Nothing {
final class Nothing implements TriceratopsStages {
private Nothing() {}
}
im lazy to fix it
fairs
one example where I used final tho
ew j17
basically you have to declare all the sub classes at compile time
so nothing else than TriceratopsStages.Nothing can implement TriceratopsStages
ye
supposedly you could write code safer
but in principle the feature is far from fundamentally needed
best for you!
ig the segregation is down to your mindset since i find it fine