3 ms·
I'm actually quite familiar with JS and comfortable with writing callbacks on the client. It's very different from doing server and backend code. On the client
by hasenj 14y ago
I'm actually quite familiar with JS and comfortable with writing callbacks on the client. It's very different from doing server and backend code.
On the client, you don't make too many calls to the server, and if you do, I'd consider that you're doing something wrong.
What I mean is, on the client side, if you need to make 10 calls to the server before you can display something, you're obviously doing it wrong.
So you can avoid a callback mess by simply making sane design decisions.
But on the server side, you have to make several calls to the DB, and thus, the callback hell is unavoidable.
- nailer 14y agoOn the client you have callbacks every time an object has an event handler. It's not just AJAX. And yes, anyone familiar with client side JS should understand and be using callbacks everywhere.
- hasenj 14y agoUsing callbacks to handle user generated event is VERY different from using callbacks inside what should be normal linear control flow.