TIFU by not using objects in my object-oriented programming coursework
TIFU by not using objects in my object-oriented programming coursework
You're viewing a single thread.
All Comments
21 comments
Good, OOP can suck my balls
3 8 ReplyBalls.suck() is the correct syntax.
9 1 ReplyActually, it would be
OOP.suck(ddplf.getBalls())
2 0 ReplyDon't you need to declare new Balls() first? Or do you suck() Balls static?
3 0 ReplyBallsFactory ballsFactory = new BallsFactory(); ballsFactory.setSuckable(true); Balls balls = ballsFactory.create();
7 0 ReplyAll 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();
8 0 ReplyPython port:
from ballsucker import suck suck()
11 0 Reply
Or I didn't using the correct naming convention!
3 0 Reply
21 comments
Scroll to top