paint-brush
Unlocking Developer Productivity: The Key Is AI + Clean Codeby@petermckee
398 reads
398 reads

Unlocking Developer Productivity: The Key Is AI + Clean Code

by Peter McKeeJanuary 11th, 2024
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

An organization’s foundational code is critical for the long-term viability of software to become a business asset.

Company Mentioned

Mention Thumbnail
featured image - Unlocking Developer Productivity: The Key Is AI + Clean Code
Peter McKee HackerNoon profile picture

Regardless of where a company is today in its digital transformation journey, it is likely a software company, and all software that an organization runs on is built on code. An organization’s foundational code is critical for the long-term viability of software to become a business asset. This can only happen though if the software is secure, reliable and maintainable. Easier said than done, organizations are scaling the number of lines of code on which their software is running into the millions or hundreds of millions, a number that will only continue to grow now that AI is writing code.


Business and IT leaders are constantly caught in a balancing act, trying to reduce all of the following: risk (from security and downtime), technical debt that continues to accumulate as more lines of code are written, and churn of their most important resource – developers. All of this is happening while organizations are also trying to improve the efficiency of their operations, improve software development processes and output, and increase the pace of innovation.


It is developers who are the unsung heroes here. They need proper support from the business, which is not only possible but urgently necessary to help them thrive -- especially now at a time when demand is outpacing supply in this profession.


Today’s developers (existing and emerging) face massive pressure

More than 83% of software developers report suffering from burnout, according to a 2022 study from Haystack. The reasons are numerous. Workload and the demand for faster production are obvious ones. Technical debt is another. Development teams often find themselves dealing with tech debt that’s been accumulating, in some cases, for several years. Beyond this, a deeper review reveals that developers spend up to 42% of their time rewriting bad code, a critical factor in slowing down productivity – both in the development process and for future updates. It’s stressful for developers to have to rework someone else’s code with no clue about the context of the original work.


The promise of AI: Can it help developers do more with less?

Emerging tools – like generative AI – promise relief in the way of code velocity and volume, theoretically helping to lessen this sentiment of burnout by freeing up 20-30% of developers’ time, according to McKinsey. AI no doubt will have (and is already having) a positive impact on developer productivity. However, if developers don’t address the underlying issues that result in bad code being put into production in the first place, then more code coming from AI code generators will mean one thing: more code to fix. Researchers at Stanford found that using GitHub’s Copilot made developers more likely to write insecure code while conversely feeling confident in its security. AI needs guardrails in software development, a ‘trust but verify’ approach.


Take advantage of AI while mitigating risk & reducing the amount of rework

The most impactful way to improve the state of code today – and as a result developer productivity – is to start embracing the concept of ‘secure by design’ at the beginning of the development process. Embracing the attributes that result in Clean Code, code that is consistent, intentional, adaptable, and responsible, produces software that is secure, maintainable, reliable, and accessible, plus more. This matters for many reasons, one of which is that coding is not a solo endeavor; it’s a team sport. You want software that’s written by one developer to be easily understood and modified by another developer at a future point in time. This causes less friction in the coding process and helps developers be more productive without needing to spend so much time analyzing what the code is supposed to do. Clean Code also positions businesses to embrace policy efforts around ‘Secure by Design’ in the US and the ‘EU Cyber Resilience Act’ while improving productivity.


I encourage developers to embrace a “clean as you code” methodology. Instead of worrying about the entire code base, focus on what is new or what is being changed. Every new piece of code that gets shipped to production must adhere to the tenets of Clean Code as defined above. By cleaning as you code, organizations will have new code that is clean and by focusing on that, they will progressively improve the overall quality of the entire codebase with minimal cost and effort. In this scenario, quality and security do not slow things down, but conversely, they support the velocity of AI and/or human coding output and turn foundational code into a business asset -- all while helping developers be more productive.