Jeremy keith
..-..-2024
Jeremy Keith
Jeremy Keith is a well known developer that works at Clearleft. He held a presentation about declarative and imperitive design.
Declarative Design
He began his presentation with music as an example. There are diofferent ways to approach music. You have the classic way: notes in a list. And you can improvise while making music like jazz.
In programming you have also two ways of doing it. You have imperative programming: you tell the computer what to do and declarative programming, you dont tell the computer what to do.
Here some examples in programming languages:
- HTML (Declarative) domain specific
- CSS (Declarative) you giving a suggestion
- JS (client side) (imperative) a lot more power, but if you make a mistake it doesn't ignore, you can you use it in more places then only the web
Jeremy said: its all about mindset. Imperative is more control or desire to control. Declarative is giving up control.
People use javascript to create a button for instance, because of control. This is an imperative way of thinking. But Jeremy says: "js should only do what only js can do". Thats because you get all those browser features for free if you write semantic code. A lot less work and a lot more reliable instead of making it all on your own.
When writing CSS you can write both imperative and decarative.
- Imperative = 16px
- Declarative = 1rem
font-size: calc(0.5rem + 0.666vw); is more declarative then font-size: clamp(1rem, 0.5rem + 0.666vw, 1.5rem);. And padding-inline-start is also an example of a more declarative approach in css. Designing a border with colors or hexcodes is imperative. But designing the the border and saying that is should be 10% lighter is declarative.
Project utopia.fyi takes this further.
Jeremy also says that computers are good in maths. He showed a book "every-layout.dev" that says that the developer should set the boundaries and let the computer do the math (rest). Be the browsers mentor, not its micromanager.
He gave us the question "What is better?" and said: it depends. It depends on: the culture of the environment of the design its happening: management, (culture of the company).
Thinking
Analytical thinking, we analize the whole by breaking it apart en understanding that (zooming in). Systems thinking, you look at the whole (zooming out).
He asked us the question about what kind of enviorment we want to work in in the future. The declearative team or imperatave team?
The medium
Print design, native apps, os-specific: need maybe an imperative approuch, but he doesn't think that approuch will work on the www.
"The more you tighten your grip, the more the www slips through your fingers"
In the first years of the www it was more a imperative approuch but that is changing now.
My thoughts
I liked Jeremy's persentation a lot. He is such a good speaker and nice to listen to. The subjects imperative and declarative were totally new for me and got me started thinking about what kind of person I am and what I perfer.
I like javascript a lot so I thought I was leaning more to the imperative side. But I like javascript because of the logic that you can write, not because that it is imperative. And behind the declarative css can also be a lot of logic. I like the declarative approach more then the imparative approach for web design. It will be less work in the end. And when you forget something you don't get punished.