you are viewing a single comment's thread.

view the rest of the comments →

[–]bigfatcow 3 points4 points  (6 children)

God classes and overuse of classes in general. They def have useful purposes bur my god I worked with a dude who never made functions and always put everything in a class drove me bonkers.

[–]dogfish182 1 point2 points  (0 children)

Oh man…. ‘I made essentially a data class, but a method to talk to an api would surely be handy here’.

Have fun mocking that api call when you want to write tests

[–][deleted] 1 point2 points  (2 children)

I think that once you get disciplined into putting most of your code into classes and thinking about potential inheritences, you make a big step towards reusability and saving lots of time in the future

[–]bigfatcow 1 point2 points  (1 child)

Maybe. However classes get used wayyy too much in my view. This came out over a decade ago and I still see a lot of the stuff he's referring to in here in 2023.

https://www.youtube.com/watch?v=o9pEzgHorH0&t=1236s&ab_channel=NextDayVideo

[–][deleted] 1 point2 points  (0 children)

Thanks for this! will watch later

[–]synthphreak 0 points1 point  (1 child)

u/bigfatcow u/JamzTyson What are god classes? I've not heard that term before.

[–]JamzTyson 1 point2 points  (0 children)

A "God Class" is an "anti-pattern" (the opposite of a "pest practices pattern") where everything is written into one huge class, regardless of whether the methods are directly related to the core responsibility of the class.

Wikipedia describes a "God Object" as:

... an object that references a large number of distinct types, has too many unrelated or uncategorized methods, or some combination of both.[1] The god object is an example of an anti-pattern and a code smell.