Wait Long Enough And Sometimes Good Things Happen
post

Wait long enough and sometimes good things happen...

It can't come as a surprise to anyone that if you are in this industry long enough, you see trends and tools come and go. Sometimes you embrace them, sometimes you can dodge them. One of the things I managed to dodge over the years was having to do any front-end coding of any substance in JavaScript.

How did you dodge JavaScript?!?

If I am being honest, I think it was a combination of two things. The first was that I began my career helping to build web sites before AJAX functionality was even a thing. I distinctly remember the first time a co-worker showed me a set of interactive form drop-downs built using JavaScript.

"Wow, we don't even have to reload the page?!?! That is cool".

Keep in mind this was 2003.

The second reason I think I was able to dodge JavaScript was because I made "shouting at people about testing their PHP code" my career niche at around the same time.

So over the years I kept working as a "backend PHP developer" who would occasionally modify some JavaScript that I cut-and-paste from somewhere else. My crowning achievement was creating an interface that allowed players to be traded between the pretend baseball teams in my long-running simulation baseball league by using drag-and-drop.

I don't hate JavaScript, I just don't use it much

Now, this is not to say I didn't pay a little bit of attention to what the folks who did front-end development were doing. I was just skeptical that adopting a framework created by Facebook to solve their needs (React) was going to be a good idea.

My own personal favourite front-end language is Elm. Haskell for the web?!? Sounds awesome. Of course, I had no projects that needed that kind of work. So I continued to focus on server-side work and lean heavily on the expertise of others when it came time to do anything with JavaScript frameworks.

I also feel like I am in the minority of people who thought CoffeeScript was a great idea.

(Maybe you're starting to see a pattern?)

I think if I was forced to do JavaScript work, I would try to do it from the warm embrace of TypeScript because I find adding types to be incredibly useful.

During my time doing consulting work for a large avionics company, their browser-driven test suite relied on TypeScript. Look, it's fine. JavaScript is similar enough in syntax to PHP that there are no problems.

Async stuff though, that is weird and I still don't understand it. Maybe I can dodge that too!

What did I gain by waiting?

React and Angular have turned out to be, from this grumpy PHP programmer's perspective, a disaster. They dominate the industry but from all accounts are not allowing developers to build experiences that are great for anyone who is not running powerful devices with lots of available memory.

So I have not done any work with either of those two behemoths. I'm just this PHP guy, content to work with folks who understand those tools the same way I understand mine.

After looking longingly at Elm, I waited. After waiting for a few more years, I kept finding references and going back to looking at htmx.

Then, as serendipity always does, I saw a post on Mastodon by Jakob Zalas where he mentioned htmx and a great new web site promoting some great front-end development strategies called Hypermedia Systems.

This was a sign that I should go and take a look now. When a grizzled veteran of programming, who has done great work in multiple languages talks about a JavaScript framework, you should probably listen.

Takeaways

After reading this blog post you should know:

  • that I seem to like some weird JavaScript frameworks
  • I successfully dodged entire generations of tools
  • I like approaches that use repeatable patterns
  • I pay attention to the recommendations of other programmers I follow and respect

Categories: development