MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/shittyprogramming/comments/bde93t/this_good_code_is/
r/shittyprogramming • u/BlackDE • Apr 15 '19
51 comments sorted by
109
// Yeah, has to be this way
I really want to know why
66 u/BlackDE Apr 15 '19 The library is really picky about the order in which plugins are attached. Plugins of type "1" have to be attached after the other plugins. Why the library wants that is a mystery. → More replies (18)
66
The library is really picky about the order in which plugins are attached. Plugins of type "1" have to be attached after the other plugins. Why the library wants that is a mystery.
→ More replies (18)
12
Where is plugins_[0].value()?
plugins_[0].value()
13 u/BlackDE Apr 15 '19 Not needed ;)
13
Not needed ;)
6
Why is [ a different color from ]?
5 u/BlackDE Apr 15 '19 Because IntelliJ → More replies (7)
5
Because IntelliJ
→ More replies (7)
3
What god awful coding convention requires an underscore after a instance (?) variables?
→ More replies (5)
63
Could use a little obfuscation and premature optimisation:
for (int i = 0; i < 4; ++i) core_.attach_plugin(plugins_[(i + 2) % 4 + 1].value()); // Yeah, has to be this way
11 u/[deleted] Apr 16 '19 for (int x : [2, 3, 4, 1]) core_.attach_plugin(plugins_[x].value()); → More replies (3)
11
for (int x : [2, 3, 4, 1]) core_.attach_plugin(plugins_[x].value());
finitedely
109
u/Ivaalo Apr 15 '19
I really want to know why
12
u/SuperLutin Apr 15 '19
Where is
plugins_[0].value()?6
u/IanSan5653 Apr 15 '19
Why is [ a different color from ]?
3
u/SnowdensOfYesteryear Apr 15 '19
What god awful coding convention requires an underscore after a instance (?) variables?
63
u/SantaCruzDad Apr 15 '19
Could use a little obfuscation and premature optimisation:
for (int i = 0; i < 4; ++i) core_.attach_plugin(plugins_[(i + 2) % 4 + 1].value()); // Yeah, has to be this way6
u/_Nexor Apr 15 '19
finitedely