HTML, CSS, and JavaScript is now punk

If you’re in a web development job where you find yourself occasionally writing HTML, CSS and Javascript in the style of what may be disparagingly called spaghetti code — code that presumably works on production but is atrocious to read — congratulations: you may actually be invaluable to your clients or organization.

Hear me out. I hope that 90+% of code anyone anywhere writes is contextualized and normalized within some sort of framework or best practices that makes sense to your team. Ideally, your code gets reviewed by peers and is easy to understand and build upon if you for some reason were severed from your current role. I think most programmers would be happy to know their old code is still regarded as maintainable at the minimum. This is the code that should be driving most of your professional value.

But… sometimes… shit just has to get done. Fast. I found myself producing a website that turned out to be a little browser-based PDF viewer with a floaty movie background, pre-rendered. Despite being annoyed by the sudden urgency of this request, I was able to cobble together a single index.html file full of HTML, CSS, Javascript, with the only 3rd party dependency being Mozilla’s PDF.js library (because WHOMST wants to even think about browser-based PDF manipulation more than they have to?!). I pushed this to a fresh project on Render.com. I made some changes based on feedback and all my commits were redeployed instantly.

4 hours* of annoying kludge actually turned out to be exactly what my colleagues needed. I felt dirty putting together a single file monster after years of mentoring and managing a dozen or so Vue-based projects, but as the tired saying goes: the right tool for the right job.

I can’t help but think that anyone brought up in the Modern School of Web Development would scoff at not using React or some component library as a basis of this project. Can you believe I didn’t even use a CSS reset?

But going close to the web browser metal in this case let me work fast, and communicate clearly with actual produced work. It felt freeing in a way limiting yourself to a few powerchords and basic rhythms is all you need for punk rock. That, and a lot of learned expertise to make a limited toolset shine.

* there was quite a bit of debugging to gain parity between desktop/mobile, mostly around events and what turned out to be a memory issue with our PDF and what an iOS device would allow a web worker to take care of in the background.

Eric Brookfield @ericbrookfield