DEV Community

Discussion on: Go project layout

Collapse
 
royal_bhati profile image
Royal Bhati

I know it looks a lot and I get your point but what bad it'll do if you take some time out to think about the layout before writing the code.

Collapse
 
andrewpillar profile image
Andrew Pillar

but what bad it'll do if you take some time out to think about the layout before writing the code.

You risk putting your code in places where it might not belong, and this makes refactoring your code harder. Write the obvious code first, and refactor from there. And again, you want to avoid making too many assumptions about what your program could do, as this diverts your attention away from what the program will do. You figure out what your program will do by writing it.

Thread Thread
 
royal_bhati profile image
Royal Bhati • Edited

putting your code in places where it might not belong

Not if you know what your layout is and what you are trying to achieve.

avoid making too many assumptions

again, if you know what you are doing than making assumptions is not bad