News for hackers. Stuff that matters.
Re:Ask HN: How to become good at naming things in code? by martinmartinez on Saturday April 04, 2020 @05:54PM (#22781856)
1) Look at the language style guide. To see the best practices if relevant; or how naming variables in said guide. 2) Name based on a variation of hungarian notation based on data. bCat for boolean for if cat or not; x for item of list; xs for a list of items. Here are more examples https://en.wikipedia.org/wiki/Hungarian_notation#Examples (PS i know hungarian notation has fallen out of favor; modify for the language you are using; and keep it simple) 3) This blog post from Joel Spolsky might be useful https://www.joelonsoftware.com/2005/05/11/making-wrong-code-...

There are no comments on this comment yet.