Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Carbonを使って時間を操作する
Search
松本竜也
July 23, 2023
28
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Carbonを使って時間を操作する
松本竜也
July 23, 2023
Featured
See All Featured
The Art of Programming - Codeland 2020
erikaheidi
57
14k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
540
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
500
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.7k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.5k
Context Engineering - Making Every Token Count
addyosmani
9
1.2k
Transcript
Carbonを使って時 間を操作する 松本 竜也
目次 ・自己紹介 ・Carbonについて ・Carbonの罠 ・まとめ
自己紹介 ・名前: 松本 竜也 ・職業: バックエンドエンジニア ・好きなこと: ポーカー ・最近気になっている技術:kotlin
Carbonとは
None
こんなケース(有効期限の設定) • 現在の日付と現在の日付から一週間後の日付をDBに保存したい
トラップ Carbonの罠発動!!!
None
ミュータブルとイミュータブル ❖ ミュータブル オブジェクトが作成された後も状態を変えることが出来る ❖ イミュータブル 一度作られたら、状態は変えられない
None
Carbonのミュータブルを使うメリットは 無いのでは??
ミュータブルは悪ではない
None
まとめ • 不変の日付オブジェクトを使用すると、明示的に再割り当てしない限り、 日付を渡しても元のオブジェクトに突然変異が発生しないという確信を得ることが出 来る • 可変の日付オブジェクトが悪ではない