What’s in a name A good name answers important questions. What does it contain? What does it mean? How would I use it? What role does it play? Always name your methods based on their behaviour, not implementation. Consider, By looking at the method name above, we can predict it’s going to perform 2-3 database operations, but when I’m working in Business model, why would it concern me? Going by, naming method based on their business role, the method can be renamed as, Structural Naming Another common strategy is to name things for their role in the program. It’s the input or the output. It’s the recurring phrase or the …
Rails 開発: コーディング規約とベスト プラクティス 続きを読む "