PHP 25 years, since PHP 4.x Laravel 11 years, since Laravel 4.x I LOVE... My Wife / Typesafe / Agile / Momoiro Clover Z Formula One / Mario Kart / ACE COMBAT Series shogogg shogogg
gap between engineers and non-engineers. 技術的負債という言葉の解像度を上げ、エンジニア同士だけでなく非エンジニアとも 語れるようになる • Providing practical tips for engaging with technical debt. 技術的負債との付き合い方のヒントを持って帰ってもらう
The creator of WikiWikiWeb WikiWikiWeb の開発者 • One of the 17 original signatories of the Agile Manifesto アジャイルソフトウェア開発宣言に署名した17 人の1人 • The father of the "Technical Debt" metaphor 技術的負債という概念の生みの親 Ward Cunningham
that we were doing on the WyCash product. … The explanation I gave to my boss, and this was financial software, was a financial analogy I called "the debt metaphor". ” from: Ward Explains Debt Metaphor Photo: Carrigg Photography, CC BY-SA 3.0, via Wikimedia Commons
if we failed to make our program align with what we then understood to be the proper way to think about our financial objects, then we were gonna continually stumble over that disagreement and that would slow us down which was like paying interest on a loan. ” Photo: Carrigg Photography, CC BY-SA 3.0, via Wikimedia Commons
old code look like a nightmare. スキルの向上やドメイン知識の習得などによって、昔に書いたコードが陳腐化 Today's 'best practice' can become tomorrow's 'mistake'. 実装当時はベストだと思った判断も、後から振り返ると失敗、というのは日常茶飯事 Old code is referenced, copied, and starts to multiply if left alone. そういうコードを放置すると、それが参考にされたり、コピーされ、増殖していく I based this code on the patterns found in the current codebase. 既存のコードベースを参考に実装しました!(キリッ
function Member($name) { $this->_name = $name; } function getName() { return $this->_name; } } No property visibility, use "_" prefixes for internal. プロパティに可視性がなく、"_" で始まる名前は内部用、という慣習
function Member($name) { $this->_name = $name; } function getName() { return $this->_name; } } There was no Constructor Property Promotion. もちろん Constructor Property Promotion なんてなかった
Removed in PHP 7.0) • mysql functions(Deprecated in PHP 5.5, Removed in PHP 7.0) • mcrypt extension(Deprecated in PHP 7.1, Removed in PHP 7.2) • Dynamic Property(Deprecated in PHP 8.2, but still available) • Implicit Nullable Parameters(Deprecated in PHP 8.4, but still available)
/ コードは腐る Time turns valid code into technical debt and broken dependencies. 実装当時は問題なかったコードでも、時代の流れと共に陳腐化したり、動かなくなることがある Growth and scale shifts / 規模の変化 Increased traffic uncovers legacy DB & performance issues. ユーザー数やアクセスの増加に伴い、データベース設計やパフォーマンス面での問題が顕在化 Changes in the production environment / 運用環境の変化 Modernization — including adding redundancy, cloud migration and containerization — can break code that once worked perfectly. クラウド移行や冗長化・コンテナ化などによって、問題なく動いていたコードが使えなくなる
essential features out-of-the-box, allowing developers to focus on business logic. フレームワークには開発に必要な機能が揃っており、開発者はビジネスロジックの実装に集中できる Popular frameworks attract top talent Popular frameworks ensure a large pool of skilled developers. 人気のフレームワークなら人材確保の面でも有利に働く AI-Friendly Coding Standards help AI provide more accurate outputs. 豊富なドキュメントや参考コードがあることで、AI の生成精度向上が期待できる
structure • Strict PSR-4 compliance • Standardization with Contracts(PSR-compliant Interfaces) • Filters replaced by Middlewares • Brand new FormRequest • The Death of Form::open() • And much, much more...
Extension- does not work with Codeception 5+. Symfony 2.0 A wave of breaking changes that marked the end of the Symfony 1 era. Vue 3 Lost backward compatibility, causing a fragmentation in the ecosystem. Angular 2.0 A complete rewrite from AngularJS that alienated the existing community. Python 3 A decade-long transition that split the community.
must follow its evolution. It requires constant effort and resources. 導入は始まりに過ぎず、リソースを投入して継続的なアップデート作業が必要 Potential for Disruptive Breaking Changes We must face breaking changes, EOL risks, and the unpredictable future of the ecosystem. 破壊的変更や開発終了のリスクもあるし、人気がいつまで続くかもわからない Risks of Niche Tech and Key Person Dependency Losing a lead expert can turn niche libraries into unmaintainable black boxes overnight. ニッチな技術やライブラリは、第一人者の離職によって一気に負債化する場合も
suboptimal code. デリバリーを優先するあまり、設計や実装に時間を割けず、不完全なコードが生まれる Human nature naturally gravitates toward the path of least resistance. 意志が強くても、疲労やプレッシャーの中で無意識に「楽な道」へ流されてしまう Compromised code is referenced, copied, and starts to multiply. そういうコードを放置すると、それが参考にされたり、コピーされ、増殖していく I based this code on the patterns found in the current codebase. 既存のコードベースを参考に実装しました!(キリッ
quick and dirty prototype ASAP! 速度に勝る価値はない。スピード優先で雑にプロトタイプを作ってくれ! Got it. But it must be rebuilt from scratch for production, right? わかりました。本番用には作り直す必要がありますが、大丈夫ですよね? Of course! I'll secure the time and budget then. もちろん!その時は予算も時間もしっかり確保するから!
quick and dirty prototype ASAP! 速度に勝る価値はない。スピード優先で雑にプロトタイプを作ってくれ! Got it. But it must be rebuilt from scratch for production, right? わかりました。本番用には作り直す必要がありますが、大丈夫ですよね? Of course! I'll secure the time and budget then. もちろん!その時は予算も時間もしっかり確保するから! Few weeks later…
the real product! ちょっと待って!実際の製品版は作り直すって約束でしたよね!? No time! Just ship it! By the way, add this feature by tomorrow! そんな時間はない!今回は諦めてくれ!ところでこの機能を明日までに追加してくれないか!? Feedback is great! Let’s ship this version to production NOW! 評判は上々!このまま一気に本格運用だ!今すぐ!!
later' promise. 「後で作り直せる」という約束が守られることはない。 Rapid, short-deadline changes in early phases accelerate complexity. 初期フェーズの激しい仕様変更と短納期への対応が、コードを急速に複雑化させる Compromised code is referenced, copied, and starts to multiply. そういうコードを放置すると、それが参考にされたり、コピーされ、増殖していく I based this code on the patterns found in the current codebase. 既存のコードベースを参考に実装しました!(キリッ
take us to understand it first. 「理解負債」とは、目の前のコードを理解するために必要とされる 「追加の時間」のことである Source:Codemanship “Comprehension Debt: The Ticking Time Bomb of LLM-Generated Code”
— It’s a Tool to be Managed. リスクは敵ではなく、適切に管理すべき「道具」である。 Financial debt is a small risk to hedge against lost opportunities. 財務的な「負債」は機会損失という大きなリスクを回避するための「小さなリスク」である。 Technical debt is no different — at least at the moment of creation. 技術的負債も同様に「小さなリスク」である……少なくとも、発生時点においては。
Lack of Domain Knowledge スキル不足と事業ドメインの理解不足 2. Evolution of Tech & Changing Environments 技術の進歩・環境の変化 3. Integrating Framework and Libraries フレームワークやライブラリの導入 4. Delivery first & The Human Reality デリバリー優先と人の性(さが) 5. Prototypes Promoted to Production プロトタイプの本番運用 6. AI Slops by Vibes AI が生み出す産業廃棄物
• Predict the Future Perfectly... 技術の進歩や環境の変化を完全に予測して…… • Eliminate All External Dependencies... フレームワークやライブラリを完全に排除して…… • Set Schedules Based Solely on Developer Convenience... スケジュールは開発の都合優先で余裕を持って…… • Rebuild Every Prototype from Scratch... プロトタイプ検証が終わったら、ゼロから書き直して…… • Ban the Use of Generative AI. AI は危険だから使うのをやめよう!
• Predict the Future Perfectly... 技術の進歩や環境の変化を完全に予測して…… • Eliminate All External Dependencies... フレームワークやライブラリを完全に排除して…… • Set Schedules Based Solely on Developer Convenience... スケジュールは開発の都合優先で余裕を持って…… • Rebuild Every Prototype from Scratch... プロトタイプ検証が終わったら、ゼロから書き直して…… • Ban the Use of Generative AI. AI は危険だから使うのをやめよう! I see. A flawless plan… なるほど完璧な作戦っスねーっ
• Predict the Future Perfectly... 技術の進歩や環境の変化を完全に予測して…… • Eliminate All External Dependencies... フレームワークやライブラリを完全に排除して…… • Set Schedules Based Solely on Developer Convenience... スケジュールは開発の都合優先で余裕を持って…… • Rebuild Every Prototype from Scratch... プロトタイプ検証が終わったら、ゼロから書き直して…… • Ban the Use of Generative AI. AI は危険だから使うのをやめよう! If you ignore the fact that it's impossible! 不可能だという点に目をつぶればよぉ〜
refactoring and dependency updates. 手動テストの手間(面倒くささ)が、リファクタリングや依存パッケージのアップデートを阻む。 From Fear To Confidence Automated tests grant the safety to refactor and keep code clean. 自動テストという安全網が、自信あるリファクタリングを可能に。 Beyond Human Capacity Manual testing fails against the explosion of AI-driven output. AI によるコード生成速度に対して、人力の手動テストはあまりにも無力。 Test Automation
dependency is a long-term commitment. アップデート対応、破壊的変更や EOL のリスクなど、依存の導入は長期的にはコストを払う必要がある。 Strategic Restraint Avoid mindless adoption. Scrutinize necessity, stability and viability for every choice. 依存パッケージを安易に導入せず、必要性と安定性、将来性をしっかり吟味しなくてはならない。 Preserve Your Choice Code alone cannot tell the story. Use ADRs to record the decision context and trade-offs. コードは背景を語らない。ADR を作成し、決断の根拠とトレードオフを記録すべき。 Curated Dependencies
constitutes a Single Point of Failure. 特定の個人に任せることはボトルネックとなるだけでなく、単一障害点という大きなリスクに。 Empowered Stewardship Context sharing fosters ownership and lays the foundation for healthy, sustainable code. 背景をチームで共有することが当事者意識を育む。それが健全で持続可能なコードの土台となる。 Humans at the Helm AI assists execution, but humans remain the owners. Never delegate accountability to AI. AI がコードを生成しても、オーナーシップは人間に残る。AI にすべてを委ねてはいけない。 Collective Code Ownership
enables understanding and refactoring. コードは背景を語らない。充実したドキュメントが、コードの理解とリファクタリングを可能にする。 Beyond Perfect Naming Naming is never "obvious" to everyone. Polished comments are a lifeline for the team. 自明で完璧に思えるクラス名や変数も、本当に伝わるとは限らない。丁寧なコメントがチームを救う Reading-First Era AI writes, humans read. Readability and documentation are more important than ever. AIが書き、人間が読む。可読性とドキュメンテーションの価値は、かつてないほど高まっている。 Documentation and Comment
pattern to isolate and control the impact of technical debt. 腐敗防止層は、技術的負債をコントロールし、その影響からあなたのコードを守る定番の設計パターン。 Shielding from External Chaos Abstract APIs and packages. ACL ensures breaking changes don't paralyze the system. 外部APIやパッケージとの間に層を置くことで、破壊的変更を遮断し、将来の乗り換えや変更を容易に。 Legacy Isolation Never let legacy mess infect new features. Protect new code to keep it clean and refactorable. 新機能の開発時に腐敗防止層を用いることで、新しいコードを健全で保守可能に。 Anti-Corruption Layer (ACL)
high-level code standards with AI. 保守性や可読性の実現には手間が掛かる。しかし AI ならば正しく指示すれば速やかに実現してくれる。 Legacy Archaeologist AI deciphers the black box. Uncover hidden logic from spaghetti code. AIはコードを読み解く考古学者。忘れ去られた仕様をスパゲッティの森から見つけ出す。 Automated Modernization AI handles the heavy lifting of refactoring. Even complex changes become fast and simple. リファクタリングの重労働を AI が肩代わり。複雑で大変な変更も、もっと手軽に。 Partnering with AI
daily habit to keep the code maintainable. 負債は放置すれば増え続ける。日常的な整頓の習慣がコードをメンテナンス可能に保つ。 Cultivate Culture Embed refactoring into the development process to make improvements a shared value. リファクタリングを開発プロセスに組み込み、改善を共有の価値観に。 Low-Effort Continuity AI eliminates the toil of tidying. Continuous maintenance is now possible with minimal effort. 面倒な整理整頓を AI に任せよう。最小限の労力で、継続的なメンテナンスを。 Continuous Tidying and Refactoring
not "zero debt," but "manageable debt." 技術的負債は必ず生まれる。大切なのはゼロにすることではなく、制御すること。 Strategic Risk Management Technical debt is a business risk. Control it strategically to sustain long-term growth. 技術的負債はビジネス上のリスク。長期的な成長のために戦略的なコントロールが求められる。 AI: The Strategic Weapon Careless use spawns debt; proper use conquers it. Master AI to turn legacy into assets. AI はうかつに使えば負債を増やすが、正しく使いこなすことで、負債解消の強力な武器になる。 Key Takeaways THANK YOU!!