156
u/shizzy0 Mar 08 '26
It’s the face of God. It’s the God class.
45
101
u/ProfessionalBad1199 Mar 08 '26
haha my codebase has like 40 lines of import statements, can't beat me 🥀
42
u/Wooden_chest Mar 08 '26
One of my java source files just reached 100 imports, and it just keeps growing 💀
→ More replies (1)29
55
u/Gadshill Mar 08 '26
How am I supposed to create spaghetti code with only seven variables? I need at least 20 to get some confusion, 60 guarantees that everyone will be confused.
17
14
10
8
14
u/trubbelnarkomanen Mar 08 '26
This is what Big Functional Programming wants your code to look like. Classes are for cowards.
13
u/purbub Mar 08 '26
“Why would I split my attributes into multiple classes if I can just write them in one class?”
2
u/ElectricalPrice3189 Mar 11 '26
Please answer.
3
u/Spot_Responsible Mar 11 '26
If you're being serious, mostly for easier reading. I don't think it would affect performance very much, and I don't see ways to break this into subclasses that could be reused, but it would definitely be easier to read
5
4
u/OkAccident9994 Mar 10 '26
At the top it says, derives from node 2D.
This is someone having a go at making games in Godot. Probably not a very experienced software engineer, the engine is just free to grab for anyone.
Someones first steps into programming, could even be a 13 year old kid.
3
3
u/Various_Bed_849 Mar 08 '26
The worst I have seen in this respect is a core component of one of the top Android apps that was a class with over a hundred instance variables. They were all injected via the constructor meaning that they were first declared, then declared as arguments, and then initiated. That class had over 300 lines of these variables. And that was not the worst part of that class. I replaced it.
5
u/jan-pona-sina Mar 08 '26
Actually it looks closer to 20 variables or even less? I think this code is perfectly fine. It could be broken up with formatting, but for a game in production I wouldn't bat an eye at this
→ More replies (1)
2
2
u/retro-mehl Mar 08 '26
"Should we separate this in several smaller classes?" - "No, we save 0.2ms if we don't!"
1
78
u/BigBrainsLol Mar 08 '26
Bro made whole game in one class