16
That stack of old JavaScript books got me thinking at 2am
I was cleaning out my closet and found this beat up copy of JavaScript: The Good Parts from like 2009. Thumbed through it and remembered how we used to write all our event handlers inline and think nothing of it. Now I look at modern frameworks and it's like a whole different language - arrow functions, modules, async await everywhere. Got me wondering if beginners today even know what a callback hell looks like. Has anyone else gone back and looked at how they coded 5 or 6 years ago and felt totally lost?
4 comments
Log in to join the discussion
Log In4 Comments
mileslane12d ago
Eight levels of indentation and we called it well structured" - that hit me hard. @colescott is right, that jQuery callback nesting could power a whole city block. I still get twitchy thinking about those deeply nested functions where you lost track of scope like five levels in.
9
colescott13d ago
Wait, you actually have a physical copy of The Good Parts? I thought those were a myth by now. I swear mine got lost in a move back in 2011 and I never got over it. Going through that book now would be like finding a time capsule of all the worst patterns we used to think were genius. Remember when we thought closures were this deep dark magic that only the senior devs understood? Now it's just Tuesday. I flipped through some old jQuery code from like 2014 and almost threw my laptop out the window. The callback nesting alone could probably power a small steam engine.
6
kellygrant12d ago
3 AM is about the only time looking at old JavaScript makes any kind of sense to me. @colescott nailed it with the callback nesting powering a steam engine bit, I swear I remember one function that had eight levels of indentation and we called it "well structured." That Good Parts book got me through a lot of late nights where I was convinced my code was haunted, turns out it was just me being bad at closures. Flipping through it now feels like reading a diary from a past life where I thought semicolons were optional and hoisting was just something you did at a construction site.
3
cole_murphy12d ago
Aw, call me crazy but that nesting made you really think through your logic instead of just chaining stuff.
-1