Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Well, it might be that I was doing something wrong, but in the end I didn't have circular dependencies anymore, so I was doing right again? (just kidding) ;-)

So in fact, I don't like to have circular dependencies in Go either and try to avoid them, so I agree with you on that. But at the same time I like very small and simple packages and sometimes you have to choose:

1. do you build a larger package with everything inside

2. do you build multiple smaller packages with dependencies on each other

As I said, in general, I favor the smaller packages and that can lead to circular dependencies, if you are not using interfaces properly.



Ok, you have a point.

But I still think that you have multiple packages and each one is calling all the other ones, then it doesn't make much sense to have multiple packages at all.

I prefer smaller packages too, but currently I'm trying to avoid overmodularizing, specially when a package is too connected to some others and is not going to be used elsewhere.




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

Search: