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
PHPエンジニアによるScalaエンジニアへの転身とその手引き
Search
Shingo Harada
November 11, 2018
Technology
830
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPエンジニアによるScalaエンジニアへの転身とその手引き
Shingo Harada
November 11, 2018
Other Decks in Technology
See All in Technology
5分でわかるDuckDB Quack
chanyou0311
4
310
そのタスクオンスケですか?
poropinai1966
0
130
最近評価が難しくなった
maroon8021
0
210
Kotlin 開発のツラミを爆破した話! / Explode the difficulty of Kotlin dev!
eller86
0
140
どうして今サーバーサイドKotlinを選択したのか
nealle
0
190
5分でわかる Amazon Connect_20260608
hwangbyeonghun
0
180
AWS Blocks を触ってみた/first-tach-aws-blocks
fossamagna
2
140
Hatena Engineer Seminar 37 jj1uzh
jj1uzh
0
420
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
250
プライバシー保護の理論と実践
lycorptech_jp
PRO
1
240
事業価値を⽣み出すSREへ SREが担うべき意思決定の5層
kenta_hi
0
150
スタートアップにおけるアジャイルの実践について #shibuyagile
murabayashi
3
2k
Featured
See All Featured
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
290
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
Designing for Performance
lara
611
70k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
11k
The Limits of Empathy - UXLibs8
cassininazir
1
390
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
1.2k
エンジニアに許された特別な時間の終わり
watany
107
250k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
210
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
380
Into the Great Unknown - MozCon
thekraken
41
2.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.8k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Transcript
ݪాਅޗ 1)1ΤϯδχΞʹΑΔ4DBMBΤϯδ χΞͷసͱͦͷखҾ͖ 4DBMBؔ4VNNJU
2017/11/11 © ChatWork All rights reserved. 2 ࣗݾհ ‣ $IBU8PSLגࣜձࣾαʔόʔαΠυ։ൃ෦
‣ ೖࣾ ݱࡏͰஸ͙Β͍ ‣ 1)1ΤϯδχΞͱͯ͠ೖࣾ ‣ ࠷ۙ4DBMBϓϩμΫτʹKPJO 4DBMBྺϲ݄͙Β͍ɺ +BWBະܦݧ
2017/11/11 © ChatWork All rights reserved. 3 $IBU8PSLʹ͍ͭͯ ‣ ϏδωενϟοταʔϏε
‣ λεΫཧɾϏσΦ௨ ‣ ಋೖاۀ ࣾҎ্
2017/11/11 © ChatWork All rights reserved. 4 5PQJDT ‣ $IBU8PSLͰͷ4DBMBͷऔΓΈ
‣ 4DBMBϓϩμΫτͷࢀՃɻֶशͷ͖᪴ͱղܾํ๏ ‣ 4DBMBΤϯδχΞʹసͯ͠Έͨ݁Ռ
2017/11/11 © ChatWork All rights reserved. 5 $IBU8PSLͱ4DBMBͷؔɾ։ൃܦҢ
2017/11/11 © ChatWork All rights reserved. 6 1)1։ൃ͔Β4DBMB։ൃ ‣ ࠒ͔Β1)1͚ͩͰͳ͘4DBMBϓϩμΫτ։ൃ
‣ 4DBMBϓϩμΫτͷ૿Ճ ‣ 0"VUI ‣ 8FCIPPL ‣ #PY࿈ܞ ‣ *'555࿈ܞ
2017/11/11 © ChatWork All rights reserved. 7 $IBU8PSLͱ4DBMBͷؔ ‣ $IBU8PSLͷ4DBMB࠾༻ϓϩμΫτl'BMDPOzϦϦʔε·Ͱͷࣦഊͱ
ޭͷྺ࢙ 4DBMB.BUTVSJ w IUUQTTQFBLFSEFDLDPNKJLPIJTUPSZPGGBMDPOUIFXBZUPQSPEVDUJPOSFMFBTF ‣ $IBU8PSLͷ৽ϝοηʔδϯάγεςϜΛࢧ͑Δٕज़ "84%FW %BZ5PLZP w IUUQTTQFBLFSEFDLDPNKJLPDIBUXPSLGBMTFYJONFUVTF[JOHVTJTVUFNVXP[IJ FSVKJTIV ‣ 4DBMBBOE"LLBBQQTPO,VCFSOFUFTJO$IBU8PSL 4DBMBؔ 4VNNJU w IUUQTTQFBLFSEFDLDPNIBZBTTIJTDBMBBOEBLLBBQQTPOLVCFSOFUFTJO DIBUXPSL
2017/11/11 © ChatWork All rights reserved. 8 4DBMBϓϩμΫτͷࢀՃ ֶशͷ͖᪴ͱղܾ๏
2017/11/11 © ChatWork All rights reserved. 9 4DBMBϓϩδΣΫτͰΘΕ͍ͯͨࣝ ͱֶशঢ়گ ‣
ΘΕ͍ͯͨϥΠϒϥϦͱݴޠͷဃ w TDBMB[ "LLB LBNPO DJSDF FUDʜ ‣ ࠓ·Ͱܦݧͨ͠ϓϩάϥϛϯάݴޠ w 1)1ɺ1ZUIPOɺ$ʜ
2017/11/11 © ChatWork All rights reserved. 10 1)1ˠ4DBMBֶशͷ݁Ռ
2017/11/11 © ChatWork All rights reserved. 11 *'555࿈ܞΛ4DBMBͰ։ൃˍϦϦʔε ‣ ༻ͯ͠ΔϥΠϒϥϦ
w "LLB)UUQ w "LLB4USFBN w TDBMB[ w DJSDF w FUD
2017/11/11 © ChatWork All rights reserved. 12 *'555࿈ܞ ެࣜυΩϡϝϯτ IUUQTQMBUGPSNJGUUUDPNEPDT
2017/11/11 © ChatWork All rights reserved. 13 4DBMBϓϩμΫτʹࢀՃ
2017/11/11 © ChatWork All rights reserved. 14 େ͖ͳน ϓϩμΫτίʔυͱࣝͷဃ def
create(implicit scheduler: Scheduler): Flow[CreateUserAccountRequest, CreateUserAccountResponse, NotUsed] = Flow[CreateUserAccountRequest].mapAsync(1) { userAccount => (for { id <- userIdGenerator.generateId() result <- userRepository.store( UserAccount( id, Status.Active, EmailAddress(userAccount.emailAddress), HashedPassword(userAccount.password), userAccount.firstName, userAccount.lastName, Clock.now, None ) ) } yield CreateUserAccountResponse(id.value)).runAsync }
2017/11/11 © ChatWork All rights reserved. 15 େ͖ͳน ϓϩμΫτίʔυͱࣝͷဃ def
create(implicit scheduler: Scheduler): Flow[CreateUserAccountRequest, CreateUserAccountResponse, NotUsed] = Flow[CreateUserAccountRequest].mapAsync(1) { userAccount => (for { id <- userIdGenerator.generateId() result <- userRepository.store( UserAccount( id, Status.Active, EmailAddress(userAccount.emailAddress), HashedPassword(userAccount.password), userAccount.firstName, userAccount.lastName, Clock.now, None ) ) } yield CreateUserAccountResponse(id.value)).runAsync }
2017/11/11 © ChatWork All rights reserved. 16 ͳͥ͘͠ײͨ͡ͷ͔ ‣ 4DBMB͓Αͼؔܕݴޠʹ׳Ε͍ͯͳ͍
w লུه๏ɺߴ֊ؔɺ҉ͷύϥϝʔλɺΧϦʔԽɺFUDʜ ‣ +BWBपΓͷࣝ ‣ ετϦʔϛϯάɺฒߦॲཧʹؔ͢Δࣝ
2017/11/11 © ChatWork All rights reserved. 17 1)1ͱ4DBMBͷൺֱ 1)1 4DBMB
ܕ͚ ಈత ੩త ϓϩάϥϜύϥμΠϜ खଓ͖ܕ ΦϒδΣΫτࢦ ؔܕ ΦϒδΣΫτࢦ ӨڹΛड͚ͨݴޠ 1FSM $ +BWB IUUQTKBXJLJQFEJBPSHXJLJϓϩάϥϛϯάݴޠͷൺֱ
2017/11/11 © ChatWork All rights reserved. 18 ྫ ؔͷهड़ελΠϧ͕ෳ͋Δ //
ܕΞϊςʔγϣϯΛ͏ val toInt: (String => Int) = (s: String) => s.toInt // ܕΞϊςʔγϣϯΛলུ((Ҿ) => ຊମ) val toInt2 = (s: String) => s.toInt // ϓϨʔεϗϧμʔΛ༻ͨ͠ܗ val toInt3: (String => Int) = _.toInt w FY TUSJOHΛҾʹͱͬͯɺJOUʹมߋ͢Δؔͷهड़ελΠϧʹͯ͠ύλʔϯ͋ΔΑ͏ ʹࢥ͑ͨ w 1)1ͷ߹ w 4DBMBͷ߹ $toInt = function(string $s) {return (int)$s;}; ‣ ࢀߟ w IUUQTHJTUHJUIVCDPNHBLV[[[[ w IUUQTRJJUBDPNOFTIFFQJUFNTBFDFFGEG
2017/11/11 © ChatWork All rights reserved. 19 ྫ ؔܕ ‣
FY UP·ͰͷͰۮͷͷ͚ͩ حআ͘ Λഒͯ͠ɺ ͦͷ૯ΛٻΊΔ w 1)1ͷ߹ // ᶃarray_**ܥͷؔΛͬͨ߹ $result = array_sum( array_map( function ($i) { return $i * 10; }, array_filter(range(1, 10), function ($i) { return ($i % 2 === 0); }) ) ); // ᶄ݁ہ͜͏ͳΓͦ͏ $result = 0; foreach (range(1, 10) as $int) { if ($int % 2 === 0) { $result += $int * 10; } }
2017/11/11 © ChatWork All rights reserved. 20 ྫ ؔܕ def
stringMatching(matcher: (String) => Boolean) = matcher("sample text") def stringStart(query: String) = stringMatching(_.startsWith(query)) // ҎԼͱಉٛ // strMatching((str: String) => str.startsWith(query)) def stringContain(query: String) = stringMatching(_.contains(query)) ‣ 4DBMBͷ߹ ϫϯϥΠφʔͰهड़Մೳ ‣ ଞͷྫɿ4USJOHΛҾʹͱΓɺCPPMFBOΛฦؔ͢Λ͢ (1 to 10).withFilter(_ % 2 == 0).map(_ * 10).sum
2017/11/11 © ChatWork All rights reserved. 21 +BWBपΓͷࣝ ‣ OVMMͷߟྀ
w /VMM1PJOUFS&YDFQUJPO͕ൃੜͯ͠͠·͏ w SFUVSOWBMVFPSOVMMͷ+BWBϝιουΛݺͼग़࣌͢ʹ0QUJPOBQQMZͰғͬͯ͋ ͛Δ ‣ +BWBϥΠϒϥϦɺύοέʔδͷཧղ w MPHCBDLɺKBWBYDSZQUP w εϨουϓʔϧͷׂ ‣ FUDʜ akka { dispatcher { type = Dispatcher executor = "thread-pool-executor" thread-pool-executor { fixed-pool-size = 32 } throughput = 1 } }
2017/11/11 © ChatWork All rights reserved. 22 ղܾํ๏ ‣ ஈ֊తʹֶΜͰ͍͘
Ұʹଟ͘ͷ͜ͱΛֶͳ͍ ‣ ݱঢ়ࠔͱͳΔཁҼΛׂͯ͠ ̍ͭͣͭ ֶͿ w ؔܕݴޠ w "LLBTUSFBN w +BWBͷࣝ w FUDʜ
2017/11/11 © ChatWork All rights reserved. 23 ॻ੶ɾXFC ڭࡐͰֶश ‣
ݴޠ༷ɺؔܕετϦʔϜͷ֓೦ͳͲΛॏతʹֶश ‣ XFC্Ͱͷใ w 4DBMBશൠ w IUUQTEXBOHPHJUIVCJPTDBMB@UFYU w IUUQTHJUIVCDPNIBUFOB)BUFOB5FYUCPPLCMPCNBTUFS GPVOEBUJPOPGQSPHSBNNJOHTDBMBNE w "LLB4USFBN w IUUQTUIJOLJUDPKQBSUJDMF
2017/11/11 © ChatWork All rights reserved. 24 4DBMB ࣾڭࡐͷ׆༻ ‣
ԋश՝Ͱ࣮ࡍʹखΛಈֶ͔ͭͭ͠श
2017/11/11 © ChatWork All rights reserved. 25 ࣾͷϦιʔεΛ׆༻͢Δ ‣ ༗ࣝऀʹώΞϦϯάˍϖΞϓϩ
‣ 4DBMBઐ༻νϟοτ 4DBMB෦ ͷ׆༻
2017/11/11 © ChatWork All rights reserved. 26 श࡞ͰຒΊΔ ‣ ΑΓ࣮ફతͳ༰ͰϓϩμΫτίʔυͱͷࠩΛঃʑʹຒΊΔ
‣ श࡞ ՝ͷ࣮ࢪ w 4DBMB ࣾڭࡐ w FY 1MBZ'SBNFXPSLͷԋश՝ w "LLB (SBQI4UBHFΛ༻ͯ͠ϑΝΠϧˠ%#ͷ؆୯ͳॲཧ w SBNMQBSTFSͷ࡞ w FUD ‣ ϥΠϒϥϦ࡞ˍΞϓϦέʔγϣϯ։ൃ
2017/11/11 © ChatWork All rights reserved. 27 ஈ֊Λ౿ΜͰՌͷϦϦʔε ՌϦϦʔε श࡞՝
4DBMB ݴޠֶश ϓϩμΫτࢀՃ ࣌ܥྻ
2017/11/11 © ChatWork All rights reserved. 28 4DBMB։ൃͷײ ‣ ੩తܕɺؔܕͷԸܙ
w 1)1ͰػೳՃʹΑΔςετ֬ೝ࡞ۀ͕େม Өڹൣғ͕ݟ͑ʹ͍͘ w ϞσϦϯάɺϦϑΝΫλ͍͢͠ ‣ ֶश͕ਐΉʹͭΕརศੑΛ࣮ײ w հग़དྷͳ͔͚ͬͨͲ NBUDIDBTF 'VUVSFɺ&JUIFSɺ0QUJPOɺFUDʜ ‣ +BWBͷ๛ͳࢿ࢈Λ׆༻Ͱ͖Δ
2017/11/11 © ChatWork All rights reserved. 29 ·ͱΊ ‣ 4DBMBΛֶश͔Βೖͬͯ։ൃग़དྷΔڥ͕͋Δ
‣ ΩϟονΞοϓɺग़དྷΔڥ͕͋Δ ‣ ʮֶशʯˠʮश࡞ʯˠʮϓϩμΫτʯͱ͍ͬͨΑ͏ʹஈ֊Λ౿Ή͜ ͱ͕Ͱ͖ͨ ‣ ࣭͕୲อ͞Εอकɾӡ༻͕͘͢͠ͳΔ ‣ ৽ͨͳߟ͑ΛऔΓೖΕΒΕΔ ‣ ੩తɺؔܕɺඇಉظɺฒߦϓϩάϥϛϯάɺFUDʜ
2017/11/11 © ChatWork All rights reserved. 30 ҰॹʹνϟοτϫʔΫΛྑ͍͖ͯͨ͘͠ ͍ΤϯδχΞͷํΛืूʂ IUUQTDPSQDIBUXPSLDPNKBSFDSVJUFOHJOFFS
2017/11/11 © ChatWork All rights reserved. 31 ͝ਗ਼ௌ͋Γ͕ͱ͏ޚ࠲͍·ͨ͠