So I took a break from my effort to port Lucene. Late one night I couldn’t figure out how to port logic from Java to Rust. I decided to sleep on it. A few years passed and now I am looking at my code with fresh eyes.
Rather than just pick up where I left off I asked myself what went wrong? Turns out I made a mistake that kills many software projects. I didn’t spend enough time starting the project correctly. The rush to code resulted in spending less time on project setup. I selected a Rust project scaffolding and tried to force a Java project into it. As result one project had to resolve too many problems which resulted in my getting stuck.
Every project needs ADRs
Architecture Decision Records (ADR) allow a team to document why something was done a certain way. Yet more importantly it forces teams to thoroughly explore and agree on decisions. Yes even as a one person team I need to come to the understanding this is the right decision. In this case, I would have discovered that the current project setup was inappropriate. This would have happened while addressing the “Consequences” section of the ADR.
Choosing the right Priorities
I recently read “Decisive” by Chip and Dan Heath. It highlighted the importance of having the right priorities to help resolve conflicts. For instance I wanted the port to have the same features as Lucene. I figured I can reuse Lucene’s unit tests to verify to guarantee that. Well… Lucene is a java library. So I was trying to make Rust behave like Java with JNI in the middle which made life difficult. I was putting a priority on supporting Lucene’s unit tests when it wasn’t always appropriate.
Know the usage
Often when porting code I recall the parable of the blind men and an elephant. I end up spending a good amount of time very focused on a specific part without understanding the big picture. For instance I found myself stuck trying to figure out how to achieve Lucene’s inheritance in a non-object oriented language. I really should have asked how is this part used? If it is used in only one place then inheritance doesn’t matter. I can just combine them.