GopherCon 2018: Kat Zien - How Do You Structure Your Go Apps

Поделиться
HTML-код
  • Опубликовано: 3 июн 2024
  • 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
    @DaMMwhale 5 лет назад +119

    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
    @rezamonang 3 года назад +4

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

  • @CorNigrum
    @CorNigrum 3 года назад +23

    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.

  • @MariaShodunke
    @MariaShodunke 5 лет назад +6

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

  • @umaralli6535
    @umaralli6535 5 лет назад +7

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

  • @DixonWh2
    @DixonWh2 2 года назад +4

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

  • @bwarren2
    @bwarren2 3 года назад +1

    Thank you for putting this talk together!

  • @sombhattacharyya
    @sombhattacharyya 3 года назад +1

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

  • @andreyshcherbinin6946
    @andreyshcherbinin6946 4 года назад +8

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

  • @ceylancelalettin
    @ceylancelalettin 11 месяцев назад +1

    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😊

  • @Thoer
    @Thoer 5 лет назад +3

    Great talk!

  • @selmison
    @selmison 4 года назад +1

    Excellent Talk! Thank you!!

  • @a4e69636b
    @a4e69636b Год назад

    Great presentation. Thank you.

  • @rw_panic0_0
    @rw_panic0_0 5 месяцев назад +4

    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.

  • @MrGreen-kq4ds
    @MrGreen-kq4ds 4 года назад +1

    great talk, thanks!

  • @user-hq3dj6ix8g
    @user-hq3dj6ix8g 4 года назад

    thank you!

  • @culturadocaractere
    @culturadocaractere Год назад

    Amazing talk !

  • @zverbeta
    @zverbeta 5 лет назад +1

    nice talk, thanks

  • @kmchary1181
    @kmchary1181 Год назад

    Excellent...

  • @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?

  • @nawafb6280
    @nawafb6280 8 месяцев назад

    Great talk.

  • @1testrad
    @1testrad 2 года назад

    Thanks a lot ...

  • @agustibau3107
    @agustibau3107 5 лет назад +11

    Links in the description would be awesome

  • @mehrdaddolatkhah4201
    @mehrdaddolatkhah4201 3 года назад

    awesome

  • @maximiliankhan
    @maximiliankhan 2 года назад

    thank. you.

  • @lua121
    @lua121 5 лет назад +10

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

  • @ryanleemartin7758
    @ryanleemartin7758 3 года назад +1

    I'll stick with flat for a while!

  • @amirchip
    @amirchip 3 года назад +15

    Good talk, but DDD is actually Domain Driven Design (not Development) and it was defined, coined and popularized by Eric Evans (not Vaughn Vernon).

  • @jimbo0o
    @jimbo0o 2 месяца назад

    👏👏👏

  • @halconnegro665
    @halconnegro665 11 месяцев назад +1

    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.

  • @coraxster
    @coraxster 6 месяцев назад

    Hexagonal hell. 13 folders to keep 17 files. 😅

  • @nexovec
    @nexovec 5 месяцев назад

    This video is supported by beer reviewed research.

  • @xuwang1292
    @xuwang1292 5 лет назад

    who has the girl's twitter? need more.

    • @arhuman13
      @arhuman13 5 лет назад +2

      @kasiazien (at the end of the talk)

  • @JazzMachine77
    @JazzMachine77 Год назад +3

    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 Год назад +2

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

    • @shurazeta
      @shurazeta 4 месяца назад +1

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

  • @florenckaf
    @florenckaf 5 лет назад +16

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

    • @vncealdcab
      @vncealdcab 5 лет назад +41

      lighten up

    • @Nagashitw
      @Nagashitw 4 года назад +4

      live a little, dude.

    • @HanifCarroll
      @HanifCarroll 4 года назад +3

      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 года назад +2

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

  • @ashishgupta8394
    @ashishgupta8394 2 года назад +1

    She can’t open a terminal in vscode wow

  • @snehil32
    @snehil32 2 года назад

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

  • @randydiaz7664
    @randydiaz7664 5 лет назад +2

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

    • @dn5426
      @dn5426 5 лет назад +10

      ?

    • @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 лет назад +48

      @@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
    @israzulka 5 лет назад +1

    Great talk!

  • @mehrdaddolatkhah4201
    @mehrdaddolatkhah4201 3 года назад

    awesome