Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
元phperから見たGoの良いところ
Search
chiroruxx
April 12, 2024
Technology
0
110
元phperから見たGoの良いところ
2024/04/11 Go Connect #0 で発表した資料です。
chiroruxx
April 12, 2024
Tweet
Share
More Decks by chiroruxx
See All by chiroruxx
Laravelのパッケージ全部紹介する
chiroruxx
1
34
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
18
PHPをGoで動かす
chiroruxx
0
70
Goを使ってTDDを体験しよう!
chiroruxx
1
800
今ならできる!PhpStormプラグイン開発
chiroruxx
0
70
Go Connectへの想い
chiroruxx
0
200
eBPF with PHPをさわる
chiroruxx
0
150
sl完全に理解したつもり
chiroruxx
0
140
命名をリントする
chiroruxx
1
950
Other Decks in Technology
See All in Technology
JuliaTokaiとしてはこれが最後かもしれない(仮) for NGK2026S
antimon2
0
130
Tebiki Engineering Team Deck
tebiki
0
23k
人はいかにして 確率的な挙動を 受け入れていくのか
vaaaaanquish
4
2.8k
AWS監視を「もっと楽する」ために
uechishingo
0
430
BPaaSオペレーション・kubell社内 n8n活用による効率化検証事例紹介
kentarofujii
0
310
BiDiってなんだ?
tomorrowkey
2
490
一番人に近いコードレビューア CodeRabbit
kinopeee
0
110
Security Hub と出会ってから 1年半が過ぎました
rch850
0
190
Regional_NAT_Gatewayについて_basicとの違い_試した内容スケールアウト_インについて_IPv6_dual_networkでの使い分けなど.pdf
cloudevcode
1
160
ゼロから始めたFindy初のモバイルアプリ開発
grandbig
2
350
Vitest Highlights in Angular
rainerhahnekamp
0
100
AI時代にあわせたQA組織戦略
masamiyajiri
6
2.7k
Featured
See All Featured
The Illustrated Children's Guide to Kubernetes
chrisshort
51
51k
For a Future-Friendly Web
brad_frost
181
10k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
32
2.8k
Docker and Python
trallard
47
3.7k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.1k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
170
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
7.9k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
110
Transcript
元phperから見た Goの良いところ 2024/04/11 Go Connect #0
自己紹介 ちひろ X: @chiroruxxxx 株式会社モリサワ 1年前に転職して
phperからgopherに
Goの良い ところ Goいいな!と思ったポイントを3つほど紹介したいと思います 思ったよりもあんまり・・・というところも紹介します
余談: 八方美人
いいな! と思ったポイント
多値返却・タプル代入
多値返却 タプル代入 Goの根幹を支える機能 多値を返したいことは多い PHPでは配列(マップ)で無理やり多値を返すコードも・・・ 乱用注意
ゼロ値
ゼロ値 便利すぎる nilチェック、デフォ値の設定など メインロジックと離れたコードを削れる Cmp.Or()でより価値が高まるか たまにバグのもとになる
遅延関数呼び出し
遅延関数 呼び出し defer が便利 関数切り出しのタイミングにもなる
思ったよりも・・・ なポイント
型
型 型による恩恵はさほど変わらず 現在のPHPは型のディストピア 少しでも緩い型を書くと静的解析に怒られる Goはジェネリクス・ユニオン・インターセクション型が限定的
今後に期待!
フォーマット
フォーマット 標準のフォーマッタがある(gofmt) プロジェクト横断で同じフォーマットでコードを読める!? ・・・という夢があった プロジェクトごとに違うgolangci-lintの設定
まとめ
まとめ 良かった! 多値返却・タプル代入 ゼロ値 遅延関数呼び出し
思ったよりも・・・ 型 フォーマット