GopherCon 2018: Kat Zien - How Do You Structure Your Go Apps
Ғылым және технология
How should I structure my Go code?” is probably one of the most commonly asked questions, by new and experienced programmers alike. There is almost always more than one answer and it can be tricky to decide what will work best.
Should I keep all my files under one directory or should I split them up? How should I divide my code and into what packages? Can I write object-oriented code in Go? Why do some projects have a cmd directory and what is the advantage of that?
In this tutorial session, Kat will aim to answer those questions and give you an overview of common design patterns and best practices to make your projects testable, maintainable and easy to understand.
Пікірлер: 57
0:00 Intro 7:00 Start of example projects 8:05 Flat structure 10:12 Layered architecture (group by function) 14:25 Group by modules 16:24 Group by context 26:54 Hexagonal architecture 36:09 Frameworks 38:05 Testing 38:38 Naming 40:23 Review
One of the best talk i've ever seen in my life. Very clear explanation, thank you!
Great talk, really helpful to understanding the different approaches. It really does depend on the use-case!
Excellent. We could use more talks on how to organise code in larger projects as most examples never get to the kind of complexity where architecture, interface design and import structure actually start to matter.
One of the best talks I've ever seen. Thank you!
Great talk! Thank you very much for putting this together. This is quite helpful to this "new gopher".
just put your code into packages with well defined purpose and context (no 'adding' package which shares both beer and review for some stupid reason). Have you seen any package in standard library that were grouped by 'adding' or 'listing' function? Why the hell I should even do that? Just code packages, don't try to do any fancy structure, it's all bullshit that based on no foundation at all.
Great Talk on Folder Structure! Really helped me. Go Go Golang!!!
Thank you for putting this talk together!
Getting started with GoLang and this is golden ! thanks much Kat !
Very useful talk! Which approach you use depends entirely on the size and condition of the project but I think that hexagonal architecture can be more better for me. Thank you for everything Kat😊
Great presentation. Thank you.
Great talk!
Excellent Talk! Thank you!!
great talk, thanks!
Links in the description would be awesome
@diegoalonso7374
4 жыл бұрын
@@dn5426 404
Amazing talk !
nice talk, thanks
thank you!
Excellent...
Great talk.
How to avoid the init()? Even in testing func, we have to init the server and db to test. How to avoid in this case?
Thanks a lot ...
awesome
thank. you.
This was really helpful for me, thanks! Also, it's always great to see another woman developer nailing it!
I'll stick with flat for a while!
👏👏👏
Good talk, but DDD is actually Domain Driven Design (not Development) and it was defined, coined and popularized by Eric Evans (not Vaughn Vernon).
@edwingarcia5043
2 жыл бұрын
See minute 16:28
Hexagonal hell. 13 folders to keep 17 files. 😅
Good talk, although one small correction DDD = Domain Driven Design (not development), it was proposed by Eric Evans. Using ports&adapters vs other clean designs and packaging-by-feature vs packaging-by-layered-feature is still a topic that brings controversies within teams, in a way my gut is that programmers embrace them while coders are scared of/confused by them.
This video is supported by beer reviewed research.
who has the girl's twitter? need more.
@arhuman13
5 жыл бұрын
@kasiazien (at the end of the talk)
The talk was OK. Extreme over complicated and messy project structures. The best thing with Go is that Go is simple, let's keep it simple! There is no point in structuring a Go project as a Java enterprise application or a .NET project. I keep the structure of my services as simple and flat as possible.
@lekkice6988
Жыл бұрын
i think she was pretty clear on "don't overcomplicate if you don't need to"
@shurazeta
4 ай бұрын
Even in the book: learning-go-an-idiomatic-approach makes a reference to this video. She knows what she said.
The moment she couldn’t open the terminal I stopped!!
She can’t open a terminal in vscode wow
Useful talk. But please, PLEASE stop with those absurd GIFs. They are very distracting and unprofessional.
@vncealdcab
5 жыл бұрын
lighten up
@Nagashitw
4 жыл бұрын
live a little, dude.
@HanifCarroll
4 жыл бұрын
imo the only thing wrong with GIFs is if they stay on the screen for too long while talking, like here. In that case, yeah, they're pretty distracting. But nothing wrong if you're only gonna keep em up for a few loops.
@me5ng3
2 жыл бұрын
@@HanifCarroll Why do it in the first place? It looks unprofessional and is of no value.
I think she didn't help true beginners because she wanted to sound smart.
@dn5426
5 жыл бұрын
?
@randydiaz7664
5 жыл бұрын
She talks about the different styles of file structures, but not how one would run/build those different structures, such as go run *.go etc
@katzien2682
5 жыл бұрын
@@randydiaz7664 Hey Randy, thanks for your feedback. In all honesty, "how you run go apps" is a separate topic and slightly outside of the scope of this talk which was focused on the structure (and strictly limited to 45 mins). I do have a more beginner friendly talk where I talk about running go apps, the GOPATH and so on which I gave at Scotland PHP earlier this year, and I'd post a link to it but the videos are not up yet. Either way, you comment made me laugh as sounding smart is definitely not why I give talks. Far from it, most of my talks is me sharing what I found so far as a beginner with other people, be it performance optimisation or DDD :)
@BrunoidGames
2 жыл бұрын
Hello real world
Great talk!
awesome