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
命名をリントする
Search
chiroruxx
December 15, 2024
Programming
1.1k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
命名をリントする
2024/12/15 Kyoto.go #56 で発表した資料です。
chiroruxx
December 15, 2024
More Decks by chiroruxx
See All by chiroruxx
Contextとはなにか
chiroruxx
1
460
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
150
Laravelのパッケージ全部紹介する
chiroruxx
2
160
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
56
PHPをGoで動かす
chiroruxx
0
110
Goを使ってTDDを体験しよう!
chiroruxx
1
1.4k
今ならできる!PhpStormプラグイン開発
chiroruxx
0
130
Go Connectへの想い
chiroruxx
0
250
eBPF with PHPをさわる
chiroruxx
0
210
Other Decks in Programming
See All in Programming
Heart of Swift Concurrency
koher
0
1k
アクセシビリティから考える情報設計
high_g_engineer
0
420
thread_parallel_with_free-threaded_Python_and_NumPy.pdf
riku_sakamoto
0
360
モデルのリファクタリングが難しいと思ったら、そもそも複雑だったのはビジネス仕様だった ? / is-the-business-domain-the-real-complexity
hatsu38
0
420
選挙速報を多くのユーザーへ 届ける Live Activities 設計
hamayokokuririn
0
180
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
150
半永久的に提供し続けられるプライベートクラウドを目指して ― 利用者の認知負荷を抑えるAPI抽象化とハードウェア世代交代の基盤設計
tomokon
0
150
AWS DevOps Agentで インシデント対応をAIに任せたい
honmarkhunt
7
3.3k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
890
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
350
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
320
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
Featured
See All Featured
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
340
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
330
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
270
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Music & Morning Musume
bryan
48
7.4k
Designing for Performance
lara
611
70k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.7k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
310
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
440
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.1k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
390
Transcript
命名をリントする 2024/12/15 Kyoto.go #56
自己紹介 ちひろ 株式会社モリサワ X: @chiroruxxxx
1年をカンファレンスに 例えるなら
年末のLTは
懇親会LTのような ものですよね!?!?
ということで 明日からすぐに役に立たない! 身にならない話をします!
本題
命名をリントする 2024/12/15 Kyoto.go #56
良い命名とは 観点は色々とある 時間をかけ、一生懸命考えた命名は良い命名かもしれない 人生の中で、一番命名を気にしているタイミングがどこだろ う
良い命名とは 子どもの名付け
子どもの 名付け 子どもの名づけも、色々な観点がある 言葉の意味 子どもがどうなってほしいか よびやすさ・語感
周りから浮かないか 画数
画数占い 赤ちゃん命名ガイド
つまり
良い命名とは 良い画数の命名 かもしれない?
命名と画数 画数の良い命名を変数にすれば その変数が起因のバグが起こらない かもしれない?
われわれは 画数をチェックする 必要がある! ということでつくりました
作ったよ https://github.com/chiroruxx/lucky-lint-go go vet で動くよ 以下の命名に対応
変数・定数の宣言・代入 型 フィールド名 関数名 パッケージのエイリアス名
ドメイン部分 「ローマ字の姓名判断・商品名画数」を参考に https://meimeimaker.com/articles/strokes-alphabet.php
ドメイン部分 「ローマ字の姓名判断・商品名画数」を参考に https://meimeimaker.com/articles/strokes-alphabet.php
こんなかんじ
まとめ 良い画数の名前を選ぼう! CIでリンターをまわしてチェックすれば安全だね!
その他細かい話 時間があれば
予約語 予約語の命名は開発者がどうにもできないので除外 変数名の _ (アンダーバー) 関数名の
main init ドットインポート
慣用的な名前 変数名の ok, err メソッドのレシーバ名 1文字にすることが多いが、1文字はたいてい良い画数ではない
見るべき ノード asciicheck では、ast.Ident のみを対象としている ast.Ident を対象とすると、自分の定義していない命名も 見てしまう
例えば Printf は ast.Ident だが、開発者が定義してない 細かく見ていく必要がある