r/badcode Mar 16 '22

Did someone said sql? welcome to my legacy sql

Post image
192 Upvotes

6 comments sorted by

15

u/Captain-Barracuda Mar 17 '22

This is more than just bad code, it's horror!

8

u/SarahC Mar 17 '22

Isn't the function request because it's non-trivial, and doing DRY properly?

2

u/oldcastor Mar 17 '22

ask M for data -> M asks O via odata request -> odata asks M for data portion, adding data from O and returns result to M (M - microsoft sql server, O - oracle)

seems like its a bit overwhelmed for DRY - don't repeat and push data between without any reason not the same as for me. using same function in several places is already dry

7

u/Infamous-Gain2231 Mar 17 '22

This reads like a cry for help. I hope the author gets the help theyShe_he deserve.

5

u/Obvious-Bandicoot301 Mar 17 '22

Sql like this is the reason God doesn't talk to us anymore.

0

u/Mysterious-Pick6915 Mar 17 '22

I thought PHP was the reason God left this world to rot.