One thing that we do well

Leena
Continuous Delivery
2 min readAug 7, 2019

In this world of Microservices, I am building a Monolith app. In this world of React and Vue, am building a server-side rendered app.

However, I need Javascript. I can’t avoid that. I need some parts of the page updated dynamically. I need to show or hide certain parts of the page depending upon user actions.

I don’t want JQuery for the obvious reasons. It is slow.., heavy. Moreover, it can easily create spaghetti code. I don’t want to use React or Angular or Vue because I am not building a Javascript app. I want to use Javascript with least frameworks. Also, no more JSON to DOM circus.

Stimulus JS provides controllers attached to elements (HTML elements) which get triggered on actions (like button click, link click etc. or any std element events). Update DOM or render server-generated HTML during actions.

Stimulus JS Controller
HTML element setting up Stimulus JS controller and action

I’ve been using Stimulus JS for over a year now. It is making me feel smart 😄

Stimulus JS is a classic example of doing one thing well. As Jeff Atwood has written in this post:

The late, great Jack Palance played grizzled cowboy Curly Washburn in the 1991 comedy City Slickers. Curly’s Law is defined in this bit of dialog from the movie:

Curly: Do you know what the secret of life is?

Curly: This. [holds up one finger]

Mitch: Your finger?

Curly: One thing. Just one thing. You stick to that and the rest don’t mean shit.

Mitch: But what is the “one thing?”

Curly: [smiles] That’s what you have to find out.

Yes, we all need to find out what “one thing” we need to do well 🙂.

The same holds good for the code we write, and the product we build. That is the philosophy of simplicity, the secret of life.

--

--

Leena
Continuous Delivery

Co-founder/CTO @ PracticeNow, Bangalore, India. A strong believer of lean principles, an evangelist and practitioner of Continuous delivery