Remix.run Logo
tharkun__ a day ago

1. also helps you after the first 3-6 months. As in, you can't change the entire code base (if reasonably large). Not even with AI helping you with the tedious bits. Consistency is something that does have value, even if it's not global and even if the consistent thing is not how you would've done/called it. The more consistency you can get, the better, because it helps tremendously. Both you and also an AI. If things are named consistently it doesn't matter whether you call a potato a potato or a potahto. It just matters that you don't call it an orange half the time.

We have a relatively good code base in this regard for example. To find things, I literally just hit the shortcut to open file/class by name, start typing the camel case for what I need and I'm usually there. Like, if I need to know what exactly we do for writing the potahto to the database, I type PoRep and I'll probably see the PotatoRepositoryImpl and I'm where I need to be. Of course not everything is roses. I might want to know what the service layer for the potahto does and start typing PotSer and I find nothing, because half the domain objects call the service layer a service and the other half calls it manager. That's OK. That's called "local consistency" and it happens as a code base grows and ages and different people with different opinions build in it and don't know enough about the magic of consistency and think they know better but can't or don't want to change the existing code base. As long as it doesn't get out of hand, it's not a big deal and you can slowly converge.

2. This is such a big one, thank you! Too many people don't believe in Chesterton's fence. They know so much better! Rewrite everything! And it is OK and good to question why the fence is there! Nothing is worse than "we do it this way because we've always done it that way!".

But also, if you never question the fence's existence, you're stuck forever. This is an anecdote I found very good in this regard.

    A group of scientists places five monkeys in a room with a ladder and a banana on top. When one monkey tries to reach the banana, all are sprayed with cold water. Eventually, all of them stop attempting to climb. The scientists then place a new monkey who knows nothing of the water incident. When the new monkey sees the banana and tries to climb, the others prevent them from reaching it. Nobody gets sprayed any longer. The scientists slowly replace any of the original monkeys that were actually sprayed with water with new ones. Eventually there are no monkeys left that experienced the spraying. Yet no monkey ever even tries to get the banana any more.
So, do challenge Chesterston's fence's existence! Try to find one of the monkeys that actually got sprayed with water, so that you may understand why the fence was there. Or in other words ask the other monkeys why the eff you can't go for the banana. And if nobody can tell you other than "coz we've never done it like that", then try it. For all you know, the pesky scientist with the hose is long gone!