Hacker News new | past | comments | ask | show | jobs | submit login

Author states: "I was contracted to port a large Java code base to Go". That makes me think his focus is on earning the money, rather than questioning the motives of his client :)



The fact that he tried to port a lot of the Java code directly to Go, where Go had no suitable comparable feature. With generics, he mentions there are two different approaches in Go, but then only mention the one he calls the least preferred one, i.e. using interface{}.

But he never talks about motivation of the original code. Like why it was generic in Java. Sometimes generic code in other languages can be ported to Go to two or three functions, because the general use of the generic code wasn't as generic as the designer may have envisioned, or it just became a nail to their hammer.

Like was the inheritance really important, or could it be implemented another way in Go?

But I guess if you're not questioning your client's motives, you may not be fully questioning how something ought to work, and instead just ensure it works as it does right now.

It's possible they just needed a Go-library for their client code, and then the client code can be tweaked later on to be more idiomatic Go.


If I was writing this code from scratch, I would make a few different decisions.

That being said, from a business point of few, making Go code base be as close as possible to Java version makes a lot of sense.

Java client is written the way it is. It already shipped and is used by people. Breaking its API was out of the question.

RavenDB is 10 years old and will most likely be here for the next 10 years.

In those future years, both Java client and Go client will have to be evolved to provide access to new capabilities of the server.

The closer the two code bases are, the less effort it takes to maintain those code bases.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: