{"id":431,"date":"2021-03-23T18:38:58","date_gmt":"2021-03-23T23:38:58","guid":{"rendered":"http:\/\/box5488.temp.domains\/~becomen3\/staging\/8495\/?p=431"},"modified":"2022-04-25T09:48:22","modified_gmt":"2022-04-25T14:48:22","slug":"the-dilemma-clean-code-vs-tight-deadlines","status":"publish","type":"post","link":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-dilemma-clean-code-vs-tight-deadlines\/","title":{"rendered":"The Dilemma: Clean Code vs Tight Deadlines"},"content":{"rendered":"\n<p>Every once in a while, any software developer wants to write a piece of art by following best practices such as refactoring or improving your code, adding unit, integration or even end-to-end tests, making your code as readable as possible, or delivering solutions that scale in no time. It is like going to Hawaii for your honeymoon as software developers; you are dreaming about making that happen.<\/p>\n\n\n\n<p>\u200dHowever, you came here to find a solution to a problem you constantly battle when you start working under tight deadlines while maintaining quality code. You came here because you are a proud developer who constantly strives to produce quality code, who constantly wants to convert a one-scenario solution into a more generic solution that covers more scenarios but requires extra development. Or simply, you came here because you are curious about this topic.<\/p>\n\n\n\n<p>I am one of those developers who flinches after delivering code that makes one turn into tears whenever they go back and start reading and understanding the logic behind it. However, I have learned over the years certain things I have to swallow and accept the way things are.<\/p>\n\n\n\n<p>\u200dThe reality is that clients pay thousands, millions, their life-time savings to have a <strong>functional <\/strong>product. What does functional mean? It doesn\u2019t mean how many lines of code you put in a method\/function, nor whether your code has been refactored or not, nor whether you created an API endpoint with an absurd long name or with a more concise name, nor whether or not writing code that scales or that has to be changed every time new specs are changed.<\/p>\n\n\n\n<p>\u200dA functional product means the software, web application, mobile application, game, or whatever else you can develop works. It means if there is a contract that has been signed between the two parties, the client and the service provider, with deadlines clearly specified, it needs to be delivered whenever it is supposed to be delivered.<\/p>\n\n\n\n<p>\u200dSometimes, you can gain time by talking to the client beforehand about the current stages of the development process, and the client allows you to deliver outside the initial timeframes. However, that is not always the case. &nbsp;For example, the client had already publicly announced about the exciting app their users will get to enjoy, but the developers are still working on it.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"428\" src=\"http:\/\/box5488.temp.domains\/~becomen3\/staging\/8495\/wp-content\/uploads\/2021\/03\/tim-gouw-1K9T5YiZ2WU-unsplash.jpg\" alt=\"\" class=\"wp-image-434\" srcset=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/03\/tim-gouw-1K9T5YiZ2WU-unsplash.jpg 640w, https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-content\/uploads\/2021\/03\/tim-gouw-1K9T5YiZ2WU-unsplash-300x201.jpg 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n\n<p>Having said that, a functional product means you must finish and deliver on time. It is the moment when the \u201cwhatever it takes\u201d rationale starts becoming part of your thoughts. It means the chances of writing messy code skyrockets just with the thought of knowing you have 1 month, 1 week, 1 day, 1 hour, or even 1 minute to get the project up and running.\u200dThat is the point when experience and rationale come into place. That is the point when you should calm down and start thinking about what you are putting in the code. That is the moment you should keep thinking about writing clean code. That is the point you must write easy-to-read code. Just because your code does not have unit tests or it lacks refactoring, it does not mean it cannot remain easy to read.<\/p>\n\n\n\n<p>Code readability is part of the process of writing clean code. It is one of the most basic concepts, but hardest to follow within the world of software development\u2026even when there are tight deadlines\u2026even when everything is a rush\u2026even when we need to get it out there as soon as possible\u2026even when a function has 500 lines of code\u2026<\/p>\n\n\n\n<p>\u200d\u2026Even if there are multiple valid reasons why your code is not fully clean, code readability must be there.<\/p>\n\n\n\n<p>\u200dBut why is this so important? It is important because it will simplify the process of integrating new functionality. It will ease the process of getting up-to-speed new developers who join the development process to add more features and finish on time. It will be easy in the long run to refactor. It will be easy during post-production deployment whenever you start adding unit tests. It will be easier to write documentation based on that code.<\/p>\n\n\n\n<p>\u200dIt will be easier.<\/p>\n\n\n\n<p>\u200dYou see, there are certain things that are not perfect and that is fine. If you don\u2019t believe me, I recommend you go back and check the code you wrote 3 months, 6 months, 1 year, 5 years, 10 years from now. You are going to say: <em>\u201cWhat in the world was I thinking when I added that code?\u201d<\/em>, or <em>\u201cI think I was high when I wrote that piece of code\u201d<\/em>.<\/p>\n\n\n\n<p>\u200dIt happens\u2026, even to the best of us (cough). Sorry, I meant to the best developers in general.<\/p>\n\n\n\n<p>\u200dBack to the point\u2026if you were able to read that old code without digging much for additional information, that means you wrote clean code. &nbsp;It may be in its most basic level, but it\u2019s still clean.<\/p>\n\n\n\n<p>\u200dIt is like having minimum standards.<\/p>\n\n\n\n<p>\u200dAll in all, continue writing clean code even when you think it needs to be improved. Even when you must deliver under tight deadlines. Sooner or later you will notice you naturally write clean code because you set high minimum standards for yourself.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every once in a while, any software developer wants to write a piece of art by following best practices such as refactoring or improving your code, adding unit, integration or even end-to-end tests, making your code as readable as possible, or delivering solutions that scale in no time. It is like going to Hawaii for &#8230; <a title=\"The Dilemma: Clean Code vs Tight Deadlines\" class=\"read-more\" href=\"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/the-dilemma-clean-code-vs-tight-deadlines\/\" aria-label=\"More on The Dilemma: Clean Code vs Tight Deadlines\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-431","post","type-post","status-publish","format-standard","hentry","category-general-info","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"_links":{"self":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/431","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/comments?post=431"}],"version-history":[{"count":3,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/431\/revisions"}],"predecessor-version":[{"id":2537,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/posts\/431\/revisions\/2537"}],"wp:attachment":[{"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/media?parent=431"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/categories?post=431"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.becomebetterprogrammer.com\/staging\/4563\/wp-json\/wp\/v2\/tags?post=431"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}