Do you use clear and meaningful names when coding? #9597
Replies: 29 comments 4 replies
-
Having clear names is massive when working in teams, where there are constant devs coming and going. Being able to quickly make sense of code rapidly speeds up onboarding times. 🚀 |
Beta Was this translation helpful? Give feedback.
-
Not sure if I agree with the bad example at 3:51 - blanket ban on using "name" Sure maybe with users/people it's a little more complex because people have first, last, full names, etc... |
Beta Was this translation helpful? Give feedback.
-
If your code forces others to pause and decipher it, you're already wasting valuable time. |
Beta Was this translation helpful? Give feedback.
-
I think this rule is the most important of the lot. If a dev has to try to decode your variable names while figuring out what the code is doing then it makes it much more difficult |
Beta Was this translation helpful? Give feedback.
-
I think @jernejk would agree with me when we say this is a extremely important rule!!! - We have worked on a project where a single entity has fields for |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Consistency is also important because it directly impacts the readability, maintainability, and overall quality of the codebase |
Beta Was this translation helpful? Give feedback.
-
Naming can be difficult especially when the team is large. Following good standards like the ones listed here are important, but also keeping that consistent across the code base helps increase understanding and decrease frustration. OneArea_That_DevsCanGetSuperCreative_And_Verbose_Is_In_UnitTestMethodNames 🤣️ |
Beta Was this translation helpful? Give feedback.
-
I am not a developer however it always makes more sense to use established clear naming when labelling anything. In hospitality lots of food waste can occur in kitchens if items are not labelled correctly or following a standard ask me how I know.... |
Beta Was this translation helpful? Give feedback.
-
This is the most important rule in my opinion - shortening or abbreviating always comes back to bite you if you end up trying to look back at code you wrote a while ago and make sense of it... also thoughtful for other devs. |
Beta Was this translation helpful? Give feedback.
-
Fully disagree with not using "Name" or similar What's the alternative ? Item.displayName ? No - because it's not necessarily just display. Otherwise good video |
Beta Was this translation helpful? Give feedback.
-
Names should primarily be consistent. Your naming conventions mean nothing if they aren't the same across your project |
Beta Was this translation helpful? Give feedback.
-
Overuse of abbreviations has caused me a lot of pain in the past when trying to understand a piece of code, especially when a lot of seemingly-arbitrary numbers are involved (which ironically is where this happens most). |
Beta Was this translation helpful? Give feedback.
-
Meaningful names are very import to make the code easy to understand. However, I am not 100% agree about using "name" or similar being a bad item. As a variable name, "name" is not meaningful enough. But as a property of a Class, I believe it is acceptable. For example, if you have classes Session, Presentation, etc... Them having a consistent property "Name" is better, than each of them having a unique property of that. |
Beta Was this translation helpful? Give feedback.
-
When I was starting out as a dev, I misunderstood self-documenting code to mean writing lots of comments explaining everything I wrote. Over time, I realised it’s actually about writing code that speaks for itself—and a big part of that is using clear, meaningful names. |
Beta Was this translation helpful? Give feedback.
-
Consistency in naming conventions is crucial for code readability and maintainability. It ensures that new developers can quickly understand the codebase and helps prevent potential issues that might arise from unclear or inconsistent names. Clear and meaningful naming makes the code more intuitive and easier to work with. |
Beta Was this translation helpful? Give feedback.
-
One space I like to really ham up the variable names is for dictionaries - so instead of just 'birthdays' do something like 'birthdateByUserId', and then when iterating on this 'birthdateForUserId'. Would be keen to hear how others like to name theirs? |
Beta Was this translation helpful? Give feedback.
-
Even for a non developer this makes a lot of sense |
Beta Was this translation helpful? Give feedback.
-
N/A - I am a developer I can definitely understand how important this is for devs |
Beta Was this translation helpful? Give feedback.
-
100%. I like all the suggestions here. The MOST important thing here is to keep your names *descriptivec and consistent. If you can't articulate what the variable name means to a grandma in 1 sentence the identifier is likely bad. |
Beta Was this translation helpful? Give feedback.
-
This is super important for writing maintainable code. |
Beta Was this translation helpful? Give feedback.
-
I am not a developer but with clear naming conventions as described above it means that someone who is not a developer can make sense of code. |
Beta Was this translation helpful? Give feedback.
-
Naming convention should be semantic and most importantly consistent across the project, for best readability and maintenance. |
Beta Was this translation helpful? Give feedback.
-
One problem I frequently encounter is that many objects we need to name cannot be directly represented as very specific actions or entities. They might be middleware or more abstract concepts. In these cases, we often run into the issue of names becoming too long in an attempt to describe them comprehensively. |
Beta Was this translation helpful? Give feedback.
-
I have seen a function named "DoThis". Imagine the pain... "WHAT IT DO???" |
Beta Was this translation helpful? Give feedback.
-
Having clear and consistent names across the project/company make easier for devs to join the team and understand the project quickly. |
Beta Was this translation helpful? Give feedback.
-
Having good naming conventions means that people reading your code can easily tell what it means, to understand the functionality much easier |
Beta Was this translation helpful? Give feedback.
-
Well explained in the video, this rule is very important for maintainability and readability |
Beta Was this translation helpful? Give feedback.
-
Great rule and well explained in the video |
Beta Was this translation helpful? Give feedback.
-
bfcbc0ef-d2f8-4e77-85d9-97ccb841eb19
Naming things is hard, but also important. Using clear, meaningful names will make your code more readable and reduce cognitive load and risk for your development team.
https://www.ssw.com.au/rules/clear-meaningful-names/
Beta Was this translation helpful? Give feedback.
All reactions