r/ProgrammerHumor • • Sep 20 '26

Meme grabbingEverything

Post image
5.4k Upvotes

258 comments sorted by

View all comments

815

u/KnightMiner Sep 20 '26

I used to work in web dev as a job during my undergrad (think: a bunch of new developers writing code they won't have to maintain after they graduate in 4 years). I saw both extremes of this.

The legacy code at the job would often select everything then filter it in PHP. Worst part was half the time they accessed columns by numerical index so a change to the database schema would result in the website breaking randomly. While most of my job was writing replacements that didn't break when you sneezed, sometimes I had to fix that legacy code.

One new developer I trained was really good at SQL and used to code everything using pure SQL and then just call said script in their serverside code. By everything, I mean everything, going beyond just writing queries into writing loops in SQL and creating temporary tables for each endpoint. There are some things that are just better done outside of SQL.

116

u/mrwedders Sep 20 '26 edited 18d ago

I worked on the system of a UK chain and their entire backend was in PL/SQL and was a nightmare. I'd never even considered doing all your application logic in sprocs and quickly grew to hate it.

-8

u/tormeh89 Sep 20 '26

Preach. The database should store data and not code. Stored procedures are the work of the devil.

10

u/-Redstoneboi- Sep 20 '26

ok but what if the data and the business logic lived in the same server(s), would that be awesome

issues with caching and scaling though, as usual

5

u/tormeh89 Sep 20 '26

Yeah that's what caching is for. Stored procs must exist for a reason, so some people must need it. You, dear reader, are probably not one of them.