DAY 4
πΒ μ€λ μ½μ λ²μ : 2μ₯ ~ Method names
<aside>
π μ±
μμ κΈ°μ΅νκ³ μΆμ λ΄μ©μ μ¨λ³΄μΈμ.
</aside>
- The name of a variable, function, or class, should answer all the big questions. It should tell you why it exits, what it does, and how it is used. If a name requires a comment, then the name does not reveal its intent.
- Programmer s must avoid leaving false clues that obscure the meaning of code. We should avoid word whose entrenched meanings vary from our intended meaning.
- If you canβt pronounce it, you canβt discuss it without sounding like an idiot.....This matters because programming is a social activity.
- One difference between a smart programmer and a professional programmer is that the professional understands that clarity is king. Professionals use their powers for good and write code that others can understand.
- Class and objects should have noun or noun phrase.
- Methods should have verb or verb phrase names.
<aside>
π€ μ€λ μ½μ μκ°μ? λ μ€λ₯΄λ μκ°μ κ°λ³κ² μ μ΄λ³΄μΈμ
</aside>
When someone else whoβs not working on the task Iβm working on can understand what my function is doing, itβs probably because I named it right.
<aside>
π κΆκΈν λ΄μ©μ΄ μκ±°λ, μ μ΄ν΄λμ§ μλ λ΄μ©μ΄ μλ€λ©΄ μ μ΄λ³΄μΈμ.
</aside>
<aside>
π‘ μκ° 3μ€ μμ½
</aside>
- The name of a variable, function, or class, should answer all the big questions. It should tell you why it exits, what it does, and how it is used. If a name requires a comment, then the name does not reveal its intent.
- Clarity is king: Professionals use their powers for good and write code that others can understand.
- Programming is a social activity.