{"id":1928,"date":"2013-04-14T12:16:05","date_gmt":"2013-04-14T19:16:05","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=1928"},"modified":"2018-01-09T17:01:06","modified_gmt":"2018-01-09T22:01:06","slug":"what-makes-code-readable-not-what-you-think","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/","title":{"rendered":"What Makes Readable Code: Not What You Think"},"content":{"rendered":"<p>You often hear about how important it is to write \u201creadable code.\u201d\\n\\nDevelopers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion.\\n\\nBut\u00a0<strong>have you ever stopped to think about what really makes code readable?<\/strong>\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<div id=\"scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:c93ce755-9f1b-492f-9b7c-54e44d7c2316\" class=\"wlWriterEditableSmartContent\" style=\"float: right; margin: 0; display: inline; padding: 0;\"><a title=\"This code is CRAP!\" href=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2013\/04\/readable-8x6.jpg\" rel=\"thumbnail\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2013\/04\/readable.png\" alt=\"\" width=\"243\" height=\"364\" border=\"0\" \/><\/a><\/div>\n<p>\\n\\n<\/p>\n<h2>The standard answer<\/h2>\n<p>\\n\\nYou would probably agree that the following things, regardless of programming language, contribute to the readability of code:\\n\\n<\/p>\n<ul>\\n    <\/p>\n<li>Good variable, method and class names<\/li>\n<p>\\n    <\/p>\n<li>Variables, classes and methods that have a single purpose<\/li>\n<p>\\n    <\/p>\n<li>Consistent indentation and formatting style<\/li>\n<p>\\n    <\/p>\n<li>Reduction of the nesting level in code<\/li>\n<p>\\n<\/ul>\n<p>\\n\\nThere are many more standard answers and pretty widely held beliefs about what makes code readable and I am not disagreeing with any of these.\\n\\n<em>(By the way, an excellent resource for this kind of information about \u201cgood code\u201d is <\/em><em><a href=\"http:\/\/www.amazon.com\/Robert-C.-Martin\/e\/B000APG87E\/?_encoding=UTF8&amp;camp=1789&amp;creative=390957&amp;linkCode=ur2&amp;tag=makithecompsi-20\" target=\"_blank\">Robert Martin\u2019s<\/a> excellent book, <a href=\"http:\/\/www.amazon.com\/gp\/product\/0132350882\/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0132350882&amp;linkCode=as2&amp;tag=makithecompsi-20\" target=\"_blank\">Clean Code<\/a><\/em><em>, or <\/em><em><a href=\"http:\/\/www.amazon.com\/Steve-McConnell\/e\/B000APETRK\/?_encoding=UTF8&amp;camp=1789&amp;creative=390957&amp;linkCode=ur2&amp;tag=makithecompsi-20\" target=\"_blank\">Steve McConnell\u2019s<\/a> book that all developers should read, <a href=\"http:\/\/www.amazon.com\/gp\/product\/0735619670\/ref=as_li_ss_tl?ie=UTF8&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0735619670&amp;linkCode=as2&amp;tag=makithecompsi-20\" target=\"_blank\">Code Complete<\/a><\/em><em>. *both of these are affiliate links, thanks for your support.)<\/em>\\n\\nInstead, I want to point you to a deeper insight about readability\u2026\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2>The vocabulary and experience of the reader<\/h2>\n<p>\\n\\nI can look at code and in 2 seconds tell if you it is well written and highly readable or not.\u00a0 (At least my opinion.)\\n\\nAt the same time, <strong>I can take a sample of my best, well written, highly readable code and give it to a novice or beginner programmer, and they don\u2019t spot how it is different from any other code they are looking at.<\/strong>\\n\\nEven though my code has nice descriptive variable names, short well named methods with few parameters that do one thing and one thing only, and is structured in a way that clearly groups the sections of functionality together, they don\u2019t find it any easier to read than they do code that has had no thought put into its structure whatsoever.\\n\\n<strong>In fact, the complaint I get most often is that my code has too many methods, which makes it hard to follow, and the variable names are too long, which is confusing.<\/strong>\\n\\n<\/p>\n<h2>There is a fundamental difference in the way an experienced coder reads code versus how a beginner does<\/h2>\n<p>\\n\\nAn experienced developer reading code doesn\u2019t pay attention to the vocabulary of the programming language itself.\u00a0 An experienced developer is more focused on the actual concept being expressed by the code\u2014what the purpose of the code is, not how it is doing it.\\n\\nA beginner or less experienced developer reads code much differently.\\n\\nWhen a less experienced developer reads code, they are trying to understand the actual structure of the code.\u00a0 <strong>A beginner is more focused on the actual vocabulary of the language than what the expression of that language is trying to convey.<\/strong>\\n\\nTo them, a long named variable isn\u2019t descriptive, it\u2019s deceptive, because it is hiding the fact that <em>NumberOfCoins<\/em> represents an integer value with its long name and personification of the variable, as something more than just an integer.\u00a0 They\u2019d rather see the variable named <em>X<\/em> or <em>Number<\/em>, because its confusing enough to remember what an integer is.\\n\\nAn experienced developer, doesn\u2019t care about integers versus strings and other variable types.\u00a0 An experienced developer wants to know what the variable represents in the logical context of the method or system, not what type the variable is or how it works.\\n\\n<\/p>\n<h2>Example: learning to read<\/h2>\n<p>\\n\\nThink about what it is like to learn to read.\\n\\nWhen kids are learning to read, they start off by learning the phonetic sounds of letters.\\n\\nWhen young kids are reading books for the first time, they start out by sounding out each word.\u00a0 When they are reading, they are not focusing on the grammar or the thought being conveyed by the writing, so much as they are focusing on the very structure of the words themselves.\\n\\nImagine if this blog post was written in the form of an early reader.\\n\\nImagine if I constrained my vocabulary and sentence structure to that of a \u201cSee Spot Run\u201d book.\\n\\nWould you find my blog to be highly \u201creadable?\u201d\u00a0 Probably not, but kindergarteners would probably find it much more digestible.\u00a0 (Although they would most likely still snub the content.)\\n\\n<\/p>\n<div id=\"scid:8747F07C-CDE8-481f-B0DF-C6CFD074BF67:40d0f167-f8cb-459c-9d54-715662476024\" class=\"wlWriterEditableSmartContent\" style=\"float: right; margin: 0; display: inline; padding: 0;\"><a title=\"\" href=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2013\/04\/sheetmusic-8x6.jpg\" rel=\"thumbnail\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2013\/04\/sheetmusic.png\" alt=\"\" width=\"356\" height=\"215\" border=\"0\" \/><\/a><\/div>\n<p>\\n\\nYou\u2019d find the same scenario with experienced musicians, who can read sheet music easily versus beginners who would probably much prefer tablature.\\n\\nAn experienced musician would find sheet music much easier to read and understand than a musical description that said what keys on a piano to press or what strings on a guitar to pluck.\\n\\n<\/p>\n<h2>Readability constraints<\/h2>\n<p>\\n\\nJust like you are limited to the elegance with which you can express thoughts and ideas using the vocabulary and structure of an early reader book, you are also limited in the same way by both the programming language in which you program in and the context in which you program it.\\n\\nThis is better seen in an example though.\u00a0 Let\u2019s look at some assembly language.\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:cd7d7713-f0c1-4665-94c9-d8ae40a4e2d3\" class=\"wlWriterEditableSmartContent\" style=\"float: none; margin: 0; display: inline; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/40dacf04bfaede9a7ebf36c1c2fab06f.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\nThis assembly code will print \u201cHello World!\u201d to the screen in DOS.\\n\\nWith x86 assembly language, the vocabulary and grammar of the language is quite limited.\u00a0 It isn\u2019t easy to express complex code in the language and make it readable.\\n\\nThere is an upper limit on the readability of x86 assembly language, no matter how good of a programmer you are.\\n\\nNow let\u2019s look at Hello World in C#.\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:f85088fb-00cc-458d-9773-37005cc98094\" class=\"wlWriterEditableSmartContent\" style=\"float: none; margin: 0; display: inline; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/fe0150cfae1c29d89617944b01718e00.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\n<em>It\u2019s not a straight across the board comparison, because this version is using .NET framework in addition to the C# language, but for the purposes of this post we\u2019ll consider C# to include the base class libraries as well.<\/em>\\n\\nThe point though, is that with C#\u2019s much larger vocabulary and more complicated grammar, comes the ability to express more complex ideas in a more succinct and readable way.\\n\\nWant to know why Ruby got so popular for a while?\u00a0 Here is Hello World in Ruby.\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:2aa9d74a-2900-4c24-86c5-f58e5128a890\" class=\"wlWriterEditableSmartContent\" style=\"float: none; margin: 0; display: inline; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/c8dc1cdbba8427c6110be2d34512bb65.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\nThat\u2019s it, pretty small.\\n\\nI\u2019m not a huge fan of Ruby myself, but if you understand the large vocabulary and grammar structure of the Ruby language, you\u2019ll find that you can express things very clearly in the language.\\n\\nNow, I realize I am not comparing apples to apples here and that <em>Hello World<\/em> is hardly a good representation of a programming language\u2019s vocabulary or grammar.\\n\\nMy point is, <strong>the larger the vocabulary you have, the more succinctly ideas can be expressed, thus making them more readable, BUT only to those who have a mastery of that vocabulary and grammar.<\/strong>\\n\\n<\/p>\n<h2>What we can draw from all this?<\/h2>\n<p>\\n\\nSo, you might be thinking \u201coh ok, that\u2019s interesting\u2026 I\u2019m not sure if I totally agree with you, but I kind of get what you&#8217;re saying, so what&#8217;s the point?\u201d\\n\\nFair question.\\n\\nThere is quite a bit we can draw from understanding how vocabulary and experience affects readability.\\n\\nFirst of all, we can target our code for our audience.\\n\\n<strong>We have to think about who is going to be reading our code and what their vocabulary and experience level is.<\/strong>\\n\\nIn C#, it is commonly argued whether or not the conditional operator should be used.\\n\\nShould we write code like this:\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:e8860b75-fefd-4235-9855-58775e93d8ed\" class=\"wlWriterEditableSmartContent\" style=\"float: none; margin: 0; display: inline; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/d393aaaa5f7a1177050ef2b656b6f205.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\nOr should we write code like this:\\n\\n<\/p>\n<div id=\"scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:fdc9c04a-6538-4909-8e5d-4b241cf7f010\" class=\"wlWriterEditableSmartContent\" style=\"float: none; margin: 0; display: inline; padding: 0;\">\\n\\n<script src=\"https:\/\/gist.github.com\/simpleprogrammer-shared\/a6a48401a77b5ec5633c90218baa2a67.js\"><\/script>\\n\\n<\/div>\n<p>\\n\\nI used to be in the camp that said the second way was better, but now I find myself writing the first way more often.\u00a0 And if someone asks me which is better, my answer will be \u201cit depends.\u201d\\n\\nThe reason why it depends is because if your audience\u00a0isn&#8217;t\u00a0used to the conditional operator, they\u2019ll probably find code that uses it confusing.\u00a0 (They\u2019ll have to parse the vocabulary rather than focusing on the story.)\u00a0 But, if your audience is familiar with the conditional operator, the long version with an if statement, will seem drawn out and like a complete waste of space.\\n\\nThe other piece of information to gather from this observation is <strong>the value of having a large vocabulary in a programming language and having a solid understanding of that vocabulary and grammar.<\/strong>\\n\\nThe English language is a large language with a very large vocabulary and a ridiculous number of grammatical rules.\u00a0 Some people say that it should be easier and have a reduced vocabulary and grammar.\\n\\n<strong>If we made the English language smaller, and reduced the complex rules of grammar to a more much simple structure, we\u2019d make it much easier to learn, but we\u2019d make it harder to convey information.<\/strong>\\n\\nWhat we\u2019d gain in reduction of time to mastery, we\u2019d lose in its power of expressiveness.\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2><\/h2>\n<p>\\n\\n<\/p>\n<h2>One language to rule them all?<\/h2>\n<p>\\n\\nIt\u2019s hard to think of programming languages in the same way, because we typically don\u2019t want to invest in a single programming language and framework with the same fervor as we do a spoken and written language, but as repugnant as it may be, the larger we make programming languages, and the more complex we make their grammars, the more expressive they become and ultimately\u2014for those who achieve mastery of the vocabulary and grammar\u2014the more readable they become. (At least the potential for higher readability is greater.)\\n\\nDon\u2019t worry though, I\u2019m not advocating the creation of a huge complex programming language that we should all learn\u2026 at least not yet.\\n\\nThis type of thing has to evolve with the general knowledge of the population.\\n\\n<strong>What we really need to focus on now is programming languages with small vocabularies that can be easily understood and learned, even though they might not be as expressive as more complicated languages.<\/strong>\\n\\nEventually when a larger base of the population understands how to code and programming concepts, I do believe there will be a need for a language as expressive to computers and humans alike, as English and other written languages of the world are.\\n\\nWhat do you think?\u00a0 Should we have more complicated programming languages that take longer to learn and master in order to get the benefit of an increased power of expression, or is it better to keep the language simple and have more complicated and longer code?\\n\\n<em>Clean code alone does not make a successful programmer. If you feel you&#8217;re great at your job but severely undervalued, take a look at my course, <a href=\"https:\/\/simpleprogrammer.com\/store\/products\/how-to-market-yourself\/\">&#8220;How to Market Yourself as a Software Developer&#8221;.<\/a><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You often hear about how important it is to write \u201creadable code.\u201d\\n\\nDevelopers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion.\\n\\nBut\u00a0have you ever stopped to think about what really makes code readable?\\n\\n \\n\\n \\n\\n The standard answer \\n\\nYou would probably agree that the following things,&#8230;<\/p>\n","protected":false},"author":2,"featured_media":25749,"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":[1934,264,4909],"tags":[],"class_list":["post-1928","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-language","category-learning","category-psychology"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What Makes Readable Code: Not What You Think<\/title>\n<meta name=\"description\" content=\"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?\" \/>\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\/what-makes-code-readable-not-what-you-think\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What Makes Readable Code: Not What You Think\" \/>\n<meta property=\"og:description\" content=\"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2013-04-14T19:16:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-09T22:01:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.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=\"author\" content=\"John Sonmez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"John Sonmez\" \/>\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\\\/what-makes-code-readable-not-what-you-think\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"What Makes Readable Code: Not What You Think\",\"datePublished\":\"2013-04-14T19:16:05+00:00\",\"dateModified\":\"2018-01-09T22:01:06+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/\"},\"wordCount\":1848,\"commentCount\":50,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Legible-Code-1.png\",\"articleSection\":[\"Language\",\"Learning\",\"Psychology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/\",\"name\":\"What Makes Readable Code: Not What You Think\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Legible-Code-1.png\",\"datePublished\":\"2013-04-14T19:16:05+00:00\",\"dateModified\":\"2018-01-09T22:01:06+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"description\":\"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Legible-Code-1.png\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/10\\\/Legible-Code-1.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/what-makes-code-readable-not-what-you-think\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What Makes Readable Code: Not What You Think\"}]},{\"@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\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\",\"name\":\"John Sonmez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g\",\"caption\":\"John Sonmez\"},\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/author\\\/jsonmez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What Makes Readable Code: Not What You Think","description":"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?","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\/what-makes-code-readable-not-what-you-think\/","og_locale":"en_US","og_type":"article","og_title":"What Makes Readable Code: Not What You Think","og_description":"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?","og_url":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/","og_site_name":"Simple Programmer","article_published_time":"2013-04-14T19:16:05+00:00","article_modified_time":"2018-01-09T22:01:06+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.png","type":"image\/png"}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"What Makes Readable Code: Not What You Think","datePublished":"2013-04-14T19:16:05+00:00","dateModified":"2018-01-09T22:01:06+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/"},"wordCount":1848,"commentCount":50,"image":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.png","articleSection":["Language","Learning","Psychology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/","url":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/","name":"What Makes Readable Code: Not What You Think","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.png","datePublished":"2013-04-14T19:16:05+00:00","dateModified":"2018-01-09T22:01:06+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"description":"You often hear about how important it is to write \u201creadable code.\u201d Developers have pretty strong opinions about what makes code more readable. The more senior the developer, the stronger the opinion. But have you ever stopped to think about what really makes code readable?","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.png","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/what-makes-code-readable-not-what-you-think\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"What Makes Readable Code: Not What You Think"}]},{"@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":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67","name":"John Sonmez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dc2f18dfa76e017566ce607de002d7abe4acfd5ec19a6db82c180b00867b8d94?s=96&d=mm&r=g","caption":"John Sonmez"},"url":"https:\/\/simpleprogrammer.com\/author\/jsonmez\/"}]}},"_links":{"self":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1928","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/comments?post=1928"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/1928\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/25749"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=1928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=1928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=1928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}