Style

Constraints

Style is "nothing but the consequence of creating under constraints" - Cristina Videira Lopes

Let's talk about style, another aspect to our craft checklist. So what is style?

Every medium that we work in has constraints by its nature. A guitar or oil on canvas behaves a certain way. By its nature it doesn't just provide great results, you have to learn how to overcome these constraints in order to make something good.

Throughout our journey we are butting up against these. As we go it becomes easier, and I think this is an aspect we admire the most in masters. The effortless way they work with those constraints, by making them seem no longer seem present.

We also have the constraints that are self-imposed. I think these are the more important of the two, the natural or external constraints and our self-imposed constraints. The reason being is everyone will face the same natural constraints, it is our self-imposed constraints that sets us apart.

A photographer that only shoots in B&W or with film. Whatever it maybe for your space, as you grow you will often impose constraints on yourself. It is often thought that constraints limit what you produce but it is actually the opposite.

Micro-decisions

Style is a set of different repeated micro-decisions, each made the same way whenever it arises, even though the context may be different - Frederick P.Brooks, JR.

I am not sure it is irony but while there are constraints, at the same time there is too many choices. In technology, we call this the search space. The medium is constraining us in but at the same time there seems to be a million ways to interact with the medium.

I think many beginners feel this when getting into to hobbies, the shear volume of things. Oh, you want to get into photography, which of the numerous brands and types of cameras should you choose? It can be overwhelming. I want to paint a beautiful sunset, should it be water colors, oil, acrylics. What brush strokes should I use?

Often beginners will just choose anything that is convenient at the moment but often next time a similar situation arises they may do it differently.

They don't have any consistency or intention. The choose things based on trying to get through the moment, not on why you should do that way or not. To them, these decisions are functionally equivalent because they are unaware of what the differences are.

Each choice has many implications, most of the time made without any knowledge of what those implications are.

These often explicit choices are what enable us to reach our goals.

Part of reaching mastery is understanding that every decision can capture more of your domain. That is what can make one decision better than others.

This is a super contrived programming example to keep it simple for non programmers. Let's say we need to square a bunch of numbers and create a new list or array of them. The basic way is to use a for loop. A for loop, repeated over and over until some condition is reached.


numbers = [1,2,3]
squared = []

for num in numbers:
	squared.append(num * 2)
	
#squared ia now [2, 4, 6]

In Python and many languages though, there are other ways to do the same thing. In Python, there is a thing called a list compression that basically applies an operation to a list and returns a new list.


numbers = [1,2,3]

squared = [num * 2 for num in numbers]


This, to me, is better for many reasons, we won't get into all of them but a major one it is easier to understand. In programming we are trying to get computers to do things, but we also need to write code others can use, including or future selves. So part of my style is making choices that take that part of the domain into account. That part of the domain I am trying to capture is the cognitive load. Meaning, more complex code is harder to understand by others.

While both examples are simple now, but what tends to happen is things like this:


numbers = [1, 2, -3, 4, 5]
user_threshold = 0  # We'll pretend the user gave this value earlier

for i in range(len(numbers)):
    # 1. Convert negative values to 0 in-place
    if numbers[i] < 0:
        numbers[i] = 0

    # 2. Print debug info for every item
    print(f"[DEBUG] Index {i} has value {numbers[i]} before doubling.")

    # 3. Double the number in-place
    numbers[i] *= 2

    # 4. Check against user threshold (unnecessary nested logic)
    if numbers[i] > user_threshold:
        print(f"Value {numbers[i]} is above threshold {user_threshold}!")
    else:
        print(f"Value {numbers[i]} is NOT above threshold {user_threshold}!")

    # 5. Perform a second calculation for some reason (mixing logic)
    random_calc = (numbers[i] // 2) + 42
    print(f"[DEBUG] Another random calculation for index {i} is: {random_calc}")

print("Final numbers:", numbers)


This is a super contrived example that Chat-GPT wrote, but even then, this is far from the worst I have seen. So it is not that for loops are bad per se, but when you use them, you make a choice. That choice often has secondary effect. By using a for loop when something better exists, you open the code up to father terrible choices. The for loop is often the lazy option instead of structuring your code in a better way.

Each choice hopefully improves a secondary decision. We talked about how masters can show economy of motion, and that is because each choice is made to serve the next. In this case, it could also be to prevent things. In this case, by not using for loops, I am hoping to prevent further devs from just extended creating bad code. Also, for loops are often where bugs are introduced. By avoiding them, I am hoping to have first order effects, easier to read, the code is broken up into more logical steps, and secondary effects, try to prevent bad code and introduce difficult to find bugs.

The list comprehension by limiting its structure represents a constraint. This to me is another aspect of style or the lack thereof. People without style don't give themselves any constraints and will just tack on things and never reduce.

If we could define a big part of Hemingway's style, it would be around constraints and his disdain for adverbs. 1

We often think about style as the outward appearance. Hemingway writes like this, Steve Jobs dressed like this, a painter paints like this. Those are the symptoms, but not the core. There are underlying reasons and goals a person is trying to achieve, and the affectation is style.

Style working definition

To sum up, style is our intentional, consistent decisions and constraints through which we express ourselves.

Another way to say it, is style is our filter we use to block out the aspects we don't want and to focus on what we do want.

We develop our filter to focus on the things we care about, want to extenuate and highlight. The things that bring us the most value, while excluding the things that don't.

Developing your filter and finding your style

So our goal is to figure out what we want to achieve and then develop our style in hopes that it helps us reach our goals.

Like pretty much all the things in this book, there is probably no straight line to that answer. It is a mix of exploration and discarding. Exploring, looking for new things that help and discarding the things that don't.

So it will, may seem a bit contradictory that as we go we want to exclude increasingly in order to find our style, in the beginning though we should be exploring as much as possible. In fact, this probably never stop. I have been programming professionally since I was 17, and I am still not fully happy with my style and still exploring.

Overtime, what we choose to keep out of our style is just as important as what we keep.

Let's look through some strategies to help find our style.

Copy, copy, copy, copy

Nobody is born with a style or voice. In the beginning, we learn by pretending to be our heroes. We learn by copying. - Austin Kleon

Those who do not want to imitate anything, produce nothing - Salvador DalĂ­

Start copying what you love. Copy copy copy copy. At the end of the copy you will find yourself. - Yohji Yamamoto

In the beginning, we often don't have a good internal critic or goals on what is good or bad. We need to start somewhere, and that place is to imitate the people you admire. Some of the most famous bands started out as cover bands.

Daniel Coyle in "The Little Book of Talent" calls this engraving

"Chess players achieve this by replaying classic games, move by move, public speakers do it by regiving great speeches complete with original inflections; musicians cover their favorite songs; some writers I know achieve this effect by retyping passages verbatim from great works"

He goes on further to say that we are often told talented people acquire their skill by following their "instincts". But he says this is basically BS and "all improvement is about absorbing and applying new information"

Your natural instincts and likes and dislikes can come in the form of your taste, what you think is good and bad, but on the skill side, a lot of it comes from stealing or imitating others.

There are many goals with this practice.

  • Develop our inner critic and analyze what you like and don't like about different styles
  • Understand our goals better
  • Understand the space of possibilities
  • Steal as many techniques as we can.

Which brings us to our next step.

Steal

Don't steal the style, steal the thinking behind the style - Austin Kleon

If you just mimic the surface of somebody's work without understanding where they are coming from, your work will never be anything more than a knock off - Austin Kleon

Copying is a great place to start but what we really want is to steal. Great artists steal and such.

This highlights the idea that style is about a goal or what the creator is trying to capture.

We often see style as the end goal, but often it is a side effect of what the person is trying to achieve. We don't want to blindly copy and mistake some aspect or technique as the goal. This is the origin of cliché. We want to understand what the person was attempting to achieve and see if that matches our goals. If it does, then we steal that intention or that goal.

In the J.J. Abrams Star Trek reboot, he was criticized for the use of lots of lens flair. It is excessive, but it wasn't about using lens flair. He was attempting to find a way to make the movie look futuristic. That was the goal, the lens flair was just one (overused) technique to do that. We are looking for that level of understanding when attempting to steal from others. What were they attempting to accomplish?

We are seeking contrasts. The contrasts in working in different styles will highlight your own style better. It will bring out the consequences or implications of that style.

Break down the advantages and disadvantages of that style. The goal of your style is for it to be deliberate and to capture more of your domain.

Bauhaus or steal a design philosophy

When I was starting out in software, I had no idea what it meant to write "good" or "bad" code. It seems obvious now, but back then I just didn't have many mental hooks to judge it. Sure, your code should do the thing that it is supposed to do and also not crash, but how did that translate into the lines I wrote?

To start, we need some hooks or some scaffolding to start with. Some kind of measure we can stick in the ground to reference. The reference itself is not always that meaningful, and we may grow to move away from it. That is ok, but we need something. It is like being lost and finding reference markers to orient yourself.

For me, that was Bauhaus.

Bauhaus was an art school founded in Germany in 1919, which led to a design movement that influenced many areas, from art, to architecture, industrial design and many more. 2

This design philosophy focused on the function of things, and that the form of something comes from the function of it. Kind of how we have been talking that our style comes from the function of our goals and not the other way around.

A good example of this can be seen in Bauhaus influenced architecture. This building was designed by Bauhaus founder Walter Gropius in 1911. 3

Fagus

What may not be immediately apparent to our modern eyes is all the glass. This is quite common now, but back in the early 19 hundreds not so much. Building needed lots of support with the then prevalent materials. Will talk more about this as well in the design chapter, but they were trying to build buildings that stood up, they weren't as focused as much on the people who needed to use them.

This is where the form follows function comes from. The idea behind Bauhaus is that the part of the domain we need to capture is that people have to work in these buildings. People need light to work and in a time when electric light was also a new thing, natural light was a much-needed requirement. Even beyond that, having natural light and space provides a much better working environment.

The design of this building follows from those design goals. The glass to the corners isn't just a stylish aspect, it comes from a want to provide the most amount of light possible to the interior.

This idea directly influenced me when I was starting out programming. I should focus on what I want to accomplish and not how it looks. When I was starting out, all serious programming was done in a programming language call C++.

It is still used a lot today in game programming. That being said, C++ is a superset and a defendant of a language called C. So code written in C can be used in programs written in C++. To me, C++ was and is a language that has lost the plot on form. There are a million ways to do things in the language, so much that there is a whole series of books called "Effective C++" on how to use the language properly.

C is a minimal and elegant language where it is difficult to write things in meaning you are constrained, and by its nature, is difficult to add useless forms.

Which brings me to my next point.

Wabi-Sabi

tbd https://youtu.be/csfr1ht-uCc?si=VL58dzdqfmBhtS12

Constraints

While at the time I am not sure if I could give you a real flushed out criticism of C++ but my initial reaction was that there were many things that seemed superfluous. That being said, what was clear to me was that C++ was a huge league to master. Like I said, there were many hundred-page books written for people that already knew how to program in C++ but still needed guidance on how best to use the language. There were just too many choices that didn't seem directly related to my goal of creating good code.

My choice in using just C was also a decision to reduce the space of choices. C++ had so many features in it that learning all of it would take a lifetime, possibly several.

C is a minimal language and, while still requires time to master, its features do not.

My point is each choice unlocks even more choices and options. By limiting it, you can focus on a small subset of things first.

I am starting out in photography and there are so many options. Cameras, lens, editing and many more things.

Should I use this lens or this one, what is the reason for one over the other?

Our goal is not the lens or the camera but the photo.

For me, I find it helps to limit some choices at times to find something so you can focus on a smaller number of aspects.

We want to focus on the result and then see if the tools and techniques, lenses or languages are helping our hindering us.

Speed

Another aspect of style is speed. We talked about how masters can create faster than non masters and part of that is that many of the micro decisions have already been answered. By developing your own style you already have a framework on how to solve any problem.

When starting on a project, beginners and intermediates often have a blank slate and need to answer a whole set of questions. As you build your style and your filter, you have already eliminated those choices and can just work.

Style questions

These are a set of open questions to help with figuring out your style.

  • What is does it mean to write good code, take a great photo, etc?
  • What are the gaps between what you want to create and what you are creating?
  • What are the micro decisions?
  • What parts of the domain are you trying to capture?
  • What do you like or dislike in a style?

Exercises in Style

Exercises in Style by Raymond Queneau is a book where the same story is told in 99 different styles. 4

I learned of that book from the book Exercises in Programming Style by Cristina Videira Lopes, where she shows the code for the same problem written in 47 different programming styles.

  • What would be the "Exercise in Style" for your craft?

Mood Board

Create a mood board. Through everything you like on there and start to analyze what are the commonalities.

References

1

https://www.coleschafer.com/blog/ernest-hemingway-writing-style

2

https://en.wikipedia.org/wiki/Bauhaus

3

https://www.artsy.net/article/artsy-editorial-8-iconic-bauhaus-sites-visit-100th-anniversary

4

https://en.wikipedia.org/wiki/Exercises_in_Style