It's a guide to producing readable, reusable, and refactorable software in #php#ruby#javascript#python#java, etc. - Software engineering principles, from Robert C. Martin's book "Clean Code"
☑️ Use meaningful and pronounceable variable names
2⃣ Clean Code Series: Variables📒 🧑💻
☑️ Use the same vocabulary for the same type of variable
3⃣ Clean Code Series: Variables📒 🧑💻
☑️ Use searchable names (part 1)
💡We will read more code than we will ever write. By not naming variables that end up being meaningful for understanding our program, we hurt our readers. Make your names searchable.
4⃣ Clean Code Series: Variables📒 🧑💻
☑️ Use searchable names (part 2)
5⃣ Clean Code Series: Variables📒 🧑💻
☑️ Use explanatory variables
6⃣ Clean Code Series: Variables📒 🧑💻
☑️ Avoid nesting too deeply and return early (part 1)
💡Too many if-else statements can make your code hard to follow. Explicit is better than implicit.
7⃣ Clean Code Series: Variables📒 🧑💻
☑️ Avoid nesting too deeply and return early (part 2)
8⃣ Clean Code Series: Variables📒 🧑💻
☑️ Avoid Mental Mapping
💡Don’t force the reader of your code to translate what the variable means. Explicit is better than implicit.
9⃣ Clean Code Series: Variables📒 🧑💻
☑️ Don't add unneeded context
💡If your class/object name tells you something, don't repeat that in your variable name.
That's all for the first part of clean-code.
In the next Thread, I will add functions & classes.
If you like this thread,
✅ Follow me @rajkbnp
💕 Like it
🔀 Retweet it
Thanks 🙏
📢The second part of the Clean Code Series: Comparison is also available now👇