Balls.suck() is the correct syntax.
TIFU by not using objects in my object-oriented programming coursework
2 years ago by Hellfire103 to c/programmerhumor
Don't you need to declare new Balls() first? Or do you suck() Balls static?
All of this is okay, but it's not production ready. This is what real production code looks like:
SuckableFactory suckableFactory = new SuckableFactory();
Suckable balls = suckableFactory
.setShape(SuckableShapes.round)
.setCount(2)
.create();
SuctionProvider mouth = SuctionProvider.getInstance();
SuckerFactory suckerFactory = new SuckerFactory();
Sucker sucker = SuckerFactory.create():
sucker.setSuctionProvider(mouth);
sucker.setSuckable(balls);
sucker.setIntensity(SuckerSuctionIntensities.medium);
sucker.suckSuckable();
Python port:
from ballsucker import suck
suck()
@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
go to feed...
@lemmy.ml
Post funny things about programming here! (Or just rant about your favourite programming language.)
go to feed...
Good, OOP can suck my balls
save