3 ms·
I wonder if it would have been easier (in terms of complexity, not in hours spend coding) to rebuild the project in Go (in 100% idiomatic Go) and port it to Jav
by arendtio 8y ago
I wonder if it would have been easier (in terms of complexity, not in hours spend coding) to rebuild the project in Go (in 100% idiomatic Go) and port it to Java afterward. Sounds weird but since Go has such a strong focus on simplicity and Java probably implements most things Go uses, a port from Go to Java is probably a lot easier.
- kjksf 8y agoIt's true that if those code bases were evolving together, it would be possible to make them more in sync by sticking closer to what Go provides. But RavenDB is 10 years old. Java client already exists and has 50 thousands lines of code. If I was trying to rewrite that from scratch, I'm afraid Joel Spolsky would find me and spank me.
- grey-area 8y agoDid you at any point dream of writing a translation tool which would port java to go automatically? (crazy idea I know)
- kjksf 8y agoYes I did and I don't think it's crazy. I'm not sure a tool could do 100% translation but I'm sure it could do a lot. A surprisingly large amount of time was just moving the order of variable declaration from Java's "type name" to Go's "name type" and renaming, say, "String" to "string". If a tool did that for me, it would save a ton of time. Unfortunately, the upfront time investment to learn enough to write even the simplest translator would probably be greater than time saved on one project.
- gdy 8y agoAnd also rewrite other client libraries to keep them in sync with the new Java/Go code.