393
you are viewing a single comment's thread
view the rest of the comments
[-] Miaou@jlai.lu 1 points 6 months ago

Having to run a debugger to know what gets called at a given time is awful, and this oop practices exacerbate this

[-] CapeWearingAeroplane@sopuli.xyz 1 points 6 months ago

I am very fond of the idea of "stateless" code, which may seem strange coming from a person that likes OOP. When I say "stateless", I am really referring to the fact that no class method should ever have any side-effect. Either it is an explicit set method, or it shouldn't affect the output from other methods of the object. Objects should be used as convenient ways of storing/manipulating data in predictable/readable ways.

I've seen way too much code where a class has methods which will only work"as expected" if certain other methods have been called first.

this post was submitted on 30 May 2024
393 points (94.6% liked)

Programmer Humor

32601 readers
163 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS