My big beef with refactoring

Опубликовано: 21 Июль 2026
на канале: Eric Normand
542
27

►► Audio, Video, and Transcript available: https://lispcast.com/my-big-beef-with...

►► Subscribe on iTunes: https://itunes.apple.com/us/podcast/t...

I love refactoring. It’s therapeutic. It helps productivity. But refactoring is not enough to write good software. We can’t just write it so it works then clean it up. In this episode, I explain why.

Transcript

Is refactoring enough? Can we simply write our software so that it works and then clean it up, later?

My name is Eric Normand. These are my thoughts on #FunctionalProgramming.

Well, the short answer is no. We can't do that. Actually, I gave a talk about this a couple of years ago. Here is my attempt at explaining why refactoring, though it is an important idea, is not enough. We can't just rely on being able to clean stuff up later.

For thousands of years, Aristotle and his physics, was deemed the best explanation of physics that we had. Many philosophers spent their careers trying to reconcile all the problems with it.

It's just taken as gospel, I guess you could say, as given that Aristotle was right and then there are all these exceptions that didn't really fit in what he was saying.

What did Aristotle say? Aristotelian physics is a mishmash of different explanations for how things work and what's the natural order of things. One of the things that Aristotle put in his physics was an idea of Ideal Place.

Ideal Place basically says that light things float up and heavy things go down. This is why you find rocks sinking to the bottom of the ocean. There's water on top of the rocks and the dirt and then there's air on top of the water. Air, its ideal place is on top of water.

You can see that this explains quite a lot if you just pick on as why rocks roll downhill. Everything has an ideal place. You can see it does explain quite a bit if you just want a basic explanation that would satisfy someone who's not too curious.

You could just make a list, you could just rank order all things from heaviest to lightest and you would have a decent explanation of where you would expect to find stuff. The reason stuff moves, like rocks roll downhill, is because they're seeking out their ideal place.

Some things like animals can move of their own accord. When they move of their own accord, it's smooth and natural motion. That's what's called natural motion. It's motion that comes out of the thing itself.

Sometimes you get knocked around, you get hit by a cart or a bull strikes you, your limbs are flying, you've tripped, you fall over and you flipped over. That is called unnatural motion, when you get jostled by something.

There is ideal speed. Ideal speed is the notion that heavy things move slower than light things. You can take a small rock and throw it very far and very fast, you try to throw a heavy rock and it does not go as fast.

You can see it's kind of a mishmash. There's no relationship between any of the concepts, except maybe heaviness, how heavy something is, the weight of something; but it's really not a unifying theory.

Along comes Newton. I'm going to totally simplify this story. I'm not trying to do justice and I'm not going to be able to do justice to all the people who came between Aristotle and Newton. I'm just going to use them as tokens of this human accomplishment that we have as a civilization.

Newton came along and created a different system of physics and that system has three laws, Newton's laws of motion as what we tend to call them. They relate a few key concepts. Those concepts are mass, distance, time and force.

With those concepts and the relationships between them, you have F=ma, that's the relationship between force, mass and acceleration. Acceleration is a relationship between velocity and time. Velocity is a relationship between distance and time. You see how everything is related to these very basic concepts in there. That's F=ma.

You have equal and opposite reactions. It states that forces come in pairs. It talks about the direction of the forces, that their magnitudes are equal but their directions are opposite.

The third one that unless an object is acted on by a force, it's not going to change its course. If the sum of the forces equals zero, then the velocity is unchanged. ∆v is 0. #Functionallanguage #Clojure