DEV Community

Discussion on: Pitch me on Go

 
dominikbraun profile image
DB

In other languages, say, Java, you'd create a file Order.java for your Order class. There's no such convention in Go. You can create a file called order.go containing an Order type, but other types, constants and functions may also be in that file. Go simply doesn't have any restrictions regarding the code structure, and that allows for the best-fitting solution for your use case on the one side but also many possibilities each with their own pros and cons on the other side.

Thread Thread
 
codewander profile image
codewander

Thanks.

I was more curious about why the leadership is opinionated about error handling, but isn't as opinionated about module conventions.

I understand that in both functional and procedure languages, there is a much larger degree of freedom in how you group together items inside of modules. I haven't done a lot of c programming, but I assume it has very well established patterns for organizing modules by now.