#Object Oriented Programming Sucks

1 messages ยท Page 1 of 1 (latest)

stark shuttle
deft linden
#

alr

stark shuttle
#

@deft linden

#

so basically

west parcel
#

I watched that the other day

stark shuttle
#

You know oo has a set of core principles

deft linden
#

im gonna dislike that video with all my family accounts!!!

stark shuttle
#

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?

deft linden
#

yea

stark shuttle
#

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

deft linden
#

yeah makes sense

west parcel
#

@deft linden rate my code

deft linden
#

I'm not one to rate, but sure

west parcel
#

everything else is as

#

and old

#

๐Ÿ’€

#

It's a simple PubSub implementation

deft linden
#
  1. where the readme ๐Ÿ’€
west parcel
deft linden
#
  1. commit naming
#

oh ok

stark shuttle
#

whats the point of Registry

west parcel
#

its just for fun

stark shuttle
#

also

#

consider to favor BiConsumer<? super String, ? super T> to BiConsumer<String,T>

west parcel
deft linden
#

uhhh

stark shuttle
#

well

deft linden
#

6/10

stark shuttle
#

your registry is just a map

deft linden
#

not that much abstraction

#

and what conclure said

#

and

#

no comments

#

and

#

lombok

west parcel
deft linden
#

which people appear to hate but i personally dont

west parcel
#

its kinda ass ngl

stark shuttle
#

not a glorified hashmap

west parcel
#

LOL

stark shuttle
#

just a map in principle

deft linden
#

comments tho

#

that removed a whole 1.5

west parcel
deft linden
#

and abstraction

stark shuttle
#

anyhow lets move on

west parcel
stark shuttle
#

I assume using Optional is justifiable at least

west parcel
#

you don't have to have the whole project abstracted for it to be good

stark shuttle
#

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

deft linden
#

yes from my limited knowledge its cool

#

but

#

COMMENTNAJSDFNJABWEFJBAJWEBF

#

where da comment

stark shuttle
#

comments are bad

deft linden
#

no

stark shuttle
#

its never sth great

deft linden
#

what

#

i dont see them useless

stark shuttle
#

comments are there to assist us when we FAIL to express ourselves in code

#

and if you write clean code

west parcel
#

if someone knows java and has knowledge they should be able to see what it does

west parcel
stark shuttle
#

you most likely wont need any comments

stark shuttle
#

additionally, they rot because no fcking one maintains them

deft linden
#

sort of adds in with KISS

#

makes it simpler to understand

#

for idiots

stark shuttle
#

you IDE even colors them in background-dont-look-at-me colors

west parcel
#

its a private project

deft linden
#

Lmao

stark shuttle
#

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

deft linden
#

yeah

#

also why is the d in Id lowercase

#

im suffering

stark shuttle
#

and btw if comments decided how clean your code is, then it would be really easy to write clean and good code

feral parrot
#

// does stuff

deft linden
#

it makes it simpler

#

more stupid

stark shuttle
#

well

deft linden
#

for stupid people

stark shuttle
#

most of times you will find ways to express yourself in code

#

using the name of functions, and variables and annotations etc

deft linden
#

most of times you will ways for people to not understand what you wanted to express yourself in code

stark shuttle
#

I do

#

but very rarely

deft linden
#

forgor

west parcel
deft linden
#

btw @west parcel

#

rate

west parcel
#

ok i got chu

deft linden
#

as conclure said though

stark shuttle
#

Idk, most of the time I consider my classes extendable since if I were to test them and so on

deft linden
#

comments are hard to maintain

#

even in small projects like thi

stark shuttle
#
public sealed interface TriceratopsStages permits TriceratopsStages.Nothing {
    final class Nothing implements TriceratopsStages {
        private Nothing() {}
    }
deft linden
#

im lazy to fix it

stark shuttle
#

one example where I used final tho

stark shuttle
#

?

#

stop

#

no

#

u did not just say that

deft linden
#

old software lover:

#

it was sarcasm btw

#

wait

stark shuttle
#

basically you have to declare all the sub classes at compile time

deft linden
#

its on j15

#

im dumb

stark shuttle
#

so nothing else than TriceratopsStages.Nothing can implement TriceratopsStages

west parcel
#

ohhhh

#

alr

stark shuttle
#

ye

#

supposedly you could write code safer

#

but in principle the feature is far from fundamentally needed

stark shuttle
deft linden
#

ig the segregation is down to your mindset since i find it fine