27
wicho
2y

Hours spent figuring how a select (dropdown) was created plus the whole flow of an app.

Me: "They won't be so stupid to get the whole html via ajax"
Me: *facepalms" they did
Me: Discovers the ajax call is handle via a giant switch statement
Me: All html is handled in memory

Me: Discovers the now Director of Development did it

Me: *Dev Rants*

You: Check my previous rant and confirm it

Comments
  • 5
    Same problems here 🙋
  • 4
    @MammaNeedHummus

    MamaNeedNewJob
  • 3
    Nothing better than 5 nested levels of stringified html to start your day with. Of course, each is at least around 300 characters long, not counting concatenation functions. All courtesy of the company CEO.
  • 5
    I'll never defend an enormous switch statement but using a fetch or xhr request to get html back instead of json is a perfectly valid approach.

    One drawback is of course, the response size will be heavier.
  • 0
    How would you have done it?
  • 1
    @jcbbb

    First of all SWITCHES ARE EVIL

    IT's 2023 USE FUCKING CLASSES

    NEVER PASS CONTENT THROUGH PHP MEMORY, THAT"S HOW YOU AUTO DDOS YOURSELF

    If no FE framework is avail. create an empty html and fill it accordingly just by pulling the right variables NOT FUCKING HTML
  • 1
    @nitnip They save the buffer into PHP and spit the variable back, that's memory raping
  • 3
    Never work for a company where a director or manager wrote the code.
    You’ll be powerless
Add Comment