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
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
17
PHPをGoで動かす
chiroruxx
0
69
Goを使ってTDDを体験しよう!
chiroruxx
1
770
今ならできる!PhpStormプラグイン開発
chiroruxx
0
68
Go Connectへの想い
chiroruxx
0
190
eBPF with PHPをさわる
chiroruxx
0
150
sl完全に理解したつもり
chiroruxx
0
140
命名をリントする
chiroruxx
1
940
良い命名かを調べるリンターを作った + α
chiroruxx
0
140
Other Decks in Technology
See All in Technology
Introduction to Sansan for Engineers / エンジニア向け会社紹介
sansan33
PRO
5
61k
Models vs Bounded Contexts for Domain Modularizati...
ewolff
0
160
投資戦略を量産せよ 2 - マケデコセミナー(2025/12/26)
gamella
1
640
Introduction to Sansan Meishi Maker Development Engineer
sansan33
PRO
0
330
AIと融ける人間の冒険
pujisi
0
120
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
CQRS/ESになぜアクターモデルが必要なのか
j5ik2o
0
940
BidiAgent と Nova 2 Sonic から考える音声 AI について
yama3133
2
150
Everything As Code
yosuke_ai
0
510
【Agentforce Hackathon Tokyo 2025 発表資料】みらいシフト:あなた働き方を、みらいへシフト。
kuratani
0
120
Node vs Deno vs Bun 〜推しランタイムを見つけよう〜
kamekyame
1
440
re:Invent2025 セッションレポ ~Spec-driven development with Kiro~
nrinetcom
PRO
2
170
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
Scaling GitHub
holman
464
140k
Optimizing for Happiness
mojombo
379
70k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.5k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Believing is Seeing
oripsolob
1
29
The Mindset for Success: Future Career Progression
greggifford
PRO
0
210
Darren the Foodie - Storyboard
khoart
PRO
2
2.1k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.5k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
550
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
9.8k
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の設定
まとめ
まとめ 良かった! 多値返却・タプル代入 ゼロ値 遅延関数呼び出し
思ったよりも・・・ 型 フォーマット