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

  • @DaMMwhale
    @DaMMwhale5 жыл бұрын

    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

  • @rezamonang
    @rezamonang3 жыл бұрын

    One of the best talk i've ever seen in my life. Very clear explanation, thank you!

  • @MariaShodunke
    @MariaShodunke5 жыл бұрын

    Great talk, really helpful to understanding the different approaches. It really does depend on the use-case!

  • @CorNigrum
    @CorNigrum3 жыл бұрын

    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.

  • @andreyshcherbinin6946
    @andreyshcherbinin69464 жыл бұрын

    One of the best talks I've ever seen. Thank you!

  • @DixonWh2
    @DixonWh22 жыл бұрын

    Great talk! Thank you very much for putting this together. This is quite helpful to this "new gopher".

  • @rw_panic0_0
    @rw_panic0_06 ай бұрын

    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.

  • @umaralli6535
    @umaralli65355 жыл бұрын

    Great Talk on Folder Structure! Really helped me. Go Go Golang!!!

  • @bwarren2
    @bwarren23 жыл бұрын

    Thank you for putting this talk together!

  • @sombhattacharyya
    @sombhattacharyya3 жыл бұрын

    Getting started with GoLang and this is golden ! thanks much Kat !

  • @ceylancelalettin
    @ceylancelalettin11 ай бұрын

    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😊

  • @a4e69636b
    @a4e69636b Жыл бұрын

    Great presentation. Thank you.

  • @Thoer
    @Thoer5 жыл бұрын

    Great talk!

  • @selmison
    @selmison4 жыл бұрын

    Excellent Talk! Thank you!!

  • @MrGreen-kq4ds
    @MrGreen-kq4ds4 жыл бұрын

    great talk, thanks!

  • @agustibau3107
    @agustibau31075 жыл бұрын

    Links in the description would be awesome

  • @diegoalonso7374

    @diegoalonso7374

    4 жыл бұрын

    @@dn5426 404

  • @culturadocaractere
    @culturadocaractere Жыл бұрын

    Amazing talk !

  • @zverbeta
    @zverbeta5 жыл бұрын

    nice talk, thanks

  • @user-hq3dj6ix8g
    @user-hq3dj6ix8g4 жыл бұрын

    thank you!

  • @kmchary1181
    @kmchary1181 Жыл бұрын

    Excellent...

  • @nawafb6280
    @nawafb62808 ай бұрын

    Great talk.

  • @davidlee588
    @davidlee588 Жыл бұрын

    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?

  • @1testrad
    @1testrad2 жыл бұрын

    Thanks a lot ...

  • @mehrdaddolatkhah4201
    @mehrdaddolatkhah42013 жыл бұрын

    awesome

  • @maximiliankhan
    @maximiliankhan2 жыл бұрын

    thank. you.

  • @lua121
    @lua1215 жыл бұрын

    This was really helpful for me, thanks! Also, it's always great to see another woman developer nailing it!

  • @ryanleemartin7758
    @ryanleemartin77583 жыл бұрын

    I'll stick with flat for a while!

  • @jimbo0o
    @jimbo0o3 ай бұрын

    👏👏👏

  • @amirchip
    @amirchip3 жыл бұрын

    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

    @edwingarcia5043

    2 жыл бұрын

    See minute 16:28

  • @coraxster
    @coraxster6 ай бұрын

    Hexagonal hell. 13 folders to keep 17 files. 😅

  • @halconnegro665
    @halconnegro66511 ай бұрын

    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.

  • @nexovec
    @nexovec5 ай бұрын

    This video is supported by beer reviewed research.

  • @xuwang1292
    @xuwang12925 жыл бұрын

    who has the girl's twitter? need more.

  • @arhuman13

    @arhuman13

    5 жыл бұрын

    @kasiazien (at the end of the talk)

  • @JazzMachine77
    @JazzMachine77 Жыл бұрын

    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

    @lekkice6988

    Жыл бұрын

    i think she was pretty clear on "don't overcomplicate if you don't need to"

  • @shurazeta

    @shurazeta

    4 ай бұрын

    Even in the book: learning-go-an-idiomatic-approach makes a reference to this video. She knows what she said.

  • @snehil32
    @snehil322 жыл бұрын

    The moment she couldn’t open the terminal I stopped!!

  • @ashishgupta8394
    @ashishgupta83942 жыл бұрын

    She can’t open a terminal in vscode wow

  • @florenckaf
    @florenckaf5 жыл бұрын

    Useful talk. But please, PLEASE stop with those absurd GIFs. They are very distracting and unprofessional.

  • @vncealdcab

    @vncealdcab

    5 жыл бұрын

    lighten up

  • @Nagashitw

    @Nagashitw

    4 жыл бұрын

    live a little, dude.

  • @HanifCarroll

    @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

    @me5ng3

    2 жыл бұрын

    @@HanifCarroll Why do it in the first place? It looks unprofessional and is of no value.

  • @randydiaz7664
    @randydiaz76645 жыл бұрын

    I think she didn't help true beginners because she wanted to sound smart.

  • @dn5426

    @dn5426

    5 жыл бұрын

    ?

  • @randydiaz7664

    @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

    @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

    @BrunoidGames

    2 жыл бұрын

    Hello real world

  • @israzulka
    @israzulka5 жыл бұрын

    Great talk!

  • @mehrdaddolatkhah4201
    @mehrdaddolatkhah42013 жыл бұрын

    awesome

Келесі