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
120
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
元phperから見たGoの良いところ
2024/04/11 Go Connect #0 で発表した資料です。
chiroruxx
April 12, 2024
More Decks by chiroruxx
See All by chiroruxx
初心者エンジニアから中級者エンジニアになるためにオススメの1冊
chiroruxx
0
120
Laravelのパッケージ全部紹介する
chiroruxx
2
130
Gopher のための「自由な話し合い」ワークショップ
chiroruxx
0
41
PHPをGoで動かす
chiroruxx
0
95
Goを使ってTDDを体験しよう!
chiroruxx
1
1.1k
今ならできる!PhpStormプラグイン開発
chiroruxx
0
100
Go Connectへの想い
chiroruxx
0
210
eBPF with PHPをさわる
chiroruxx
0
180
sl完全に理解したつもり
chiroruxx
0
170
Other Decks in Technology
See All in Technology
タクシーアプリ『GO』の実践的データ活用
mot_techtalk
3
170
Terraformモジュールは、なぜ「魔境」化するのか
hayama17
2
220
AIにフローを作らせようとして挫折した話
hamatsutaichi
0
220
Oracle AI Database@Azure:サービス概要のご紹介
oracle4engineer
PRO
6
1.9k
Agentic Web
dynamis
1
180
Dario Amodi『Policy on the AI Exponential』を理解する
nagatsu
0
200
Databricks における 生成AIガバナンスの実践
taka_aki
1
350
DevOps Agentで始めるAWS運用 〜フロンティアエージェントが変える運用の現場〜
nyankotaro
1
310
個人の発見を、組織の知恵に 〜生成AI活用を"探索"から"組織の仕組み"へ〜
kintotechdev
3
1.1k
ルールやカスタム機能、どう使う?理想の出力を引き出すために今知りたいIBM Bob 5つの機能
muehara
1
360
Mastering Ruby Box
tagomoris
3
150
会社紹介資料 / Sansan Company Profile
sansan33
PRO
18
420k
Featured
See All Featured
Joys of Absence: A Defence of Solitary Play
codingconduct
1
390
Color Theory Basics | Prateek | Gurzu
gurzu
0
360
KATA
mclloyd
PRO
35
15k
So, you think you're a good person
axbom
PRO
2
2.1k
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
530
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
Writing Fast Ruby
sferik
630
63k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Technical Leadership for Architectural Decision Making
baasie
3
400
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
55k
Designing for Performance
lara
611
70k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
330
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の設定
まとめ
まとめ 良かった! 多値返却・タプル代入 ゼロ値 遅延関数呼び出し
思ったよりも・・・ 型 フォーマット