Hellfire103 to Programmer [email protected]English • 6 months agoTIFU by not using objects in my object-oriented programming courseworklemmy.caimagemessage-square24fedilinkarrow-up179cross-posted to: [email protected][email protected]
arrow-up179imageTIFU by not using objects in my object-oriented programming courseworklemmy.caHellfire103 to Programmer [email protected]English • 6 months agomessage-square24fedilinkcross-posted to: [email protected][email protected]
minus-square@[email protected]linkfedilink11•edit-26 months agoAll 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();
minus-square@[email protected]linkfedilink14•6 months agoPython port: from ballsucker import suck suck()
All of this is okay, but it’s not production ready. This is what real production code looks like:
Python port: