[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

OO programming is a bad meme.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 22
Thread images: 5

OO programming is a bad meme.
>>
>>61435287
Sure thing, buddy.
>>
File: IMG_0737.gif (142KB, 1221x1007px) Image search: [Google]
IMG_0737.gif
142KB, 1221x1007px
Hold the presses, we got a hot shot programmer over here with a brand new non meme idea!
>>
What will drive() do with so few attributes?
>>
>>61435498
Set 0 < speed < maxspeed, decrease fuel proportionally to speed until fuel is 0
>>
>>61435287
Whatever you say, friend.
*receives wage*
>>
>>61435519
Except there is no `speed`.
>>
>>61435682
>getSpeed()
>setSpeed()
>>
There sure are situations where OOP is not the best choice or strict usage of OOP is detrimental. But with all things considered its best solution.

But regardless software development is much more than just writing code, OOP proves time again to be the economically superior option.
>>
>>61435704
speed is missing from the attribute list
>>
File: 44e.jpg (12KB, 235x145px) Image search: [Google]
44e.jpg
12KB, 235x145px
>>61435287
>get speed
>set speed
>no speed attribute
>>
>>61435287
Blindly following a "programming paradigm" is shit. Use what's best for the problem space.
>>
File: 1496846617256.png (20KB, 125x130px) Image search: [Google]
1496846617256.png
20KB, 125x130px
>getters and setters
>>
>>61435682
>>61435725
>>61436000
>too intelligent to realise that speed is obviously a private attribute since it has setters and therefore not exposed in the attribute list
>>
>>61435287
>no mass attribute and therfore no inertia or weight transfer
>no tire member objects to encapsulate load, traction, psi, diameter, radius, wheel speed, direction of the front wheels
>no differential member object to describe how power is distributed to the wheels
>no transmission member object to define gear ratios and current gear
>no engine member object to describe rpm, max rpm, torque curve, temperature, cooling system, turbo/super member, intake and exhaust pressure, downpipe max throughput to exhaust system

if you do object oriented programming wrong you get bad software
>>
>>61436258
>fuel and maxspeed are both public
sure thing, senpai
>>
>>61436295
>maxspeed is obviously constant
>>
File: 1477694251038.png (358KB, 552x543px) Image search: [Google]
1477694251038.png
358KB, 552x543px
>>61436258
>omitting private members from a class diagram
>>
>>61436314
>implying class diagram shouldn't only contain public interface and nothing more

I guess you're the kind of person that autogenerate codes from your UML diagrams, aren't you?
>>
>>61436264
>needing tire objects when you can have molecule arrays
>>
>>61436376
>OOP program with only one class - atoms
>can simulate any real life object, it's just a matter of different arrangements of atom objects
>>
>>61435287
>steering isnt a method
>"fuel" is an attribute but "max_fuel" isnt
what half assed hr department scrub made that?
Thread posts: 22
Thread images: 5


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.