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
What's new in Go 1.27?
ciarana
0
300
AI画像認識を活用したゲーム内決済処理検証の自動化
gree_tech
PRO
0
260
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
12
85k
Sets in Go
ramalho
1
1.2k
巨大気象データと戦う ― サロゲートモデル学習を高速化する圧縮技術
gpuunite_official
0
250
SmartHR Engineering Team Deck
smarthr
1
3.5k
MIXIで活躍できるエンジニアを 若手社員目線で考えてみる
mixi_engineers
PRO
0
130
AI時代に、人は何を、どう学ぶのか #pbl_pub / What and How Do We Learn in the AI Era?
takaking22
1
240
2027年のMetricKit
kantacky
0
160
Invisible to AI? Making TYPO3 Sites Quotable by AI Search Systems
wolfgangwagner
0
240
MulticaとPi Coding Agentで、小規模OSSを30本同時運用した流れ
eiei114
0
140
AIにブラウザを触らせて、E2EテストをPlaywrightで書く
koji_kawamura
0
370
Featured
See All Featured
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
300
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.4k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
Accessibility Awareness
sabderemane
1
180
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
4 Signs Your Business is Dying
shpigford
187
23k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
390
The SEO identity crisis: Don't let AI make you average
varn
0
530
The Curious Case for Waylosing
cassininazir
1
480
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
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 ͝ਗ਼ௌ͋Γ͕ͱ͏ޚ࠲͍·ͨ͠