Clean Code Bites: Consistent Naming Conventions

𝗖𝗹𝗲𝗮𝗻 𝗖𝗼𝗱𝗲 𝗕𝗶𝘁𝗲𝘀: How To Name Consistently The rule governing this is quite straightforward. Any programming language we use has a preferred way of naming variables and functions alike. If we were to take JavaScript as an example, 𝐜𝐚𝐦𝐞𝐥𝐂𝐚𝐬𝐞 is the standard way of naming variables and functions. So, as a JavaScript Developer, stick to that. For example, no need to name one variable as 𝐮𝐬𝐞𝐫_𝐢𝐝, and in the very next day, name a function param 𝐢𝐦𝐚𝐠𝐞𝐔𝐫𝐥. There is also a widespread convention across most programming languages that constants are always uppercase (e.g. 𝐒𝐓𝐔𝐃𝐄𝐍𝐓𝐒_𝐋𝐈𝐌𝐈𝐓), and classes are PascalCase. While it is strongly recommended to follow conventions, you can adopt different writing styles. But the rule you can't break as a developer is to be consistent. That's one 𝗖𝗹𝗲𝗮𝗻 𝗖𝗼𝗱𝗲 𝗕𝗶𝘁𝗲, see you next time! #CleanCode #SoftwareEngineering #WebDevelopment #CodeQuality #ProgrammingTips #JavaScript #BestPractices #DevelopersLife #CodingCommunity

  • text

To view or add a comment, sign in

Explore content categories