I Fought Javascript and Won | #4

With a large project to tackle over the entire summer and few people to do the tackling, I’ve attended to many projects around the company. They vary widely, hailing from most parts of the full stack and each requiring me to learn most of it as I went along. A new day, a new set of documentation to wrestle with – which was exciting! I’ve learned more technologies more quickly than I could have imagined previously. So looking back, picking a favorite doesn’t come immediately.

But then I remember one of the first projects I took on, which taught me some basic Javascript and infuriated me for nearly eight hours.

As a programmer, I am no stranger to procedural abstraction: the idea that there’s a lot going on beneath seemingly simple actions. Walking, for example, seems simple when you think of simply moving your feet in front of each other, and becomes much more complex when you think of the systems in your brain that convert abstract thought (there’s another abstraction) into signals to your muscles into measured movement which is constantly aware of an environment around you. Your body is a complicated and beautifully impressive machine! And so are websites!

It may seem a simple matter to open up a website and accomplish whatever you sought to do, like like a photo of a dog, or post a photo of a dog, but it’s incredible the worlds happening beneath. The servers, the symbols, the security – and that’s not even considering how machines even communicate these things to each other but I haven’t taken EECS 370 yet so I’ll leave that to your imagination.

So at the beginning of my internship, I found myself learning web development and absolutely stumped over a drag and drop.

Perhaps there were better solutions, easily discoverable by Javascript Experts™, but the frameworks we had chosen and our page organization posed a few unique constraints on our implementation. Also, this was still about week one and a half of me learning Javascript. So keeping these excuses in mind, I’ll tell you how I spent hours bewildered that the well-documented HTML events were not behaving as expected, how they went wild and didn’t respect the borders I had carefully delineated in the CSS, and how almost every Stack Overflow question said “HTML’s recent drag and drop features have been a disaster.”

It crossed my mind to use a solution that ultimately had nothing to do with a conceptually sound drag and drop, and simply mitigated the bug, but at the time I was too adamant on being a Good Programmer™. The truth, a solution that drilled down to the rotten core of this issue, existed!

About two hours later I decided that not every dream is meant to come true, implemented the slightly hacky solution, and the “drag and drop” worked perfectly. Perhaps it wasn’t the pure victory I had imagined, but I had done it – functionally, I had won.

But the best part – the website has developed to the point that within a month, the drag and drop wasn’t even in the final product!

Such is learning. Such is life.

Leave a Reply

Your email address will not be published. Required fields are marked *