{"id":22082,"date":"2017-02-22T10:00:33","date_gmt":"2017-02-22T15:00:33","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=22082"},"modified":"2017-02-19T17:28:33","modified_gmt":"2017-02-19T22:28:33","slug":"choose-good-names-code","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/","title":{"rendered":"How to Choose Good Names in Code"},"content":{"rendered":"<p>Choosing a good name for a piece of code is so important. If your code is going to be read at least one time\u2014if only by yourself\u2014then names will play a major part in your capacity to work with it.<\/p>\n<p>Variable names, function names, class names, names in an interface: all are priceless ways to let a reader know what a piece of code is doing. During code review at work, I&#8217;m quite picky with my team members concerning good naming\u2014sorry about that, lads!\u2014but I believe this can make or break the quality of our code.<\/p>\n<p>Even if there are other valuable means to know what a piece of code is doing, like documentation for instance, good names are an extremely efficient channel to convey information about your code for at least two reasons:<\/p>\n<ul>\n<li>Very good names <strong>instantly<\/strong> tell what is going on in your code, as opposed to looking up the documentation and finding your way around code by following it.<\/li>\n<\/ul>\n<ul>\n<li>Naming can be improved quickly. You can make a quick fix that updates some names in the code, manually or by using a tool (such as the popular <a href=\"http:\/\/clang.llvm.org\/extra\/clang-tidy\/\">clang-tidy<\/a> for example), and if your code builds, you&#8217;re nearly certain it will pass the tests.<\/li>\n<\/ul>\n<p>Because it\u2019s so important, I\u2019m going to provide you with guidelines on how to choose good names. I&#8217;ve taken some of these guidelines from Steve McConnell\u2019s reference book, <em><a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/0735619670\/makithecompsi-20\">Code Complete<\/a><\/em> (which is part of the must-reads John advises in his post \u201c<a href=\"https:\/\/simpleprogrammer.com\/2016\/07\/11\/get-started-software-development\/\">How to Get Started in Software Development<\/a>\u201d).<\/p>\n<p>Some of the tips come from discussions, suggestions, and code reviews I\u2019ve had with my peers at work. A couple of them I&#8217;ve worked out on my own by experimenting with code over the years.<\/p>\n<p>We&#8217;ll start by explaining how to avoid bad names and then focus on how to pick good ones.<\/p>\n<h2>Don&#8217;t Use Anything Illegal<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-22092\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Untitled-1-2-1-1024x576.png\" alt=\"\" width=\"735\" height=\"413\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Untitled-1-2-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Untitled-1-2-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Untitled-1-2-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Untitled-1-2-1.png 1280w\" sizes=\"auto, (max-width: 735px) 100vw, 735px\" \/><\/p>\n<p>Let&#8217;s get this out of the way: there are names that you are just not allowed to use in a given language.<\/p>\n<p>Besides using names reserved by the standard (like \u2018int\u2019), which will halt compilation, each language has its specific rules for legal names. For example in C++, some combinations of underscores (_) in a name will compile while not being legal, because they are reserved for the compiler or standard library implementer. Using them may conflict with objects or routines declared by them, leading to subtle bugs and unexpected behaviour.<\/p>\n<p>Here are the names that are reserved for the compiler and standard library implementers in C++:<\/p>\n<ul>\n<li>Any name with two consecutive underscores in it (__)<\/li>\n<\/ul>\n<ul>\n<li>Any name starting with one underscore immediately followed by a capital letter (_isOk, isOk_too, _IsNotOk)<\/li>\n<\/ul>\n<ul>\n<li>A name starting with one underscore and in global namespace<\/li>\n<\/ul>\n<p>So don&#8217;t consider using such names, as they could get you into trouble.<\/p>\n<h2>Don&#8217;t Waste Information<\/h2>\n<p>When you think about it, your code perfectly knows what it is doing. In fact, it is the one that knows best: it executes what\u2019s in it as faithfully as it possibly can!<\/p>\n<p>Giving good names is really about retaining as much of the information that the code holds as you can. Said differently, it is about not wasting information by obfuscating the code. It\u2019s interesting to note that hiding information is often encouraged, via encapsulation. But in this context it is rather information <em>disclosure <\/em>that you want to aim for.<\/p>\n<p>For this reason, <strong>limit the use of abbreviations.<\/strong> Abbreviations and acronyms are convenient to write but difficult to read. As the saying goes, code is written once but read many times.<\/p>\n<p>However, you don&#8217;t have to systematically spell out <em>all<\/em> acronyms to make code clearer, and some repeated unabbreviated code can even harm readability.<\/p>\n<p>For instance, it seems reasonable to use &#8220;VAT&#8221; in your code instead of writing \u00a0valueAddedTax every time you use it, because everyone knows what VAT is.<\/p>\n<p>How do you choose whether or not to use an acronym in code? Rule of thumb: if the <em>end user<\/em> of your application would understand a particular abbreviation or acronym, then it is OK to use it in code because it shows that everyone in your domain area knows what it means.<\/p>\n<p>Moreover, <strong>don&#8217;t try to optimize for the minimum number of characters<\/strong>. On forums, you can see guys that argue that their method is superior because it involves less typing. But which is more of a hassle: a couple of keystrokes, or a couple of minutes staring at code, trying to figure it out?<\/p>\n<p>You certainly don\u2019t want to waste time figuring out what a function and method name meant, especially when you can make their names as long as necessary. Research from the University of Southampton <a href=\"http:\/\/dl.acm.org\/citation.cfm?id=948088\">(Rees 1982)<\/a> suggests that function and method names can reasonably go up to 35 characters, which sounds like a lot, but a longer name can help you understand what a piece of code is and what it does with only a quick glance.<\/p>\n<p>However, the length of a function name can also become bloated for bad reasons:<\/p>\n<ul>\n<li>If a function\u2019s name is too long because the function <strong>is doing too many things<\/strong>, the fix is not in the naming, but at the function level itself by breaking it down into several logical parts.<\/li>\n<li>Function names get artificially bloated when they include superfluous information that is <strong>already expressed by their parameter types<\/strong>. For instance:<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/a93b68a14473e9a782c627c72416f314.js\"><\/script><\/p>\n<p>can be renamed:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/4dfff07960c3feb36b7117aea9af164e.js\"><\/script><\/p>\n<p>This leads to more natural code at call site:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/9e29563f063b9b3c411a598b69d9ab5b.js\"><\/script><\/p>\n<p>as opposed to:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/5cfc6325aee2dd7bd5c2532041f03863.js\"><\/script><\/p>\n<ul>\n<li><strong>Negations<\/strong> are another example of undesirable information in a name, because they force a reader to make the intellectual effort of reverting them to their positive meaning in order to parse the code. The following example:<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/d542379b3635cfb78bcbe8ed23f7f2a4.js\"><\/script><\/p>\n<p>can be improved by using an affirmative name:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/7ceaf130874b0e92896f1dd8e4fe150f.js\"><\/script><\/p>\n<p>Now that we\u2019ve ruled out certain bad naming practices, let\u2019s focus on how to pick good names.<\/p>\n<h2>Pick Names Consistent with Abstraction Levels<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-22094\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Name-1-1024x576.png\" alt=\"\" width=\"704\" height=\"396\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Name-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Name-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Name-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Name-1.png 1280w\" sizes=\"auto, (max-width: 704px) 100vw, 704px\" \/><\/p>\n<p>As described in a previous post, <a href=\"https:\/\/simpleprogrammer.com\/2017\/01\/27\/respecting-abstraction\/\">respecting levels of abstraction<\/a> is at the root of many good practices. And one of these practices is good naming.<\/p>\n<p>A good name is a name that is consistent with the level of abstraction of the surrounding code. As explained in the post on levels of abstraction, <strong>a good name expresses what code is doing, not how it is doing it.<\/strong><\/p>\n<p>To illustrate this, let\u2019s take the example of a function computing the salaries of all the employees in a company. The function returns a collection of results associating keys (employees) to values (salaries).<\/p>\n<p>A bad function name, focused on <strong>how <\/strong>the function is implemented, would be:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/de3886ec16c6792971f233110774125d.js\"><\/script><\/p>\n<p>The problem with such a function name is that it expresses that the function computes its results in the form of a vector of pairs instead of focusing on <strong>what<\/strong> it does, that is, computing the salaries of the employees. A quick fix for this would be to replace the name with the following:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/1742618b59155e1681f0b4209907629d.js\"><\/script><\/p>\n<p>This relieves the call site from some implementation details, letting you\u2014as a reader of the code\u2014know what the code is intending to do.<\/p>\n<p>Respecting levels of abstraction has interesting consequences for variables and object names. Often in code, variables and objects represent something more abstract than what their type implies.<\/p>\n<p>For example, an int often represents more than just an int: it can represent the age of a person or the number of elements in a collection. Or a particular object of type Employee can represent the manager of a team. Or an std::vector&lt;double&gt; can represent the daily average temperatures observed in New York over the last month. (Of course, this doesn&#8217;t hold in very low-level code, like adding two ints, or in places where you use <a href=\"http:\/\/www.fluentcpp.com\/2016\/12\/08\/strong-types-for-strong-interfaces\/\">strong types<\/a>.)<\/p>\n<p>In such cases, you want to name the variable after <strong>what it represents<\/strong> rather than its type. You\u2019d name your int variable \u2018age\u2019, rather than \u2018i\u2019. You&#8217;d name the above Employee \u2018manager\u2019 and not just \u2018employee\u2019. You&#8217;d name the vector \u2018temperatures\u2019 rather than \u2018doubles\u2019 .<\/p>\n<p>This seems quite obvious, yet there are cases where we generally neglect to apply this guideline. Let\u2019s illustrate this with <strong>iterators<\/strong> and C++ <strong>templated types.<\/strong><\/p>\n<p>Let&#8217;s take a collection of cash flows paid or received from a financial product. Some of these cash flows are positive; some are negative. We want to retrieve the first cash flow that went towards us, so we\u2019ll focus on the first positive one. Here is a first attempt at writing this code:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/f0685f417bcbe0671c9c1bcd93eca7f6.js\"><\/script><\/p>\n<p>This code uses the name \u2018it\u2019, reflecting how this variable is implemented (with an iterator), rather than what the variable means. How do you compare this to the following code?<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/d0607c39c9c35b511d9bc0ff54e43f50.js\"><\/script><\/p>\n<p>Which code saved you the most effort understanding it? Can you imagine the difference when you don\u2019t have to read two lines of code but 10, or 50? Note that this ties in with our previous section about not wasting the precious information code knows about itself.<\/p>\n<p>The same logic applies to <strong>template parameters.<\/strong> Especially when learning to use templates, where a lot of the examples we see come out of academic sources, we have a tendency to write the following line of code for all our template classes and functions:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/4b3e310fc6f2ae6ee8b358a65b8a824f.js\"><\/script><\/p>\n<p>&#8230;while you may know more about T than that, it is just a type.<\/p>\n<p>Using T as a type name is fine in very generic code where you don\u2019t know anything about the type, like in std::is_const:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/87d64d458825325a55461cb1c9dffa96.js\"><\/script><\/p>\n<p>But <em>any<\/em> information about what T represents should be worked into your code. Let\u2019s take here the simple example of a function parsing a serialization input:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/a6a4fb060c3551ff565b34e9fb4354d5.js\"><\/script><\/p>\n<p>And by showing more explicitly what T represents:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/joboccara\/9c2d7ce128d2311ea5fa5ddb09f8b369.js\"><\/script><\/p>\n<p>Compare the two pieces of code. Which one do you think is easier to work with? I would definitely say the second one because it tells you that the type is the one to be parsed, whereas the first one only told that T is\u2026 a type.<\/p>\n<p>You may think naming the type makes a big difference or you may think it doesn\u2019t. But what is certain is that the second piece of code includes more documentation in it, and <strong>for free<\/strong>. The time it takes to replace a bad name with a good one in your own code, particularly a name used locally, is close to zero, and the performance cost incurred by a clearer name is exactly equal to zero.<\/p>\n<p>This absence of cost is true for good naming in general: for once there is a free lunch out there, so let\u2019s take advantage of it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Choosing a good name for a piece of code is so important. If your code is going to be read at least one time\u2014if only by yourself\u2014then names will play a major part in your capacity to work with it. Variable names, function names, class names, names in an interface: all are priceless ways to&#8230;<\/p>\n","protected":false},"author":1029,"featured_media":22095,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[162229812,1634593,162229802,415,1934,31679,162229803,162229253],"tags":[],"class_list":["post-22082","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advice","category-c-2","category-communication","category-guest-post","category-language","category-process-improvement","category-programming","category-technical"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Choose Good Names in Code - Simple Programmer<\/title>\n<meta name=\"description\" content=\"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/simpleprogrammer.com\/choose-good-names-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Choose Good Names in Code - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/choose-good-names-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-22T15:00:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"How to Choose Good Names in Code\",\"datePublished\":\"2017-02-22T15:00:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/\"},\"wordCount\":1778,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/How-to-Choose-Good-Names-in-Code.png\",\"articleSection\":[\"Advice\",\"C++\",\"Communication\",\"Guest Post\",\"Language\",\"Process Improvement\",\"Programming\",\"Technical\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/\",\"name\":\"How to Choose Good Names in Code - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/How-to-Choose-Good-Names-in-Code.png\",\"datePublished\":\"2017-02-22T15:00:33+00:00\",\"author\":{\"@id\":\"\"},\"description\":\"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/How-to-Choose-Good-Names-in-Code.png\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/How-to-Choose-Good-Names-in-Code.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/choose-good-names-code\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Choose Good Names in Code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/\",\"name\":\"Simple Programmer\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/simpleprogrammer.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Choose Good Names in Code - Simple Programmer","description":"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/","og_locale":"en_US","og_type":"article","og_title":"How to Choose Good Names in Code - Simple Programmer","og_description":"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.","og_url":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/","og_site_name":"Simple Programmer","article_published_time":"2017-02-22T15:00:33+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png","type":"image\/png"}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/"},"author":{"name":"","@id":""},"headline":"How to Choose Good Names in Code","datePublished":"2017-02-22T15:00:33+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/"},"wordCount":1778,"commentCount":0,"image":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png","articleSection":["Advice","C++","Communication","Guest Post","Language","Process Improvement","Programming","Technical"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/choose-good-names-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/","url":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/","name":"How to Choose Good Names in Code - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png","datePublished":"2017-02-22T15:00:33+00:00","author":{"@id":""},"description":"Naming your code is almost as important as naming your children. Luckily, there are guides on how to do both. This one is for the former.","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/choose-good-names-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/How-to-Choose-Good-Names-in-Code.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/choose-good-names-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"How to Choose Good Names in Code"}]},{"@type":"WebSite","@id":"https:\/\/simpleprogrammer.com\/#website","url":"https:\/\/simpleprogrammer.com\/","name":"Simple Programmer","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/simpleprogrammer.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"","url":"https:\/\/simpleprogrammer.com\/author\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/22082","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/users\/1029"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=22082"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/22082\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/22095"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=22082"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=22082"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=22082"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}