Naming is key to clear code

Naming is a key part of 𝗰𝗹𝗲𝗮𝗻 𝗰𝗼𝗱𝗲 Bad names = confusing, hard to understand Good names = clear, easy to understand ❌ 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗻𝗮𝗺𝗲𝘀: aTask(), handleData(), process() ❌ 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲 𝗻𝗮𝗺𝗲𝘀: a, tmp, val ✅ 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻 𝗻𝗮𝗺𝗲𝘀: calculateTotalPrice(), fetchUserProfile(), validateEmailInput() ✅ 𝗩𝗮𝗿𝗶𝗮𝗯𝗹𝗲 𝗻𝗮𝗺𝗲𝘀: totalPrice, userProfile, emailInput 💡 If your code needs comments to explain the names, fix the names — not the comments. Write names that 𝘁𝗲𝗹𝗹 𝘁𝗵𝗲 𝘀𝘁𝗼𝗿𝘆. Do you agree that 𝗻𝗮𝗺𝗶𝗻𝗴 𝗶𝘀 𝗮𝗻 𝗶𝗺𝗽𝗼𝗿𝘁𝗮𝗻𝘁 𝗽𝗮𝗿𝘁 𝗼𝗳 𝗰𝗹𝗲𝗮𝗻 𝗰𝗼𝗱𝗲?👇 #CleanCode #Coding #Developers #Programming #BestPractices

  • graphical user interface, application

To view or add a comment, sign in

Explore content categories