Remix.run Logo
▲ gavinray 5 hours ago

Funny story about drag-and-drop:

At my very first job, we had a weekly meeting to assign tickets and estimates.

Our non-technical PM wrote "drag-and-drop" on a whiteboard, and then my name.

"Gavin, how long do you think this will take?"

"All week. At least. Maybe longer?"

PM laughed, then realized I wasn't making a joke.

"What do you mean 'all week'? That's ridiculous, do I need to give this to someone else?"

"Well, you could, but I wouldn't count on you getting it any sooner."

Appalled, he exclaims: "It's just drag-and-drop!"

After 10-15 minutes of a room full of engineers trying to explain the difficulty, he gave up with an unhappy "Fine."

The phrase "it's just drag-and-drop" became an inside joke for the rest of my time there...

▲freecodeio 4 hours ago | parent | next [-]

I think non-tech people think that drag and drop is some sort of emergent property because you're pressing the mouse and holding it pressed.

▲adastra22 4 hours ago | parent | prev | next [-]

Dumb question: why? It’s been a long time since I touched GUI code, but I thought it gave you a message with the URI to the file. How is this significantly different than file-open?

▲gavinray 3 hours ago | parent | next [-]

This was circa 2010 or so, and it was a web app. So pre-ES6 JavaScript, before React.

Nowadays you would just "npm install drag-and-drop" but back then you often had to hand-roll solutions.

If anyone can dig up an ancient library on GitHub for drag-and-drop back in those days, I'd imagine it would be several thousand lines long, not to mention the absolute nightmare that testing something like this with a proper framework and accompanying testing library.

▲adastra22 2 hours ago | parent | next [-]

Ah, I was thinking desktop applications.

▲anonymous908213 2 hours ago | parent | prev [-]

Hit-test where the mouse-down event is fired, hit-test where the mouse-up event is fired. What the hell do you need a library for?

> If anyone can dig up an ancient library on GitHub for drag-and-drop back in those days, I'd imagine it would be several thousand lines long,

I bet, the JS devs who do write code overcompensate for the ones who can only stitch together libraries. I suppose because the expectation is that the library consumer is incapable of writing their own code extending it, so the library itself must support every possible combination of use cases for a million different users, even though the code any individual consumer actually needs is more like 100 loc.

▲gavinray 2 hours ago | parent [-]

  > What the hell do you need a library for?
On the frontend, you have to re-calculate the display state for all the possible drop positions, in-between transitions, and drop-end-snap-back.

Think of a grid of cards, and all the possible drag, hover, and drop state transitions it can be in with any other card, and the animations required to make it look nice

Now also consider that you need to persist the final state on the backend, and handle things like rejection, cancellation, failed updates/errors.

It becomes a massive state chart and web of complexity

▲anonymous908213 2 hours ago | parent [-]

I mean, maybe we're missing context here. Is that what your boss was actually asking for? 99% of web applications (or, hell, desktop applications) don't have ultra-interactive, fully-responsive-animation drag-and-drop. If he was asking for functional drag-and-drop and the team was implementing top 1% cosmetic drag-and-drop, that's certainly one avenue for a mismatch in expectations.

▲ehnto an hour ago | parent | prev | next [-]

I built a drag and drop content CMS/website builder in native Javascript years ago. The browser APIs are really cumbersome. The other issue is more UX than technical, there are lots of questions to answer. What are you dragging, what is it hovering over actually, what is the intention once it's dropped etc.

▲mcculley 4 hours ago | parent | prev [-]

There are more possible actions than opening files.

▲giwook 3 hours ago | parent | prev | next [-]

I love when non-technical people think they know better than the technical people about technical things...

▲timcobb 5 hours ago | parent | prev [-]

good thing you had backup. rough hahaha.