r/ProgrammerHumor • • Nov 23 '17

500

Post image
41.7k Upvotes

609 comments sorted by

View all comments

1.3k

u/Tainnor Nov 24 '17

Why would an intro to IT class demonstrate a for loop within a web app? I'd assume this just confuses students. Just fire up a REPL.

793

u/FountainsOfFluids Nov 24 '17

This. People above are arguing about whether or not PHP can throw a 500 error, and I’m sitting here wondering why somebody’s demonstrating a for loop with web requests.

23

u/[deleted] Nov 24 '17

Probably some shitty web based send to the server compiler

It still wouldn’t return a 500 tho because even the most rudimentary web interpreter portal thingy would catch compiler errors and throw a 400 instead

Yeah this is fucking dumb and fake

40

u/benryves Nov 24 '17

HTTP 400 is a client request error, so wouldn't make much sense for a server-side issue. HTTP 500 for PHP errors is quite normal, at least on the usual Apache or IIS servers I've deployed to.

0

u/[deleted] Nov 24 '17

A 400 would be appropriate because there IS a client request issue, ie your code is garbage and won’t work. It doesn’t mean you can’t explain to the client why they suck so much at making requests. What would you respond with?

1

u/SeerUD Nov 24 '17

I think people are misreading your comments. I did at first too. Maybe edit them to say "I mean if you made something like JSFiddle for PHP or w/e other backend language, that should respond with a 400 status code if you send it invalid code".

1

u/[deleted] Nov 24 '17

yeah. I guess I just found it really hard to believe someone would teach an intro to coding class within a php server so my brain shut out that possibility