在 Laravel 中編寫簡潔的程式碼的策略

hmingv發表於2021-12-18

文章翻譯自 twitter.com/samuelstancl/status/12...

In this thread I’ll list tactics you can use to write cleaner code in Laravel. As you use them repeatedly, you’ll develop a sense for what’s good code and what’s bad code. I’ll also sprinkle some general Laravel code advice in between these tactics.

在本主題中,我將列出可用於在 Laravel 中編寫更簡潔程式碼的策略。 當您反覆使用它們時,您將對什麼是好的程式碼和什麼是壞的程式碼產生一種感覺。 我還將在這些策略之間新增一些通用的 Laravel 程式碼建議。

It’s about the micro.
Using some “macro” philosophy for structuring your code, like hexagonal architecture or DDD won’t save you.
A clean codebase is the result of constant good decisions at the micro level.

這是關於 micro
使用一些 micro 哲學來構建你的程式碼,比如使用六邊形架構或 DDD 不會拯救你。
乾淨的程式碼庫是微觀層面不斷做出正確決策的結果。

文章將在評論中持續更新,部分未翻譯,有時間處理。

本作品採用《CC 協議》,轉載必須註明作者和本文連結

相關文章