Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Goでのチーム開発に途中参画した私が納得して実装を進めるためにやったこと ~ 命名編 ~
Search
m_t_tion1
June 09, 2024
Programming
680
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Goでのチーム開発に途中参画した私が納得して実装を進めるためにやったこと ~ 命名編 ~
オンボーディング時に抱いた疑問から、Goの思想を再度振り返った上でチーム内で改めてコーディングルールのすり合わせを行った結果の一例の紹介です。
m_t_tion1
June 09, 2024
More Decks by m_t_tion1
See All by m_t_tion1
私達はmodernize packageに夢を見るか feat. go/analysis, go/ast / Go Conference 2025
kaorumuta
2
1.8k
初めてOSSを作って公開した話
kaorumuta
0
770
Other Decks in Programming
See All in Programming
Getting Started with Vibe Coding
miccheng
0
190
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
1.2k
Apple Intelligenceとオンデバイス時代の到来
yahir0
0
230
小さなアプリを作って公開するまで
onozaty
0
140
Coding with AI: How to trust the storyteller (AWS Community Day Adria, Ljubljana 2026)
slobodan
0
140
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
360
Spec-driven Development with AI
simas
PRO
0
2.3k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.6k
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
110
조합이폭발하는디자인시스템이걸눈으로도테스트하라고요
giljongyu
0
730
Enforcing Your Architecture with Unit Tests in the AI Era (Swift Connection X)
steliosf
PRO
1
150
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
540
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
620
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.9k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Chasing Engaging Ingredients in Design
codingconduct
0
390
GitHub's CSS Performance
jonrohan
1033
470k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.7k
Transcript
GoͰͷνʔϜ։ൃʹ్தࢀըͨ͠ࢲ͕ ೲಘ࣮ͯ͠ΛਐΊΔͨΊʹͬͨ͜ͱ ~ ໋໊ฤ ~ 2024/06/07@(Unofficial) Go Conference 2024 Pre
Party
ࣗݾհ 2 Kaoru Muta ໂా ܆ (ϝϯτε) ੜ·ΕҭͪେࡕͰࠓେࡕʹ͍·͢ 20242݄ʹגࣜձࣾBuySell Technologies
join. ങऔج൫/๚ങऔʹಛԽͨ͠αʔϏεͷ৽ن։ൃʹैࣄ ങऔɾࠪఆ ങऔछผʹԠͨ͡࠷దͳγεςϜߏங Visit -๚ങऔ- Store -ళฮങऔ- ങऔ ϦϢʔεϓϥοτϑΥʔϜCosmos ࣗࣾ։ൃͷϦϢʔεಛԽۀجװγεςϜͰ͋ΓαʔϏε܈ͷू߹ମ @m_t_tion1
ຊൃදͷཁͱϞνϕʔγϣϯ 3 ʮڷ (=Go)ʹೖΒڷʹै͑ʯΛνʔϜͰୡ͢ΔͨΊʹ ίʔσΟϯάʹؔ͢Δҙࢥ౷ҰΛνʔϜͰߦͬͨΒɺ ίʔυʹҰ؏ੑ͕ग़ͨ & ϨϏϡʔίετͱΈϙΠϯτ͕গͳ͘ ͳͬͨ ཁ
Ϟνϕ ҎԼͷΛօʹฉ͍ͯΧδϡΞϧʹσΟεΧογϣϯ͍ͨ͠ • ൃදͰऔΓ্͛Δࣄʹࣅͨૺ۰ͨ͜͠ͱ͕͋Δ͔ ◦ ૺ۰ͨ͠߹ɺͲ͏ରॲ͔ͨ͠ ◦ ͠ͳ͔ͬͨ߹ɺެࣜͷϧʔϧʹै͏ͷΈͰ ेͩͬͨͷ͔
ΦϯϘʔσΟϯά࣌ͷܦݧ 4 • ࠓ·ͰJavaϝΠϯͰॻ͍͍ͯͨΤϯδχΞ • GoͰ࡞͍ͬͯΔ0 → 1ͷ৽ن։ൃͷ్தͰJOIN • طଘίʔυΛ֬ೝ͠ΩϟονΞοϓ
ঢ়گ ײ • Goදݱੑ͕͘ɺॻ͖ํͷΒ͖ͭগͳ͍ͣ (গͳ͘ͱJavaΑΓ) ͔͠͠ɺҎԼͷͰΒ͖͕ͭɾɾ ◦ ม໊ͷলུͷํ ◦ ϙΠϯλͷ͍ॴ...etc ίʔυϨϏϡʔͷίετ૿Ճ, ॻ͖ํʹ໎͍͕ੜ͡ΔՄೳੑ
ΦϯϘʔσΟϯά࣌ͷܦݧ 5 • ࠓ·ͰJavaϝΠϯͰॻ͍͍ͯͨΤϯδχΞ • GoͰ࡞͍ͬͯΔ0 → 1ͷ৽ن։ൃͷ్தͰJOIN • طଘίʔυΛ֬ೝ͠ΩϟονΞοϓ
ঢ়گ ײ • Goදݱੑ͕͘ɺॻ͖ํͷΒ͖ͭগͳ͍ͣ (গͳ͘ͱJavaΑΓ) ͔͠͠ɺҎԼͷͰΒ͖͕ͭɾɾ ◦ ม໊ͷলུͷํ ◦ ϙΠϯλͷ͍ॴ...etc ίʔυϨϏϡʔͷίετ૿Ճ, ॻ͖ํʹ໎͍͕ੜ͡ΔՄೳੑ ຊൃදͷτϐοΫ
6 Έͳ͞Μಉ͡Α͏ͳײΛ ࣋ͬͨ͜ͱ͋Γ·͔͢ʁ
7 ࣌ͷࢲͷ߹
8 GoͷࢥΛΔͨΊʹ Ұ୴ެࣜdocͱؔ࿈ࢿྉΛړΖ͏
9 Effective GoͱGo styleguideͰͷߟ͑ํ ~ʮաෆͳ͍ʯ໋໊ʹ͍ͭͯ ~
Effective Go - #names • ͳ໋໊ආ͚Δ͖ 10 ref: https://go.dev/doc/effective_go#names Good
:+1: Bad :-1:
Go styleguide - #variable-names • ʮաෆͳ͍ʯ (= Clarity / Concision)
໋໊Λ͖͢ ◦ ม͕ࢀর͞ΕΔൣғ (= Scope)ʹԠͯ͡ҟͳΔ ◦ লུ͍ͯ͠είʔϓͰมͷׂ͕ࣗ໌ͳΒOK ◦ লུͨ͠มΛ͍είʔϓͰ͍ճ͢ͱՄಡੑ͕མͪΔͨΊNG 11 *ߦݫ֨ͳͷͰͳ͘ɺGo styleguideهࡌͷࢀߟͰհ͞Ε͍ͯΔࣈ ref: https://google.github.io/styleguide/go/decisions#variable-names ͍είʔϓͷྫ (*1~7ߦ) ͍είʔϓͷྫ (*25ߦ~)
ݸਓͷݟղ • େલఏͱͯ͠GoެࣜͰఏএ͍ͯ͠Δࢥʹै͏ • ݸਓ͓ΑͼνʔϜͰʮաෆͳ໋໊͍ʯͱΛࡲΓ߹Θͤͨํ͕ ࣮ऀɾϨϏϡϫʔͱʹͤʹͳΕΔͷͰʁ ◦ ͍είʔϓ ▪ Ұ࣌తͳม
▪ ؔͷ໊લฦΓ͔ΒΒ͏͕ࣗ໌ͳ߹ ◦ ͍είʔϓ ▪ ೝෛՙ্͕͕Γͦ͏ͳ߹লུ͠ͳ͍ ▪ (ͦͦ͗͢Δείʔϓϝιουͱͯ͠ͷׂΛ ݕ౼͢Δ߹͋Δ) 12
13 νʔϜͰࡲΓ߹ΘͤΔ
νʔϜͰͷ߹ҙܗ • ฐνʔϜͰͷʮաෆͳ͍ʯͬͯʁ ◦ جຊলུ͠ͳ͍ํͰɺܕείʔϓ͔Βࣗ໌ͩͱஅͨ͠Βলུ͢Δ ◦ Defined Type͏߹มͷׂ͕ࣗ໌Ͱ͋ΔͨΊলུͯ͠Α͍ (ল໊ུͨ͠લҰ؏ͯ͠͏͜ͱ) ▪
ex. salesContractID → scID bailmentReceiptID → brID ◦ ҆ͱͯ͠লུ࠷େ2୯ޠ·Ͱ ex. salesContractDocumentDetail → scdd ͱ͔ආ͚͍ͨ 14
ӡ༻ޙͷνʔϜ֎͔ΒͷϑΟʔυόοΫ 15 • νʔϜͰվΊͯGoͷࢥΛ৮ΕֶͯͿ͜ͱ͕Ͱ͖ͨ • ίʔυʹҰ؏ੑ͕ग़࣮ͯΛ͢Δ্Ͱ໎͍͕ͳ͘ͳͬͨ • (͜͜ݸਓͷײͰ͕͢) ίʔυϨϏϡʔͰGoͷࢥʹؔ࿈ ͢Δ໋໊ʹؔͯ͠ࢦఠ͢Δ͜ͱݮͬͨ
Good More • ৽نࢀೖऀ͕͖ͨ࣌ʹಉ༷ͷ͕ٞੜ·ΕΔՄೳੑ͕͋Δ ͦͷͨΊఆظతʹݟ͢͜ͱ͕ඞཁ͔ ◦ ຖม͑Δͷӡ༻ίετ͕ߴͦ͏ ◦ Goͷࢥʹै͏ͷม͑ͳ͍͍ͯ͘ ◦ ʮաෆͳ͍ʯΛೝෛՙɾՄಡੑͷ؍Ͱ ఆظతʹ͢ͷΑͦ͞͏
ຊൃදͷཁͱϞνϕʔγϣϯ 16 ʮڷ (=Go)ʹೖΒڷʹै͑ʯΛνʔϜͰୡ͢ΔͨΊʹ ίʔσΟϯάʹؔ͢Δҙࢥ౷ҰΛνʔϜͰߦͬͨΒɺ ίʔυʹҰ؏ੑ͕ग़ͨ & ϨϏϡʔίετͱΈϙΠϯτ͕গͳ͘ ͳͬͨ ཁ
Ϟνϕ ҎԼͷΛօʹฉ͍ͯΧδϡΞϧʹσΟεΧογϣϯ͍ͨ͠ • ൃදͰऔΓ্͛Δࣄʹࣅͨૺ۰ͨ͜͠ͱ͕͋Δ͔ ◦ ૺ۰ͨ͠߹ɺͲ͏ରॲ͔ͨ͠ ◦ ͠ͳ͔ͬͨ߹ɺެࣜͷϧʔϧʹै͏ͷΈͰ ेͩͬͨͷ͔
17 Έͳ͞ΜͲ͏ͯ͠·͔͢ʁ
Thank You!