You are viewing a single comment's thread from:

RE: Making your code clean: How proper naming can save the day

in #coding7 years ago

Great share! I wish more people wrote code like this.

Uncle Bob is actually Robert Martin and he wrote a book called Clean Code that is an extensive treatise on these principles, well worth your time.

Another aspect of naming that I follow consistently is to name all of my objects as identifiable nouns. Don't just say user but more specifically like creator or editor. These nouns should be understandable not only to the developers, but be identifiable by the end users as well.

Then, all methods we write are verbs, still identifiable and following these same principles.

Sort:  

I love Clean Code! Tons of great stuff to learn! He is an....interesting person, to say the least. And I do like the identifiable nouns idea. Surely makes the code more readable. I am going to keep this in mind when I make my next 'user' variable.