"value":"\n <p>I previously wrote about why you shouldn't use variable names like <code>$x<\/code> and <code>$y<\/code> in your code and why you should use more descriptive names.<\/p>\n\n<p>But what if there is an existing convention?<\/p>\n\n<p>For example, I use Lua to configure Neovim and noticed that it's common to use shortened variable names, such as <code>buffer<\/code> instead of <code>buffer_number<\/code> or <code>bufferNumber<\/code>.<\/p>\n\n<p>It's also common to use the variable <code>M<\/code> to declare a module. For example:<\/p>\n\n<pre><code class=\"language-lua\">local M = {}\nM.find_files = function()\n \/\/ ...\nend\n\nreturn M\n<\/code><\/pre>\n\n<p>Whilst <code>Module<\/code> would be a more descriptive name, would deviating from the convention be more confusing for anyone reading the code?<\/p>\n\n<p>Do the benefits of following a convention outweigh the benefits of using more descriptive variable and function names?<\/p>\n\n<p>Which would be easier for newcomers to your project or team to understand and allow them to be productive sooner?<\/p>\n\n ",
"format":"full_html",
"processed":"\n <p>I previously wrote about why you shouldn't use variable names like <code>$x<\/code> and <code>$y<\/code> in your code and why you should use more descriptive names.<\/p>\n\n<p>But what if there is an existing convention?<\/p>\n\n<p>For example, I use Lua to configure Neovim and noticed that it's common to use shortened variable names, such as <code>buffer<\/code> instead of <code>buffer_number<\/code> or <code>bufferNumber<\/code>.<\/p>\n\n<p>It's also common to use the variable <code>M<\/code> to declare a module. For example:<\/p>\n\n<pre><code class=\"language-lua\">local M = {}\nM.find_files = function()\n \/\/ ...\nend\n\nreturn M\n<\/code><\/pre>\n\n<p>Whilst <code>Module<\/code> would be a more descriptive name, would deviating from the convention be more confusing for anyone reading the code?<\/p>\n\n<p>Do the benefits of following a convention outweigh the benefits of using more descriptive variable and function names?<\/p>\n\n<p>Which would be easier for newcomers to your project or team to understand and allow them to be productive sooner?<\/p>\n\n ",