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
ぼくがPerlで開発を行う時に工夫していること
Search
ybrliiu
April 16, 2018
Programming
580
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ぼくがPerlで開発を行う時に工夫していること
Gotanda.pm #17
ybrliiu
April 16, 2018
More Decks by ybrliiu
See All by ybrliiu
これまでと、これからのPerlコミュニティ
ybrliiu
0
180
AstroNvim を使おう!
ybrliiu
0
5.4k
Perlでも関数の型をチェックしたい
ybrliiu
0
3.8k
Perl5.32の新機能
ybrliiu
0
200
Vue.jsで作ったサイトをバニラJSで書き直す悲しいお話
ybrliiu
1
1.2k
Perlにおける動的なモジュールロードのメリットとデメリット
ybrliiu
0
920
黒魔術で独自定義のenum型制約を満たす値のリ ストを取得する話
ybrliiu
0
460
Perlにおけるクラスの実装パターン.pdf
ybrliiu
0
1.8k
Presentation.pdf
ybrliiu
0
300
Other Decks in Programming
See All in Programming
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
140
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
260
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
140
メールのエイリアス機能を履き違えない
isshinfunada
0
220
壊れたパーサから始める関数型設計と構成的なパーサ #fp_matsuri
raiga0310
2
450
琵琶湖の水は止められてもNet--HTTPのリトライは止められない / You might be able to stop the water flow of Lake Biwa but you can't stop Net::HTTP retries
luccafort
PRO
0
590
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
240
AI時代に設計が 最大の生産性レバーになる 意図駆動開発とデータを消さない設計|Don't Delete Your Data or Your Intent — Design as the Deepest Lever in the AI Era
tomohisa
1
710
komatsuna「分散システムにおけるバグ分析手法」
komatsunaqa
0
240
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
540
React本体のコードリーディング
high_g_engineer
1
140
プロポーザルを書いてもらう
pvcresin
0
280
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.2k
ラッコキーワード サービス紹介資料
rakko
1
4.3M
Claude Code のすすめ
schroneko
67
230k
BBQ
matthewcrist
89
10k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.9k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
280
How to build a perfect <img>
jonoalderson
1
5.9k
Deep Space Network (abreviated)
tonyrice
0
250
How to Think Like a Performance Engineer
csswizardry
28
2.7k
Transcript
ぼくがPerlで開発を行うときに工 夫していること by liiu Gotanda.pm #17 1 / 12
自己紹介 liiu / @_ybrliiu MobileFactory 18新卒 (希少な)Perl使いです プログラミング / 歴史
/ (F|T)PS 学生時代にCGIゲーム運営してたりしていました 2 / 12
アジェンダ 僕が個人でPerlを使うときに工夫していることをいくつか お話します 引数の受け取り方 未定義値の扱い方 よく使うプラグマなどを一度に有効にする 3 / 12
引数の受け取り方 できるだけサブルーチンの最初の行で引数を明示 する shiftはなるべく使わない sub hoge { my ($foo, $bar,
$baz) = @_; ... } sub method { my ($self, $arg1) = shift; } 4 / 12
signatures使いたい experimental早く外れてほしい sub hoge($foo, $bar, $baz = 'default string') {
... } 5 / 12
未定義値の取り扱い 未定義値を返す可能性のある関数やメソッドには maybe_ 未定義値を持つ可能性のある変数にもmaybe_と いう接頭辞を必ずつけるようにしています MooseのMaybe型も活用 6 / 12
こんなのも作ってました https://github.com/ybrliiu/p5-Scalish 7 / 12
使用例 use Scalish qw( option ); subtest 'match' => sub
{ my $option = option 'something'; my $ret = $option->match( Some => sub { 200 }, None => sub { 404 }, ); is $ret, 200; my $none = option undef; my $ret2 = $none->match( Some => sub { 200 }, None => sub { 404 }, ); is $ret2, 404; }; 8 / 12
よく使うプラグマなどを一気に有 効にする package NewApp::Exporter { use strict; use warnings; use
utf8; use feature qw( :5.26 signatures ); sub import { $_->import for qw( strict warnings utf8 ); feature->import(qw[ :5.26 signatures ]); warnings->unimport('experimental::signatures'); } } 9 / 12
使用例 use Moose; use Mojo::Base; と同じようなことをしてい ます package NewApp::Service::DoSomething {
# enable strict, warnings, utf8, feature(':5.26'), and signatures # disenable warnings 'experimental::signatures'; use NewApp::Exporter; sub do_something($self) { ... } } 10 / 12
メリット たくさん記述したりスニペット登録の必要がな いので楽 DRY べんり!!! デメリット 初めて見る人にはぱっと見て何をしているか わからない 11 /
12
12 / 12