{"id":22020,"date":"2017-02-13T10:00:41","date_gmt":"2017-02-13T15:00:41","guid":{"rendered":"https:\/\/simpleprogrammer.com\/?p=22020"},"modified":"2023-02-12T01:02:29","modified_gmt":"2023-02-12T06:02:29","slug":"maintaining-code","status":"publish","type":"post","link":"https:\/\/simpleprogrammer.com\/maintaining-code\/","title":{"rendered":"A Software Developer&#8217;s Guide to Maintaining Code"},"content":{"rendered":"<p>When you first think about becoming a software developer, you probably have dreams of creating exciting new features, playing with new technologies, and writing some really cool and interesting code.\\n\\nWhat you probably don\u2019t think about is working on a 10-year-old, crufty application written by some guy who left the company a long time ago, fixing the bugs he left behind.\\n\\nThe truth of the matter is that <strong>you\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code.<\/strong>\\n\\nThat\u2019s how life is. Just one of those things.\\n\\nThis fact doesn\u2019t mean, though, that you\u2019ll only be working on maintaining old VB6 applications written decades ago.\\n\\nIn fact, probably a large amount of the code you\u2019ll be maintaining is your own.\\n\\nSo, it\u2019s probably a good idea if you learn two things.\\n\\nFirst, you\u2019ll need to know <strong>how to properly maintain code<\/strong> so that it doesn\u2019t get worse and worse over time until it finally falls apart.\\n\\nAnd second, you\u2019ll need to learn how <strong>to write good code that is easy to maintain<\/strong>, so that developers who later have to maintain your code don\u2019t track you down, come to your house, and kill you in your sleep.\\n\\nIn this chapter, we are going to talk about why learning how to maintain code and write maintainable code <a href=\"https:\/\/simpleprogrammer.com\/technical-skills-software-developer\/\">is so important<\/a>, and I\u2019ll give you some practical advice on how to do both of those things.\\n\\nSound good?\\n\\n<\/p>\n<h2>A Majority of Your Career Will Be Spent Maintaining Code<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-22024\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Maintaining-Code-1-1024x576.png\" alt=\"\" width=\"759\" height=\"427\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Maintaining-Code-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Maintaining-Code-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Maintaining-Code-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Maintaining-Code-1.png 1280w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/>\\n\\nI\u2019ve already mentioned this, but it\u2019s worth mentioning again because it\u2019s so true.\\n\\n<strong>In one form or another, you are going to be maintaining code.<\/strong>\\n\\nNew software gets created all the time, but every new software application is expected to have some sort of lifespan that is hopefully longer than the time it took to create it.\\n\\n<strong>This means that there will always be more old software out there than new software.<\/strong> (Unless we have a ridiculously high influx of new software and a bunch of old software dies off at the same time, but that is very unlikely to happen.)\\n\\nThat old software that is out there will constantly need to be improved and maintained.\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/customer-centric-programming\/\">Customers will find bugs that need to be fixed<\/a>.\\n\\nNew features will need to be added, or existing features will need to be modified.\\n\\n<strong>Production software is like a living, breathing organism, always growing and changing or slowly dying.<\/strong>\\n\\nWhy am I telling you this?\\n\\nDo I just want to dash your hopes against the walls?\\n\\nNo, I want you to have <strong>realistic expectations<\/strong> of what you will be doing in your career as a software developer.\\n\\nOftentimes, eager, well-meaning hiring managers can paint a rosy picture of a job, telling you that you\u2019ll be working on <a href=\"https:\/\/simpleprogrammer.com\/dont-get-obsessed-design-patterns\/\">designing and coding<\/a> a brand new system from scratch using the latest technologies.\\n\\nWhile some of your job might be doing this, more often than not, a majority of that job\u2014no matter how good it sounds\u2014will involve maintaining an existing system.\\n\\nAgain, it\u2019s just the way life works.\\n\\nDoes this mean you can never get a job where you can completely write a new system from scratch?\\n\\nNo, it definitely happens, but don\u2019t expect it all the time.\\n\\nEven if you do, expect that at some point in time, you or someone else will have to maintain that code.\\n\\nThat\u2019s all.\\n\\n<\/p>\n<h2>Great Developers Write Maintainable Code<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-22025 alignright\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Depositphotos_123749090_s-2015-1.jpg\" alt=\"\" width=\"357\" height=\"343\" \/><\/h2>\n<p>\\n\\nNow that you have your expectations properly set, I\u2019m going to try and inspire you to write \u201cthe best darn maintainable code you can,\u201d because by gosh, it\u2019s just a swell thing to do.\\n\\nOne incontrovertible fact I have found during my many years of working as a software developer and working with software developers is that <strong>great developers write highly maintainable code.<\/strong>\\n\\nIn fact, I would say that the sole criteria I judge a programmer on is how maintainable their code is.\\n\\nThis might seem silly.\\n\\nYou might think I\u2019m making this up just to make my point in this chapter.\\n\\nBut I\u2019m telling you, it\u2019s true. Here\u2019s why.\\n\\nGreat developers know that <strong>the majority of the life of any code they write will be spent in maintenance phase.<\/strong>\\n\\nGreat developers know that <strong>the most valuable code they write is code that lasts a long time and doesn\u2019t have to be scrapped and rewritten.<\/strong>\\n\\nRather than being clever and <a href=\"https:\/\/simpleprogrammer.com\/improve-coding-speed\/\">as fast or efficient as possible<\/a>, great developers optimize for maintainability.\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/clean-code-principles-better-programmer\/\">They write <strong>good, clean code<\/strong><\/a> that can be <strong>easily understood, modified, and maintained.<\/strong>\\n\\nThey <strong>create flexible designs<\/strong> that are loosely coupled, so that if one thing changes in the system, it doesn\u2019t affect every other component of the system.\\n\\nThey take extra care to make sure what they do is <a href=\"https:\/\/simpleprogrammer.com\/write-visual-end-user-guide\/\"><strong>well documented<\/strong><\/a> and as <strong>self-explanatory<\/strong> as possible.\\n\\nThey\u2019ve spent enough time looking at someone else\u2019s code\u2014or their own\u2014and trying to maintain it that they know the best code they can write is the code that is the most maintainable.\\n\\n<\/p>\n<h2>The Boy Scout Rule<\/h2>\n<p>\\n\\nOne secret to being great at maintaining code is the Boy Scout Rule.\\n\\nThis rule originates from the Boy Scouts of America who emphasize a simple rule for camping:\\n\\n<strong>\u201cLeave the campground cleaner than you found it.\u201d<\/strong>\\n\\nThis is a great rule to apply to multiple areas of your life, but it\u2019s especially useful in software development.\\n\\n<strong>Leave the code better than you found it.<\/strong>\\n\\nIt\u2019s really that simple.\\n\\n<strong>When you are working on some code, <a href=\"https:\/\/simpleprogrammer.com\/effective-debugging\/\">perhaps fixing a bug<\/a> or adding a new feature, try to leave that code in a slightly better state than it was when you found it.<\/strong>\\n\\nIt might mean writing an extra unit test to make the code a little more robust for the next developer who comes along and has to change something in it.\\n\\nIt might mean renaming some variables in the code to make the meaning more clear.\\n\\nIt might mean grouping some functionality <a href=\"https:\/\/simpleprogrammer.com\/static-methods-will-shock-you\/\">into a method<\/a> or procedure to reduce some redundancy in the code or to make it easier to understand.\\n\\nIt might even involve refactoring a large chunk of the code to implement a cleaner, more simple design.\\n\\nAs long as you are following this rule, <strong>the code will gradually get better over time<\/strong>\u2014or at least the rate of entropy will decline severely.\\n\\nThis basic rule is the most simple secret for maintaining an existing codebase.\\n\\n<\/p>\n<h2>Readability is of Utmost Importance<\/h2>\n<p>\\n\\n<img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-22026\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Readability-1-1024x576.png\" alt=\"\" width=\"772\" height=\"434\" srcset=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Readability-1-1024x576.png 1024w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Readability-1-300x169.png 300w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Readability-1-768x432.png 768w, https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Readability-1.png 1280w\" sizes=\"auto, (max-width: 772px) 100vw, 772px\" \/>\\n\\n<strong><a href=\"https:\/\/simpleprogrammer.com\/2013\/04\/14\/what-makes-code-readable-not-what-you-think\/\">One of the most important factors influencing the maintainability of code is its readability<\/a>.<\/strong>\\n\\nThe more readable the code is, the easier it is to maintain that code.\\n\\nThe more cryptic and difficult to understand code is, the more difficult it is to maintain.\\n\\nIt\u2019s that plain and simple.\\n\\n<strong>Too many developers try to write succinct and clever code.<\/strong>\\n\\nWhile being succinct can be valuable, being terse and clever is an absolute recipe for disaster.\\n\\nWhy?\\n\\nBecause <strong>code is <a href=\"https:\/\/www.youtube.com\/watch?v=RLxHNRY6-bU\">read more than it is written<\/a><\/strong>.\\n\\nEvery time a programmer is trying to understand some workflow passing through your code so they in turn can add a new feature, modify an existing one, or troubleshoot a bug, they are going to need to understand what your code is doing.\\n\\n<strong>The easier it is for them to understand, the easier it will be for them to make the correct changes to the system and the less time it will take.<\/strong>\\n\\nIf the code is obscure and difficult to understand, it\u2019s going to take extra time whenever another developer\u2014or even yourself\u2014has to examine and try to understand that code.\\n\\nIt is also highly likely that someone will misunderstand the code, and may then make an error when changing the code or another part of the system which uses that code, further degrading the system.\\n\\nThe fact of the matter is that <strong>readable code is just easier to maintain<\/strong>, period.\\n\\nTherefore, when writing code that is meant to be maintained, strive for readability above all else.\\n\\n<\/p>\n<h2>Refactor Code to Make It Better<\/h2>\n<p>\\n\\nWe\u2019ve already talked about the Boy Scout Rule, but let\u2019s dive a little deeper into what it means to \u201cmake code better.\u201d\\n\\nHow can you make code better?\\n\\nA whole book could be written on the subject of refactoring\u2014<a href=\"http:\/\/amzn.to\/2c2FgYt\">and several have been<\/a>\u2014but in this section, I\u2019m going to introduce you to the basics, and you can practice and learn on your own.\\n\\n<strong>Refactoring is essentially improving the design of existing code.<\/strong>\\n\\nTo me, refactoring means <strong>making existing code more readable without changing its functionality.<\/strong>\\n\\nThe \u201cwithout changing its functionality\u201d part is pretty important because you can\u2019t go around leaving code better than you found it if you are also changing the functionality.\\n\\nYou could be introducing bugs and making the code worse.\\n\\nNot that you can\u2019t ever change functionality when you improve code, but that isn\u2019t the point of refactoring.\\n\\n<strong>The point of refactoring is to take some existing code and make it even better.<\/strong>\\n\\nBetter could\u2014and really, always should\u2014mean more readable and maintainable.\\n\\nHowever, it could also mean that you\u2019ve reduced the total lines of code by <a href=\"https:\/\/simpleprogrammer.com\/types-of-duplication-in-code\/\">eliminating some duplication<\/a> or organizing it in a different way.\\n\\nIt could mean that you\u2019ve improved the overall architecture to make it more flexible and robust against further changes.\\n\\nThere are many ways to refactor code, but the big rule in refactoring is to not change functionality but to <a href=\"https:\/\/simpleprogrammer.com\/reduce-software-bugs-quality-code\/\">make the code better<\/a>.\\n\\nRefactoring and unit testing go hand-in-hand since it\u2019s difficult to know that you haven\u2019t changed the functionality of code if you have no way to test it.\\n\\nIt\u2019s a good idea to have some unit tests in place before you do refactoring, especially if it\u2019s a non-trivial change.\\n\\nThere are also some modern refactoring tools which can assist you and can pretty much guarantee that the refactorings won\u2019t change the functionality of the code.\\n\\nMost modern IDEs have some of these tools baked in.\\n\\nThink of it as rearranging a mathematics equation without altering their meaning.\\n\\nYou can always be sure that 4x = 8 is the same as 2x = 4 or x = 2.\\n\\nYou don\u2019t have to prove it.\\n\\n<\/p>\n<h2>Automation Is Essential<img loading=\"lazy\" decoding=\"async\" class=\" wp-image-22027 alignright\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/Depositphotos_86227536_s-2015-1.jpg\" alt=\"\" width=\"352\" height=\"352\" \/><\/h2>\n<p>\\n\\nIt\u2019s really difficult to maintain software on which you have to manually build and manually run tests to make sure nothing breaks.\\n\\n<strong>The faster you can make changes and test changes, the better the safety net you\u2019ll have, which will protect you from adding new bugs and errors to an existing codebase.<\/strong>\\n\\nThis is why automation is essential to increasing the maintainability of a software project.\\n\\nHaving an automated build, a continuous integration system, and automated tests make it incredibly simple to make changes to the code and quickly find out if you broke anything.\\n\\nThis quick cycle of feedback gives developers more confidence in their changes and also allows them to refactor the code, making it better without fear.\\n\\n<\/p>\n<h2>If You Write Comments, Write Good Ones<\/h2>\n<p>\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/2015\/04\/13\/why-comments-are-stupid-a-real-example\/\">I\u2019m not a huge fan of writing comments in code<\/a>.\\n\\nYes, I know this is heresy.\\n\\nBut <strong>I\u2019d rather write clear, expressive code which is self-explanatory than write cryptic code which can only be understood when reading through the comments<\/strong>\u2014which, by the way, hopefully have been maintained along with the code.\\n\\nI\u2019d rather see you write clean, readable code than add a bunch of comments to the code which usually end up outdated.\\n\\nBut, <strong>if you do write comments, make sure they are really good.<\/strong>\\n\\nMake sure the comments clearly explain something that is non-obvious and needs to be explained.\\n\\n<strong>Cryptic comments are sometimes as bad, or worse, than cryptic code<\/strong> because you can at least figure out what cryptic code does. You can\u2019t really figure out what a cryptic comment might have meant.\\n\\nAlong with comments in the code, <strong>make your commit messages as clear and helpful as possible<\/strong> as well.\\n\\nClear messages also contribute to the maintainability of a codebase because commit messages give us a history of not just what happened to code over time, but why.\\n\\nThat why can be crucial when trying to understand some code or change that wasn\u2019t apparent, especially when it involves fixing a tricky bug.\\n\\n<\/p>\n<h2>Resources for Learning to Write Maintainable Code<\/h2>\n<p>\\n\\nMaintaining code is tricky.\\n\\nIt involves quite a few skills from writing clean code, to refactoring, to design and even infrastructure concerns like devops and automation.\\n\\nI\u2019ve decided to include <strong>a list of some valuable resources <\/strong>which can help you become better at both writing maintainable code and maintaining existing code that you didn\u2019t write.\\n\\n<strong><a href=\"http:\/\/amzn.to\/2c2E0F1\"><em>Clean Code<\/em> by Robert Martin<\/a><\/strong> \u2013 I\u2019ve mentioned this book a few times, but it\u2019s one of the best books about writing clean, readable code, and it also includes great information about design and refactoring for maintainability.\\n\\n<strong><a href=\"http:\/\/amzn.to\/2ch6jgD\"><em>Code Complete <\/em>by Steve McConnell<\/a> \u2013<\/strong> Again, I\u2019ve mentioned this book a few times already, but it\u2019s another great book about writing good, maintainable code. You\u2019ll find this book goes into some of the low-level, structural details of writing good, readable code. Read it.\\n\\nCombined, <em>Clean Code<\/em> and<em> Code Complete<\/em> will give you a solid base and understanding of what makes good, clean, readable code and how to write and structure your code, so I highly recommend reading both books.\\n\\n<strong><a href=\"http:\/\/amzn.to\/2cmhvKl\"><em>Working Effectively With Legacy Code<\/em> by Michael Feathers<\/a><\/strong> \u2013 This is a classic book about maintaining existing code. It dives pretty deep down into the nitty-gritty of legacy systems and how to deal with code that someone else wrote. Every software developer should read this book, since every software developer is likely to spend a majority of their time working with legacy code.\\n\\n<strong><a href=\"http:\/\/amzn.to\/2c2FgYt\"><em>Refactoring <\/em>by Martin Fowler<\/a><\/strong> \u2013 Another classic book which all software developers should read. This book goes over all the major refactorings you can do to restructure code without changing its functionality.\\n\\nWell, there\u2019s the gist of it.\\n\\nJust remember the Boy Scout Rule, and you\u2019ll do ok.\\n\\nOh, also, don\u2019t worry: you\u2019ll get plenty of practice maintaining code over the course of your software development career.\\n\\nGood luck.\\n\\n<\/p>\n<hr \/>\n<p>\\n\\n<a href=\"https:\/\/simpleprogrammer.com\/products\/careerguide\/\"><img decoding=\"async\" class=\"aligncenter\" src=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/06\/Site-Ad.png\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you first think about becoming a software developer, you probably have dreams of creating exciting new features, playing with new technologies, and writing some really cool and interesting code.\\n\\nWhat you probably don\u2019t think about is working on a 10-year-old, crufty application written by some guy who left the company a long time ago, fixing&#8230;<\/p>\n","protected":false},"author":2,"featured_media":22030,"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,44070,31679,162229803,54712,162229840,12],"tags":[],"class_list":["post-22020","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-advice","category-automation","category-process-improvement","category-programming","category-refactoring","category-skills","category-testing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>A Software Developer&#039;s Guide to Maintaining Code - Simple Programmer<\/title>\n<meta name=\"description\" content=\"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here&#039;s how to do it well.\" \/>\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\/maintaining-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"A Software Developer&#039;s Guide to Maintaining Code - Simple Programmer\" \/>\n<meta property=\"og:description\" content=\"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here&#039;s how to do it well.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/simpleprogrammer.com\/maintaining-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Simple Programmer\" \/>\n<meta property=\"article:published_time\" content=\"2017-02-13T15:00:41+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-12T06:02:29+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-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=\"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=\"12 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/\"},\"author\":{\"name\":\"John Sonmez\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"headline\":\"A Software Developer&#8217;s Guide to Maintaining Code\",\"datePublished\":\"2017-02-13T15:00:41+00:00\",\"dateModified\":\"2023-02-12T06:02:29+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/\"},\"wordCount\":2540,\"commentCount\":3,\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/A-Software-Developers-Guide-to-Maintaining-Code.png\",\"articleSection\":[\"Advice\",\"Automation\",\"Process Improvement\",\"Programming\",\"Refactoring\",\"Skills\",\"Testing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/\",\"name\":\"A Software Developer's Guide to Maintaining Code - Simple Programmer\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/A-Software-Developers-Guide-to-Maintaining-Code.png\",\"datePublished\":\"2017-02-13T15:00:41+00:00\",\"dateModified\":\"2023-02-12T06:02:29+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/#\\\/schema\\\/person\\\/1abc70edfb189184827740310672de67\"},\"description\":\"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here's how to do it well.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#primaryimage\",\"url\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/A-Software-Developers-Guide-to-Maintaining-Code.png\",\"contentUrl\":\"https:\\\/\\\/simpleprogrammer.com\\\/wp-content\\\/uploads\\\/2017\\\/02\\\/A-Software-Developers-Guide-to-Maintaining-Code.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/simpleprogrammer.com\\\/maintaining-code\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/simpleprogrammer.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"A Software Developer&#8217;s Guide to Maintaining 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\":\"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":"A Software Developer's Guide to Maintaining Code - Simple Programmer","description":"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here's how to do it well.","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\/maintaining-code\/","og_locale":"en_US","og_type":"article","og_title":"A Software Developer's Guide to Maintaining Code - Simple Programmer","og_description":"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here's how to do it well.","og_url":"https:\/\/simpleprogrammer.com\/maintaining-code\/","og_site_name":"Simple Programmer","article_published_time":"2017-02-13T15:00:41+00:00","article_modified_time":"2023-02-12T06:02:29+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-Code.png","type":"image\/png"}],"author":"John Sonmez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"John Sonmez","Est. reading time":"12 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#article","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/"},"author":{"name":"John Sonmez","@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"headline":"A Software Developer&#8217;s Guide to Maintaining Code","datePublished":"2017-02-13T15:00:41+00:00","dateModified":"2023-02-12T06:02:29+00:00","mainEntityOfPage":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/"},"wordCount":2540,"commentCount":3,"image":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-Code.png","articleSection":["Advice","Automation","Process Improvement","Programming","Refactoring","Skills","Testing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/simpleprogrammer.com\/maintaining-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/","url":"https:\/\/simpleprogrammer.com\/maintaining-code\/","name":"A Software Developer's Guide to Maintaining Code - Simple Programmer","isPartOf":{"@id":"https:\/\/simpleprogrammer.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#primaryimage"},"image":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#primaryimage"},"thumbnailUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-Code.png","datePublished":"2017-02-13T15:00:41+00:00","dateModified":"2023-02-12T06:02:29+00:00","author":{"@id":"https:\/\/simpleprogrammer.com\/#\/schema\/person\/1abc70edfb189184827740310672de67"},"description":"You\u2019ll spend much more time over the course of your software development career maintaining code than you will writing new code. Here's how to do it well.","breadcrumb":{"@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/simpleprogrammer.com\/maintaining-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#primaryimage","url":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-Code.png","contentUrl":"https:\/\/simpleprogrammer.com\/wp-content\/uploads\/2017\/02\/A-Software-Developers-Guide-to-Maintaining-Code.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/simpleprogrammer.com\/maintaining-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/simpleprogrammer.com\/"},{"@type":"ListItem","position":2,"name":"A Software Developer&#8217;s Guide to Maintaining 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":"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\/22020","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=22020"}],"version-history":[{"count":0,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/posts\/22020\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media\/22030"}],"wp:attachment":[{"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/media?parent=22020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/categories?post=22020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/simpleprogrammer.com\/wp-json\/wp\/v2\/tags?post=22020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}