5

I was building a super simple Laravel app for a client (forms APIs stuff)

For the frontend I used jQuery cuz why overkill it with react.

Now the sad part:

The app makes ajax calls to fetch the data from the database and update the view according. The code is very well written and the call is so quick that in a blink of an eye the data is processed from the controller and sent to the view -_-

Because the user doesn't gets to see what the fuck just happened when they clicked the action button, I had to add a setTimeout function before the Ajax call to slow down the process by 2000ms and added a freakin spinner.

I feel very sad when I can't show how awesome apps I can build but,
I killed my ego for the UX.

This was my sacrifice.

Anyone faced similar shits?

Comments
  • 0
    One of the websites I will never visit. In the airport business we have to be able to explain why a delay was put somewhere.
  • 1
    FWIW I don't think it's sad and I don't think it detracts from what you wrote on the backend at all. It's definitely not the first time that "unnecessary" transitions have been added to an app for UX. There are still many benefits to making the backend code efficient:

    - If its runtime is impacted by the size of the db or anything else that might change over time, then you don't need to reoptimize the code later if it becomes too slow.

    - If you later use any of that backend functionality for anything else (cron script, part of a general API, a programmatic interface, etc), your code isn't going to create a bottleneck.

    - You're practicing writing efficient code and getting into good habits, which is good for your future projects and career.

    I think you should be proud that you made the best choice on the backend (efficiency) and also the best choice on the frontend (UX), even though you could have been lazy in both places to get a similar short-term result.
  • 1
    Did you try adding a flashy animation? Something like background color fadeout
Add Comment