Hacker News new | past | comments | ask | show | jobs | submit login
Zen and the Art of Software Maintenance (sicpers.info)
155 points by ingve on Oct 25, 2019 | hide | past | favorite | 49 comments



After I read Zen and the Art of Motorcycle Maintenance, I went and bought myself a ‘71 Honda CB350, almost the exact bike Pirsig rode in his book. I found that fixing this motorcycle, taking it apart, fixing internal component, figuring out how everything ties together, and upgrading worn out or otherwise non-functional components, and putting it all back together, felt extraordinarily similar to my day job as a software engineer. There’s even the same “loop”: fix one thing, turn it on to test, then turn it off again and fix the next thing. The turnaround time is waaaaayy slower, and there’s a lot more opportunity to hurt yourself, but the skills as a programmer translate very well to motorcycle maintenance. Interesting to see that I’m not the only one who sees these similarities.


I recommend you investigate plumbing. Yeah, seriously.... I have not done anything very complicated, but it takes much of the same mindset (or skillset), it is satisfying, and you will have a job for life (aka I have just hit 50 and sort-of age discrimination (or just can't deal with the nonsense anymore-ness - or everything is so familiar it is so tedious))


I've seen "Zen and the Art of Motorcycle Maintenance" recommended on book threads on HN multiple times, by multiple people, so I would agree that yes, a lot of other engineers see the similarities!

The way the author explains how to go about to find the issue, fix it, etc. has made me much calmer about finding my own bugs and fixing them indeed.


There's a passage (page 123 in my edition) I really like about combining your mental model of something with the stimuli you get from your senses that I think has a lot to do with systems analysis and modelling.

You have to build up your mental model (and often your client's too) and, at the same time, evolve your interface to reflect this model and permit your client to do what he wants to do effectively.


That is very cool, I've owned a few bikes (all Japanese) with years from 1991 to 2013. It has been fascinating to compare how carbs evolved through CDI to ECUs, and how bikes are designed to be somewhat maintainable while being more complex than ever. I don't think I'll dare get into the gearbox any time soon though, the tolerances on everything now are just crazy.


And yet, even after seeing firsthand that computer programming is "extraordinarily similar" to the work of a vehicle mechanic, you still refer to it as "software engineering".

Do we think it has anything in common with engineering? Why not call your work something like "software mechanic" or "software artisan"? What is with the continued need for programmers to try to aspire to engineering, while not actually being licensed engineers or practicing engineering?

I don't think anyone outside the field takes programmers any more seriously when they call themselves "software engineers". Software overall is still late, slow, hard to use, buggy, and insecure. Nobody's fooling anyone.


To engineer something is, apparently, by definition, to "design, build, and maintain [a physical thing]".

What I do as a developer is "design, build, and maintain" some software, and while it may not be physical, the use of the software is a physical activity. In this way, software has a physical existence at the very end of the process, same as a bridge or other object, though you just touch or fiddle with it through an intermediary physical object.

I'm not sure I see why someone would be upset about use of the term engineer, unless they are an engineer and somehow see developers as 'other' and it makes them angry that someone may be intruding into what they perceive as some private club.

Besides, I didn't decide to be called a "Software Engineer", that was a title bestowed upon me by a company. Before that I called myself a "programmer" and that's what I tell people I am. Now that I know "software engineer" might annoy someone and/or make me seem loftier / more worth taking seriously, perhaps I'll start calling myself an engineer.


While I quite like the term artisan in some ways, mechanics do not build new things. You could call a maintainer a digital mechanic if you really wanted I suppose.

From my perspective software engineering will become more like engineering is now over time, just as engineering itself has become more rule bound and safety conscious over time, presumably since around the start of the industrial revolution.

The term engineering carries gravitas because getting it wrong is a big deal, and its becoming apparent the same is true when software goes wrong.


From the book there are levels of "awareness" as a mechanic.

The part where he described "mechanic's feel" was particularly interesting, and there are definite analogs with respect to software engineering.

There’s one psychomotor gumption trap, muscular insensitivity, which accounts for some real damage. It results in part from lack of kinesthesia, a failure to realize that although the externals of a cycle are rugged, inside the engine are delicate precision parts which can be easily damaged by muscular insensitivity. There’s what’s called "mechanic’s feel," which is very obvious to those who know what it is, but hard to describe to those who don’t; and when you see someone working on a machine who doesn’t have it, you tend to suffer with the machine. The mechanic’s feel comes from a deep inner kinesthetic feeling for the elasticity of materials. Some materials, like ceramics, have very little, so that when you thread a porcelain fitting you’re very careful not to apply great pressures. Other materials, like steel, have tremendous elasticity, more than rubber, but in a range in which, unless you’re working with large mechanical forces, the elasticity isn’t apparent. With nuts and bolts you’re in the range of large mechanical forces and you should understand that within these ranges metals are elastic. When you take up a nut there’s a point called "finger-tight" where there’s contact but no takeup of elasticity. Then there’s "snug," in which the easy surface elasticity is taken up. Then there’s a range called "tight," in which all the elasticity is taken up. The force required to reach these three points is different for each size of nut and bolt, and different for lubricated bolts and for locknuts. The forces are different for steel and cast iron and brass and aluminum and plastics and ceramics. But a person with mechanic’s feel knows when something’s tight and stops. A person without it goes right on past and strips the threads or breaks the assembly.

A "mechanic’s feel" implies not only an understanding for the elasticity of metal but for its softness. The insides of a motorcycle contain surfaces that are precise in some cases to as little as one ten-thousandth of an inch. If you drop them or get dirt on them or scratch them or bang them with a hammer they’ll lose that precision. It’s important to understand that the metal behind the surfaces can normally take great shock and stress but that the surfaces themselves cannot. When handling precision parts that are stuck or difficult to manipulate, a person with mechanic’s feel will avoid damaging the surfaces and work with his tools on the nonprecision surfaces of the same part whenever possible. If he must work on the surfaces themselves, he’ll always use softer surfaces to work them with. Brass hammers, plastic hammers, wood hammers, rubber hammers and lead hammers are all available for this work. Use them. Vise jaws can be fitted with plastic and copper and lead faces. Use these too. Handle precision parts gently. You’ll never be sorry. If you have a tendency to bang things around, take more time and try to develop a little more respect for the accomplishment that a precision part represents.


I hope you used genuine honda parts and didn't use a piece of beer can to shim anything.


Everyone in our circle of nerds recommends this book and all three times I tried to read it I found it absolutely unbearable. It collects dust in a donation box that I haven’t mustered the strength to carry down to goodwill.

Does anyone else share this sentiment? Did you ever crack the reason why so many love it? Obviously taste is subjective and we are not all supposed to like everything but I’ve always felt like the odd man out with this specific text.


I thought it was OK, but I felt it was more a critique of philosophy as shoe-horned into a purely analytical method than something that would appeal to most folks.

From Wikipedia [0]:

> The narrator examines the modern pursuit of "Pure Truths", claiming it derives from the work of early Greek philosophers who were establishing the concept of truth in opposition to the force of "The Good". He argues that although rational thought may find a truth (or The Truth) it may never be fully and universally applicable to every individual's experience. Therefore, what is needed is an approach to life that is more inclusive and has a wider range of application. He makes a case that originally the Greeks did not distinguish between "Quality" and "Truth"—they were one and the same, arete—and that the divorce was, in fact, artificial (though needed at the time) and is now a source of much frustration and unhappiness in the world, particularly overall dissatisfaction with modern life.

Socrates in Plato's writing focused acutely on finding these capital-T Truths that were universal. The book argues that focusing exclusively on this can't fully inform you on how to live a good life.

Note that arete means both quality and skill. To simplify a bit a person's character was believed to be built on virtue, and someone who was a "skillful" (arete) at being a person was a virtuous person.

[0] https://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_...


I totally love and revere the book (ZATAOMM), and have read it multiple times.

Then again, I am super-detail-oriented, so that makes sense to me, because IMHO that’s the kind of audience for whom Pirsig wrote the book.

It _is_ a book about the nature of quality, after all, and Pirsig spent four years writing it, with the aid of PostIt notes all over the walls to organize it.

Not all people are detail-oriented enough to be capable of the laser-like focus needed to get all of the way through the book without losing interest. No offense intended, each to their own.


I agree with you, it’s a fantastic book, and not really about motorcycles at all.

(If memory serves, Pirsig used note cards or slips of paper to assemble this ambitious work. Post-It’s were first sold in 1977; the book was published in 1974.)

Those who have an open mind and want to try the book should find the 10th anniversary edition; the author’s afterword explains some things that some readers found elusive.

Pirsig’s obituary in the N.Y. Times is excellent:

https://www.google.com/amp/s/www.nytimes.com/2017/04/24/book...


> Pirsig used note cards or slips of paper

Ah, yes, my mistake. In my memory I confused index cards with PostIt notes.

> and not really about motorcycles at all

It's Zen, but it's not about Zen; it describes motorcycle maintenance, but it's not about motorcycle maintenance.

These are just a vehicle (no pun intended) for Pirsig to show us the inside of his post-apocalyptic mind, as far as he could remember once being who he called Phaedrus before they zapped him.

I found the book a multidimensional view of Pirsig's current and previous mental state and philosophy, just like the description of a computer software architecture is a multidimensional view of the architecture, neither and none of which can be described by a mere linear narrative.

It (ZATAOMM) is part philosophy, part memoir, part attack on what he calls the Church of Reason, part description of insanity, and more things I can't think of right now. No wonder it took him 4 years to pull together all those threads of consciousness, some of which were very damaged indeed.

Although, like another commenter noted, just spending 4 years on writing a book doesn't mean it automatically deserves accolades - and I agree with that observation - someone who reads it with even a fraction of the patience and insight with which it was written, might be tempted to award accolades after all.


I slogged through it. I appreciate the sentiments expressed in the book, but it was not a breezy read. I found it to be dry and long-winded.


I wholeheartedly agree. "Pretentious" is the word I would use for it. "Insincere" is another.


Sorry you feel that way. I feel it’s a work of genius, the regular structure of which reflects Pirsig’s obsession with quality.


You keep arguing that the author is obsessed with quality, and therefore the book is imbued with an abundance of it. Quality is totally subjective. Taking four years to write a book and obsessing over quality is really not a badge of honor in and of itself.


You misunderstand defined's post. He's not saying that ZATAOMM is a high quality book, because the author was obsessed with ensuring that his book was of high quality. If that was the case, you would be (mostly) right, as there is a subjective aspect to determining quality.

No.

ZATAOMM is a book about the philosophical concept of "Quality". What is "Quality"? What do we mean when we say the word "quality"? How does that understanding, or lack thereof, impact our life, sciences, and society?

That is what defined meant. Read with that understanding, defined's statement reads:

I believe ZATAOMM is a work of genius, that was only possible due to the author's obsession with learning everything he could about the topic of the book before writing it.


Thank you for explaining that. You are exactly right.

I really should have spelled it Quality, to show that I meant the philosophy of Quality rather than its more mundane interpretation.

At the same time, in an interview with Pirsig that I read somewhere, IIRC he did rather archly claim something to the effect that the book had better be high quality, considering its subject matter.

I tried to find that interview, but could only come up with this piece [1].

[1]: https://www.theguardian.com/books/2006/nov/19/fiction


>Quality is totally subjective.

No, it's not. That's just an American prejudice about it, because the individual there is always king, even if they are as crude as they go...


I also dislike the book. As someone who loves motorcycles and fixing an old Honda myself, it is something I want to love. To me, the protagonist is trying to show how smart he is after reading some intro to philosophy book.


It made a lot of sense to me as an undergrad philosophy student, reading it shortly after I graduated. IMHO the book is somewhat better if understood as a criticism of the Socratic pursuit of universal Truth if you are familiar with the context. But unfortunately this book is recommended to a general audience, for which I think it is a poor novel.

Pirsig did have at least some formal academic knowledge of philosophy though.

From Wikipedia [0]:

> Pirsig earned a bachelor's degree in 1950 from the University of Minnesota.[8] He then attended Banaras Hindu University in India, to study Eastern philosophy and culture. At the University of Chicago, he performed graduate-level work in philosophy in the Committee on the Analysis of Ideas and Study of Methods but he did not obtain a degree there. In 1958 he earned a master's degree in journalism from the University of Minnesota.

[0] https://en.wikipedia.org/wiki/Robert_M._Pirsig#Early_life


>To me, the protagonist is trying to show how smart he is after reading some intro to philosophy book.

I'd accept that accusation from people who have read many philosophy books and delved much deeper, and regularly read heavy discourses into the subtleties of the topics examined in ZatAoMM.

Else, it sounds to me like "I'm a plain Joe, I work hard, watch TV, and drink Budweiser, who's this guy writing all fancy about philosophy, when they don't even have a philosophy degree? I don't read no philosophy, but if I ever did, I'd check a professional, not some writer guy. Just gimme a page turner airport-thriller writer-boy".


Perhaps you are just more sensitive to style than others? The style of writing and the substance of the text are two different things. i.e. I've read widely enough that once I "pick up" the style of the writing, reading a book does not become a chore, but I do have my preferences.

David Foster Wallace is a perfect example - I can see the "quality" of the style of his writing and I can intellectually appreciate it, but all of his writing is a slog and definitely needs a bit of editing. I grew up with Alan Dean Foster, so that general style I respond to very well. Lush prose like Borges goes down well, but it is like velvet red cheesecake. And Sally Rooney is absolutely wonderful, but her style is ... hell, I don't have the words. And do not get me started on Susanna Clarke! New book coming out!


>Obviously taste is subjective

Subjective as in it's up to the individual person whether it likes or doesn't like something.

But it can also be of objectively variable quality (eg. someone liking Vanilla Ice's work who can't stand Bach or Coltrane).

Taste is not something passive and "everything goes" just because it's subjective. It's also something that can be cultivated (even in food -- imaging someone crazy about Hot Pockets, McDonalds and Taco Bell, who doesn't like cooked food because it "tastes bad"). It's a little heresy to say that someone's individual taste is not sacrosanct but can be objectively crap in the US, but it's much more acceptable in good ole Europe.


I only liked it a little bit but was recommended by someone for whom it was their favorite book ever.

I only really took away one thing from the book (some deeper level of understanding of what is meant by "quality", in the sense of craftsmanship). I value that understanding and am happy I read the book, but I don't use that wisdom very often in my life.

Maybe you're reading it in a way which expects it to have a plot? I don't know, I think book recs are generally hard and people should only trust book recommendations from people who like books for the same reasons.


I took away the parable about the broken motorcycle flummoxed by a screw.

As a kid, I didn't want to take things apart. It's breaking the rules, usually. But when something is already broken, then the rules change, and this book gave me language for that.


Weird. The first time I read it I happened to come across it while browsing at a bookstore and I was unable to put it down. I sat down in the bookstore and read it in one sitting over a few hours.


sir, this is a bookstore, not a library


Same here. This problem of feeling left out may not be there if the person who recommends it also provides the reason he recommends it for.


Ditto. I found it awful.


In Pirsig's second book, Lila, he returns to examine what the romantic-classical synthesis looks like from another perspective: the moral perspective. He imagines the moral qualities of the world. What are the moral qualities of a motorcycle? How ought a motorcycle to behave?

Pirsig proposes a thought experiement, the "chemistry teacher" experiment, where a chemistry teacher is left on a beach to rot. Through this experiment, he concludes that the morality of chemical objects, of atoms and molecules, is precisely the rules of chemistry. Indeed, Pirsig supposes that most of the natural world is like this, where things do as they ought already.

(I would close the door by suggesting that, in the Discordian tradition, the morality of people, and indeed any sapient creature, is to do as we like. This not only neatly lines up with Pirsig's philosophy, but also gives that the Free Will Theorem still holds and is useful!)

So, what is the morality of software and computers? The morality of physical computers is quantum electronics, and the morality of software is information theory and mathematics itself. I'm humbled.


Metaphysics considers the possibility of a universes with properties different than ours.

If such things exist, then things in our universe behave as they are more than any ought.


Metaphysics is more philosophy than physics


Yeah, I must be pretty confused to post a comment about metaphysics in reply to a comment discussing the morality of chemistry.


Sadly, I did not enjoy _Lila_ nearly as much as ZATAOMM. It seemed to be less organized or something.


At the end of day, the customer does not care if, for example, you implemented their project as giant if-then conditional; as long as it works. It is the craftsman in us that makes us write quality code; it is something we ultimately do for ourselves.


I hate this sentiment so, so much.

Let's take it out of the realm of software for a moment. Let's use the motorcycle metaphor, since this is a ZATAOMM thread.

At the end of the day, the customer does not care if, for example, you fixed their bike sloppyily, quickly, or haphazardly; as long as it works. It is the craftsman in us that makes us care about the nature of our work. It is something we ultimately do for ourselves.

Bullshit!

It is true that no customer is going to care how we organize our tools in the mechanics garage. We should not be having long arguments about whether 2 storage cabinets or one make more sense for holding our screwdrivers. If at the end of the day, the radiator is replaced in the same way, and the coolant is cycling correctly, then both the slow and steady and the quick and haphazard mechanics did a good job, however they accomplished this fact.

But the ENTIRE POINT of the book, is that these two mechanics WILL NOT accomplish the same job. Sure, they may both deliver the same result in 7 out of every 10 jobs they are given, but those last 3 matter! And are almost certainly going to be the hardest of the 10.

More direct to your point, however, customers ABSOLUTELY DO care whether we replace the radiator with a cheap chinese knockoff that's likely to break in 1k miles, or the 5x more expensive overseas german version. And they ABSOLUTELY do care if the haphazard mechanic or the slow thoughtful tedious one does the job.

They just don't all care equally. Some customers want the cheap chinese knockoff (the giant if-then conditional). If it doesn't work, they'll just throw away the bike and buy a new one. Other customers want the german and thoughtful mechanic, and will pay accordingly.

Its about knowing who your client is and why.


As the customer (or rather, as the maintenance programmer at the end so one of the customers) of your software, I very much care. As a requirements provider for the actual users, I also care and they do as well.

Your giant if-then conditional "works", but is not sustainable or maintainable. It is fragile and poor quality. Quality matters.

I once got to speak with a materials engineer who had the task of trying to discover why a drone aircraft (ostensibly made the same way as always) was suddenly failing very frequently. This was, essentially, a one-off product. They had one customer, and built the drone from off-the-shelf components. The system was driven by a basic two-stroke engine, it accomplished what was needed. This worked for years, until it didn't. It turned out that the maker of the engine (which included the drive shaft) had changed their source (from the US to another country, but that change itself is unimportant). What was important was that while it was the same (weight, power, fuel consumption, etc.) engine, the manufacturing of the steel components was different. They had different qualities and the new one had a tendency to fracture due to the low quality steel (this took quite a bit of analysis to identify since the aircraft were, well, crashing and breaking apart).

This quality (the quality of the steel) was not in the customer specs. They didn't think about it, it "just worked". Until it did matter, the aircraft were failing at higher rates than anticipated (driving up costs and losing out on the utility of the aircraft). The drone manufacturer was also risking losing this contract, which was quite lucrative to them, since the MTBF for their product was now below their promised thresholds.

If you don't pay attention to these qualities, you'll end up like them. You'll have a "working" product that suddenly fails and drives you out of business, or otherwise diminishes you. Or, if you're the engineer or programmer, you'll give your customers a poor quality product that doesn't actually work for them, it only seems to. Until it doesn't, because you gave them a fragile piece of shit.

Don't be the problem.


At then end of the day, a great many people, firms, and governments are finding that they care about the increasingly fragile set of design, engineering, and control kludges Boeing have had to strap on to the 737 airframe in order to 1) accommodate the initial low-clearance landing-gear design (intended to facilitate cargo handling), conflicting with 2) greater demands for efficiency through 3) ever larger ducted-fan engines 4) mounted ever further forward, and higher, on the wing resulting in 5) AoA control issues under high-throttle conditions answered by 6) a pilot control defeat countermeasure which has resulted in multiple crashes and the loss of over 300 souls.

The customer doesn't care about the implications of design decisions, until they do. Clean, simple, stable, predictable, maintainable, modifiable designs deliver quality performance over a longer period of time. Complex, kludgy, unstable, unpredictable, tightly-coupled, unmaintainable designs will eventually bite you in the ass, or scatter your body parts over the landscape.

The fact that the implications aren't clearly discernable in advance does not mean that they do not matter.


At the end of the day, it's a lot less likely to work if you write a giant if condition. So yes, the customer won't care why it works or doesn't - but quality code has impacts they can feel.


My experience has also been it's a not-entirely-Zen experience extending giant if conditions even if they technically work fine for the current use case.


I feel every chapter from this book can be pulled out and can be converted into a blogpost in its own right.

This blogpost touches only on a chapter of the book.

Nevertheless, nice, short read.


I'll add to this that I recommend just reading the book as well instead of waiting for blog posts! :D

It's a good book - well worth your time, in my opinion.


It's my favourite part of the book and really resonated with me at the time.


Are you talking about “zen and the art...”, or are you talking about a book by the author of the blog post?


The Pirsig book, I'm sure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: