Mr Feynman on cyclotrones

A quote from “Surely, you’re joking mr Feynman!”

MIT had built a new cyclotron while I was a student there, and it was just beautiful! The cyclotron itself was in one room, with the controls in another room. It was beautifully engineered. (…) It was what I would call a gold-plated cyclotron.

Now I had read a lot of papers on cyclotron experiments, and there weren’t many from MIT. Maybe they were just starting. But there were many from places like Cornwell, Barkley, and above all, Princeton. (…) PRINCETON CYCLOTRON. That must be something!

So first thing Monday, I go into the physics building and ask, ‘Where is the cyclotron, which building?’

‘It’s downstairs in the basement, at the end of the hall.’

In the basement? It was an old building. There was no room in the basement for cyclotron. (…) and in ten seconds I learned why Princeton was right for me - the best place for me to go to school. In this room there were wires strung all over the place! Switches were hanging from the wires, cooling water was dripping from the valves, the room was full of stuff, all out in the open. Tables piled with tools were everywhere; it was the most godawful mess you ever saw. (…)

I suddenly realized why Princeton was getting results. They were working with the instrument. They built the instrument, they knew where everything was, they knew how everything worked, there was no engineer involved, except maybe he was working there too. It was much smaller than the cyclotron at MIT, and ‘gold-plated’? - it was the exact opposite. When they wanted to fix a vacuum, they’d drip glyptal on it, so there were drops of glyptal on the floor. It was wonderful! (…)

When I got to Cornell (…) it was world’s smallest cyclotron., but they had got fantastic results. They had all kinds of special techniques and tricks. If they wanted to change something in the D’s - the D-shaped half-circles that the particles go around - they’d take a screwdriver, and remove the D’s by hand, fix them and put them back. At Princeton it was a lot harder and at MIT, you had to take a crane that came rolling across the ceiling, lower the hooks, it was a hellllll of a job!

My point

MIT built a beautiful thing, you can’t look at it and not be amazed. There are two sources of this beauty. It’s big and impressive (bigger and more impressive than it needs to be). It looks neat and organized (hiding all the complexity).

Many times in the past I looked at some OOP code and I was impressed, it looked pretty! It was neat, it did something complicated and yet everything was neatly organized and I felt like it’s easy to understand but really it was just a gold-plated cyclotron. When you try to fix something you have no clue where to go, what might be involved. When you try to understand the thing, you have to jump back and forth between files, classes, functions, trying to keep it all in your head. And the bad news is: unless it’s fizzbuzz - you can’t. And some OOP nuts would just jump out at this point “Oh, it’s not well designed then!”. Their solution? More files, more classes, throw another pattern into the mix!

Have you ever seen the state pattern? I have seen it, I thought it’s cool, I even implemented it once or twice. Then I realised it’s a switch statement but stretched over multiple files, with hidden state and unclear behaviour on construction/destruction. How is that a “best-practice”?

I learned to ignore all OOP advice I got in the past, it’s hard to unlearn those things but it’s good. Now when something breaks, I can take my screwdriver, fix the thing and keep going.