{"id":69454,"date":"2017-10-09T10:01:20","date_gmt":"2017-10-09T07:01:20","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=69454"},"modified":"2019-02-14T13:14:02","modified_gmt":"2019-02-14T11:14:02","slug":"5-tips-increase-code-quality","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html","title":{"rendered":"5 Tips to Increase your Code Quality"},"content":{"rendered":"<p>Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you <em>can <\/em>write high-quality code, and I can show you how to do it, too.<\/p>\n<p>Before we get started, I want to define what exactly I mean when I say \u201chigh-quality code.\u201d When I think of high-quality Code, I think of code that:<\/p>\n<ul>\n<li>you can read once and understand<\/li>\n<li>has minimal bugs<\/li>\n<li>follows the standards of the language it\u2019s written in<\/li>\n<li>does what you expect it to do, and has proof of its success<\/li>\n<\/ul>\n<p>Now that we know what we\u2019re aiming for, we need to learn how to write clean code. But how does one do that? In the Simple Programmer post <em><a href=\"https:\/\/simpleprogrammer.com\/2016\/07\/21\/write-clean-code\/\">How To Write Clean Code<\/a><\/em>, John recommends reading two books: <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/0735619670\/makithecompsi-20\">Code Complete<\/a> and <a href=\"http:\/\/www.amazon.com\/exec\/obidos\/ASIN\/0132350882\/makithecompsi-20\">Clean Code<\/a>. I highly encourage you to take his advice. However, I know you\u2019re busy, and you might not have the time to read both of those books. Let me break it down for you by sharing the most important things I\u2019ve learned about producing quality code during my years in the field.<\/p>\n<p>I\u2019ve had the pleasure of working on <em>a lot<\/em> of projects over the years. I\u2019ll be the first to admit that they haven\u2019t always turned out the greatest, but they have always helped me learn how to become better. Today, I am confident in my ability to write quality code. Without further ado, the following is a list of tips and tricks I\u2019ve compiled that have helped me to really improve the quality of my own code.<\/p>\n<h2>1. Use a Linter<\/h2>\n<p>So many problems can be solved by using a code linter. For anyone who\u2019s unfamiliar with linters, a code linter reads your code and outputs errors and warnings if your code is not compliant with the specifications and standards of a language. These warnings may seem insignificant at the time, but, like the lint in your house, they add up over time. To get the most out of using a linter, I would suggest the following tricks:<\/p>\n<h3>Enforce the Language or Framework Standard<\/h3>\n<p>I highly recommend running a linter on your code to enforce the most widely accepted set of standards for the language or framework you\u2019re working in. For example, if you\u2019re writing Python, I would suggest you use the pylint package, which enforces rules defined in<a href=\"https:\/\/www.python.org\/dev\/peps\/pep-0008\/\"> PEP-8<\/a>. If you\u2019re writing an Angular app, I would suggest using a linter configuration that follows the Angular style guide.<\/p>\n<h3>Integrate Your Linter With CI<\/h3>\n<p>A linter really isn\u2019t going to help you at all unless you\u2019re using it regularly, and from my experience, developers don\u2019t typically do this unless they\u2019re forced to. It only takes minutes to learn how to use a linter properly, so why do so many developers neglect to do so? I think it\u2019s because we as developers are often overconfident in our code and we hate adding additional steps to our development process.<\/p>\n<p>For this reason, I suggest you set up a continuous integration build pipeline with a service like Atlassian\u2019s Bamboo, Jenkins, or Travis CI. In your build pipeline, you should make linting the first step. That way, if your code doesn\u2019t pass the lint test, it doesn\u2019t get built, tested, or published.<\/p>\n<p>Using a linter is all about making it as hard as possible for you to write crappy code.<\/p>\n<h2>2. Comment Your Code \u201cJust Enough\u201d<\/h2>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Comment-Code-1024x576.png\"><img decoding=\"async\" class=\"aligncenter wp-image-69463\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Comment-Code-1024x576.png\" alt=\"\" width=\"860\" height=\"484\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Comment-Code-1024x576.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Comment-Code-1024x576-300x169.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Comment-Code-1024x576-768x432.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>There are usually two types of developer when it comes to commenting code: the type that comments everything and the type that doesn\u2019t comment anything. The truth is, there are benefits and drawbacks to both sides. One the one hand, leaving too many comments in your code can just make it more cluttered and harder to read. On the other hand, having no comments whatsoever can leave a future developer in a state of turmoil.<\/p>\n<p>The secret is that you should add comments when they provide value. For me personally, I find the following tricks valuable for writing good, meaningful comments:<\/p>\n<h3>Top-of-File Comments<\/h3>\n<p>I find it helpful to write a 2\u20133 line comment at the top of a file to give you a brief overview of the goal and the scope of the code within. I shouldn\u2019t have to spend more than 10 seconds looking at a file to know what its primary focus is.<\/p>\n<p>However, I don\u2019t recommend following the standard of putting your name, email address, date, filename, license, etc. in the \u201ctop-of-file\u201d comment. All of this information should be available elsewhere, and it will just clutter your file.<\/p>\n<h3>Class-Level Comments<\/h3>\n<p>I feel the same way about leaving class-level comments. I think it\u2019s useful to leave a brief comment at the top of every class explaining the primary goals and scope of the class.<\/p>\n<p>However, if your class name is \u201cCarObject,\u201d please don\u2019t leave a comment saying, \u201cAn object to represent Cars.\u201d Leave meaningful comments or don\u2019t leave any at all. If it were me, I would say something more along the lines of, \u201cRepresents Cars and contains references to their parts. Mostly used by X to do Y.\u201d<\/p>\n<h3>Function-Level Comments<\/h3>\n<p>Functions are a little trickier to determine the value of adding comments to them. On one hand, I believe long functions with complex logic should have comments, if only to save me the time it takes to read the code to understand what it does. On the other hand, I don\u2019t believe simple get\/set logic requires a comment. For example, if I have a class level variable named \u201cx,\u201d I would not comment the function entitled \u201cget_x().\u201d This produces clutter with no value.<\/p>\n<p>However, if I had a 100-line function called \u201ccalculate_xyz(),\u201d I would leave a comment at the top of that function to let the developer know exactly what the function does. This means describing the inputs, the logic performed, and the outputs. At a minimum, this comment saves the developer from having to read the code in the function to know what it does. It could be the difference between reading 2\u20133 lines to get a basic understanding and reading 100+ lines for a deeper, but often unnecessary, level of understanding (especially when the developer is only concerned with the inputs\/outputs of the function).<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>Line Comments<\/h3>\n<p>I try to use comments inside my code as infrequently as I can. If code is so complex that after reading the file, class, function comment, and the code itself you still don\u2019t understand it, it probably needs to be refactored. The main point is this: try your best to write code that you can understand without having to re-read. If your code can be read once and understood, you won\u2019t need comments cluttering up the innards of your code, and your co-workers will appreciate how comprehensive and concise it is.<\/p>\n<h2>3. Writing Legible Code<\/h2>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1-1024x576.png\"><img decoding=\"async\" class=\"aligncenter wp-image-69464\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1-1024x576.png\" alt=\"\" width=\"860\" height=\"484\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1-1024x576.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1-1024x576-300x169.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Legible-Code-1-1024x576-768x432.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>One of the most important parts of writing quality code is writing legible code. After you write some code, take a short break for however long it takes you to clear it out of your head (this break could be hours, days, or weeks). When you return to the code, if you can\u2019t understand it by reading through it once, it should be refactored in some way, shape, or form.<\/p>\n<p>The following tricks have helped me to write more legible code. These might seem like they don\u2019t help all that much, but making your code as legible as possible can make a world of difference to someone who has to maintain it in the future.<\/p>\n<h3>Use Well-Formed Names<\/h3>\n<p>Use well-named functions, classes, and variables. A name should tell you the microscopic story of how a thing is used and what it represents. It shouldn\u2019t be a single letter, like \u201cx,\u201d and it shouldn\u2019t be a 70-character-long sentence full of underscores.<\/p>\n<h3>Suffix Variables and Functions With Units<\/h3>\n<p>For variables and functions dealing with units, append the unit to the end of them. For example, if I have variable called \u201cwidth\u201d that represents the width of an element in pixels, it would be better named \u201cwidth_px.\u201d Using this naming scheme ensures the person using the variable cannot overlook the units it is in. A simple thing like using a variable\u2019s unit in its name can really help to mitigate critical bugs in production.<\/p>\n<h3>Stick to the Standards<\/h3>\n<p>Use the language standards for variables, functions, strings, comments, etc. It\u2019s not necessarily bad to do things differently, but it can throw people off\u2014especially when they\u2019re trying to remember what a function\/variable was named, going to search for it, and struggling to remember the right nomenclature.<\/p>\n<p>If you\u2019re using Python, name your classes with Title case and your functions\/variables in snake case.<\/p>\n<h3>Have a Healthy Grouping of Common Ideas in Files<\/h3>\n<p>Don\u2019t put too much information in a single file. I like to stick to a \u201cone class per file\u201d rule. And if the code I\u2019m writing doesn\u2019t necessarily use classes, I try to group the functions by their core goal and separate files that way.<\/p>\n<p>Good separation of common code into separate files can help developers find the code they&#8217;re looking for sooner, as well as help them digest the information they&#8217;re looking at within the files faster. For example, if all I care about right now is X, and X, Y, Z are in a file together, it\u2019s going to be harder for me to digest the information pertaining to X compared to if X were in a separate file.<\/p>\n<h3>Use of Single Quotes vs. Double Quotes<\/h3>\n<p>This convention might be kind of controversial, so take it or leave it as you will, but it\u2019s one I\u2019ve grown to love when dealing with loosely typed languages like Python and JavaScript.<\/p>\n<p>If your language supports representing strings with both single quotes and double quotes, consider using double quotes for strings that could potentially be displayed to the end-user, and single quotes for internal-only strings. Distinctly identifying strings used internally and strings displayed to the user makes you aware of a piece of code\u2019s impact at a glance, should you modify its value.<\/p>\n<h2>4. Testing Your Code<\/h2>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768.jpg\"><img decoding=\"async\" class=\"aligncenter wp-image-69465 size-medium\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768-300x300.jpg\" alt=\"\" width=\"300\" height=\"300\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768-300x300.jpg 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768-150x150.jpg 150w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768.jpg 768w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Depositphotos_149034603_l-2015-1-768x768-70x70.jpg 70w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In the beginning of this article, I mentioned that in order for code to be considered high quality, you should be able to prove it functions properly. Well, the proof is in the pudding, and the pudding is this: you need to provide a sufficient amount of testing to prove to an outsider that your code works the way you intended it to.<\/p>\n<p>I may seem like just another person preaching good software testing\u2014and that\u2019s because software testing truly is so important to writing quality code. You need to test the expected cases, the edge cases, and the failure cases of your code. If you can be certain that your code will only do exactly what you\u2019ve seen it do in your tests, then you\u2019ve made a great leap towards high-quality code.<\/p>\n<p>Below are a few tricks that will help you best utilize software testing to boost the quality of your code:<\/p>\n<h3>Test-Driven Development<\/h3>\n<p>Yes, the fabled TDD. If you strictly adhere to the process of writing good, quality tests first, it can do wonders for your code. This is for a number of reasons.<\/p>\n<p>First, if you\u2019re thinking about your test cases before writing your code, then you start developing with a clear idea of what your code needs as input and what it produces as output. Oftentimes, we don\u2019t think about our test cases upfront. As a result, we don\u2019t have the foresight about our program that we would have otherwise had. I\u2019ve found that if I don\u2019t think about my test cases upfront, I often have to rewrite parts of my code, sometimes several times, before calling it done.<\/p>\n<p>It also forces you to write the tests, obviously. Sometimes after we write code, we look at it and say, \u201cThat\u2019s really simple; it\u2019d be a waste of time to test that.\u201d If you\u2019re writing tests first, you don\u2019t give yourself the chance to cop-out later on. If you do forsake testing, you won\u2019t be able to truly prove that your code does what you intend it to. As a result, you\u2019ll be more likely to find bugs in your code.<\/p>\n<p>Another good reason I like this approach is that if you write good enough test cases upfront, you can instantly tell when your code crosses the line from incomplete to complete. Furthermore, once you have good test coverage and all the tests pass, you have the proof I was talking about that your code works the way you expect it to.<\/p>\n<h3>Automated Testing<\/h3>\n<p>It\u2019s important to automate your tests as much as possible, so you don\u2019t have an excuse not to execute them. Writing good tests is one great step forward. But to have truly autonomous testing, you should integrate your testing into a continuous integration or build pipeline, so that it happens automatically when you commit your code.<\/p>\n<h3>Utilize Different Tiers of Testing<\/h3>\n<p>If you\u2019ve already got some tests, you\u2019re on the right track. And frankly, way ahead of where I was on most of the projects I worked on in the past. But it\u2019s not enough to build up a suite of unit tests. To cover all your bases and prove your program works through all of its layers, you need tests for each of those layers.<\/p>\n<p>However, you have to find the right balance. Typically you want the most unit tests, fewer integration tests, and even fewer end-to-end tests. These tiers of tests help you to test your application in full and can also make it easier for future maintainers to discover where in your code any bugs might exist. Developing maintainable code is developing quality code.<\/p>\n<h2>5. Code Review<\/h2>\n<p>Code review is the ultimate test of how well your code can be understood by others. Take advantage of it whenever you can. Having someone else be able to read and understand your code in front of you is the ultimate test of whether your program is going to be maintainable.<\/p>\n<p>Furthermore, our judgment can often become clouded after we\u2019ve been working on the same project for months on end. It becomes necessary for someone other than yourself to review your code in order to get an unbiased opinion.<\/p>\n<p>The following tricks will help you to utilize code reviews:<\/p>\n<h3>Utilize Team Code Reviews<\/h3>\n<p>If you\u2019re working as part of a team, you\u2019re in the perfect position to utilize code reviews. One way in which many teams utilize code reviews is that they conduct them after a significant amount of work has been completed, but not so far along the development cycle that they\u2019re going to be releasing the software soon.<\/p>\n<p>If you wait until right before a software release to have a code review, what\u2019s going to happen is this: you will conduct the review, get a bunch of great feedback, deprioritize all of it to get your software released on schedule, then forget about the feedback.<\/p>\n<p>It\u2019s better to plan time into your schedule to make adjustments after conducting code reviews. After your code review is complete, you will actually have time in your schedule to make the necessary changes. This way, you can ensure the best quality software is released, that it is released on time, and that others can understand it better.<\/p>\n<h3>\u201cThe Buddy System\u201d<\/h3>\n<p>If you\u2019re working on your own, you might find it harder, or nearly impossible, to conduct code reviews. However, you can still conduct code reviews if you find a \u201cbuddy.\u201d Consider making an arrangement with a colleague, fellow contractor, or just one of your developer friends in which you agree to review each other\u2019s code at predetermined times.<\/p>\n<p>If you utilize the buddy system, you can still gain the benefits of code reviews while working independently. Just make sure the arrangement is fair. Agree to review each other\u2019s code an equal amount, and try to keep the duration of the code reviews the same amount of time. If you can keep the deal fair, it will be more likely to last longer.<\/p>\n<h3>Don\u2019t Argue, Discuss<\/h3>\n<p>It\u2019s important not to be overly critical of someone when conducting a code review. You want the conversation to be about the code, not the person who wrote it. Don\u2019t get into arguments over varying opinions. However, the code should drive discussions.<\/p>\n<p>If you\u2019re the person reviewing the code, ask questions: Why did you do it this way? Why did you use this library? What does this function do? These types of questions help drive discussions. Conversely, if you start exclaiming things like, \u201cI would have done it this way,\u201d or simply, \u201cThis code is wrong,\u201d then you\u2019re probably not going to have as productive of a review.<\/p>\n<h3>Take Notes<\/h3>\n<p>Taking notes is the most important part of a code review, and of most productive meetings. Don\u2019t solely rely on the reviewers marking up your code. Document the discussions that occur in the review session. Even if a consensus is reached that a particular chunk of code that was in question is actually good, document it. You may read that note later, and change your mind again. Try to capture as much valuable information as you can during the review. Then, reflect on your notes and decide what needs to be prioritized.<\/p>\n<h2>You <em>Can<\/em> Write Better Code<\/h2>\n<p><a href=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Write-Better-ode-1024x576.png\"><img decoding=\"async\" class=\"aligncenter wp-image-69466\" src=\"http:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Write-Better-ode-1024x576.png\" alt=\"\" width=\"860\" height=\"484\" srcset=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Write-Better-ode-1024x576.png 1024w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Write-Better-ode-1024x576-300x169.png 300w, https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2017\/10\/Write-Better-ode-1024x576-768x432.png 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p>To summarize, I suggest emphasizing the following efforts to help you increase your code quality.<\/p>\n<ul>\n<li><strong>Use a linter when developing.<\/strong> Better yet, integrate a linter into your build pipeline.<\/li>\n<li><strong>Write meaningful comments.<\/strong> Don\u2019t clutter your code with comments, but make sure there are good comments when warranted.<\/li>\n<li><strong>Write legible code.<\/strong> Make sure your code can be read and understood by someone who\u2019s never seen it before.<\/li>\n<li><strong>Emphasize software testing.<\/strong> Start testing your software from the beginning, and don\u2019t back off.<\/li>\n<li><strong>Conduct code reviews<\/strong>. Don\u2019t turn good reviews into arguments. Question, discuss, and take notes.<\/li>\n<\/ul>\n<p>This is by no means a complete list of all the ways you can improve the quality of your code. However, these are all important steps to take in order to improve the quality of your code.<\/p>\n<p>Before I started doing these things, I didn\u2019t write <em>bad<\/em> code, in my opinion. But these helped me take it to the next level. I can see this improvement when I reflect on my older projects and compare them to current ones. I hope these tips help you to see the same improvements, regardless of where you\u2019re starting from.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Java Code Geeks with permission by Michael Washburn, partner at our <a href=\"http:\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"https:\/\/simpleprogrammer.com\/2017\/10\/06\/5-tips-code-quality\/\" target=\"_blank\" rel=\"noopener\">5 Tips to Increase your Code Quality<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can show you how to do it, too. Before we get started, I want to define what exactly I mean when I say \u201chigh-quality code.\u201d When &hellip;<\/p>\n","protected":false},"author":6047,"featured_media":2386,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15],"tags":[],"class_list":["post-69454","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>5 Tips to Increase your Code Quality - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"5 Tips to Increase your Code Quality - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2017-10-09T07:01:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-02-14T11:14:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Michael Washburn\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@Mike_Washburn.\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Michael Washburn\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html\"},\"author\":{\"name\":\"Michael Washburn\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6742b9e295e50c81ffdbb541cc526c3b\"},\"headline\":\"5 Tips to Increase your Code Quality\",\"datePublished\":\"2017-10-09T07:01:20+00:00\",\"dateModified\":\"2019-02-14T11:14:02+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html\"},\"wordCount\":3205,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html\",\"name\":\"5 Tips to Increase your Code Quality - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"datePublished\":\"2017-10-09T07:01:20+00:00\",\"dateModified\":\"2019-02-14T11:14:02+00:00\",\"description\":\"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/software-development-2-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2017\\\/10\\\/5-tips-increase-code-quality.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Software Development\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/software-development\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"5 Tips to Increase your Code Quality\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/6742b9e295e50c81ffdbb541cc526c3b\",\"name\":\"Michael Washburn\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g\",\"caption\":\"Michael Washburn\"},\"description\":\"Michael Washburn Jr. is a full stack web application developer with interest in Python, JavaScript frameworks, and good software development techniques. Read more about him on his blog at michaelwashburnjr.com or connect with him on twitter @Mike_Washburn.\",\"sameAs\":[\"https:\\\/\\\/simpleprogrammer.com\",\"https:\\\/\\\/x.com\\\/Mike_Washburn.\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/michael-washburn\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"5 Tips to Increase your Code Quality - Java Code Geeks","description":"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can","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:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html","og_locale":"en_US","og_type":"article","og_title":"5 Tips to Increase your Code Quality - Java Code Geeks","og_description":"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can","og_url":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2017-10-09T07:01:20+00:00","article_modified_time":"2019-02-14T11:14:02+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","type":"image\/jpeg"}],"author":"Michael Washburn","twitter_card":"summary_large_image","twitter_creator":"@Mike_Washburn.","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Michael Washburn","Est. reading time":"16 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html"},"author":{"name":"Michael Washburn","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6742b9e295e50c81ffdbb541cc526c3b"},"headline":"5 Tips to Increase your Code Quality","datePublished":"2017-10-09T07:01:20+00:00","dateModified":"2019-02-14T11:14:02+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html"},"wordCount":3205,"commentCount":1,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","articleSection":["Software Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html","url":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html","name":"5 Tips to Increase your Code Quality - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","datePublished":"2017-10-09T07:01:20+00:00","dateModified":"2019-02-14T11:14:02+00:00","description":"Have you ever reflected on your code and wondered if you could have made it better? I\u2019m here to tell you that you can write high-quality code, and I can","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/software-development-2-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2017\/10\/5-tips-increase-code-quality.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Software Development","item":"https:\/\/www.javacodegeeks.com\/category\/software-development"},{"@type":"ListItem","position":3,"name":"5 Tips to Increase your Code Quality"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/6742b9e295e50c81ffdbb541cc526c3b","name":"Michael Washburn","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6abefd651bb17b8f61c49945f74f58b3ecdb1405991c28165362674ee7061c75?s=96&d=mm&r=g","caption":"Michael Washburn"},"description":"Michael Washburn Jr. is a full stack web application developer with interest in Python, JavaScript frameworks, and good software development techniques. Read more about him on his blog at michaelwashburnjr.com or connect with him on twitter @Mike_Washburn.","sameAs":["https:\/\/simpleprogrammer.com","https:\/\/x.com\/Mike_Washburn."],"url":"https:\/\/www.javacodegeeks.com\/author\/michael-washburn"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/69454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/6047"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=69454"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/69454\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/2386"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=69454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=69454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=69454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}