ThoughtWorks
  • Contact
  • Español
  • Português
  • Deutsch
  • 中文
Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

    Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

    Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

    Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
Go to overview

Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
  • Español
  • Português
  • Deutsch
  • 中文
ThoughtWorksMenu
  • Close   ✕
  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact
  • Back
  • Close   ✕
  • Go to overview
  • Engineering Culture, Delivery Mindset

    Embrace a modern approach to software development and deliver value faster

  • Experience Design and Product Capability

    Rapidly design, deliver and evolve exceptional products and experiences

  • Frictionless Operating Model

    Improve your organization's ability to respond to change

  • Intelligence-Driven Decision Making

    Leverage your data assets to unlock new sources of value

  • Partnerships

    Leveraging our network of trusted partners to amplify the outcomes we deliver for our clients

  • Platform Strategy

    Create adaptable technology platforms that move with your business strategy

  • Back
  • Close   ✕
  • Go to overview
  • Automotive
  • Cleantech, Energy and Utilities
  • Financial Services and Insurance
  • Healthcare
  • Media and Publishing
  • Not-for-profit
  • Public Sector
  • Retail and E-commerce
  • Travel and Transport
  • Back
  • Close   ✕
  • Go to overview
  • Featured

  • Technology

    An in-depth exploration of enterprise technology and engineering excellence

  • Business

    Keep up to date with the latest business and industry insights for digital leaders

  • Culture

    The place for career-building content and tips, and our view on social justice and inclusivity

  • Digital Publications and Tools

  • Technology Radar

    An opinionated guide to technology frontiers

  • Perspectives

    A publication for digital leaders

  • Digital Fluency Model

    A model for prioritizing the digital capabilities needed to navigate uncertainty

  • Decoder

    The business execs' A-Z guide to technology

  • All Insights

  • Articles

    Expert insights to help your business grow

  • Blogs

    Personal perspectives from ThoughtWorkers around the globe

  • Books

    Explore our extensive library

  • Podcasts

    Captivating conversations on the latest in business and tech

  • Back
  • Close   ✕
  • Go to overview
  • Application process

    What to expect as you interview with us

  • Grads and career changers

    Start your tech career on the right foot

  • Search jobs

    Find open positions in your region

  • Stay connected

    Sign up for our monthly newsletter

  • Back
  • Close   ✕
  • Go to overview
  • Conferences and Events
  • Diversity and Inclusion
  • News
  • Open Source
  • Our Leaders
  • Social Change
Blogs
Select a topic
View all topicsClose
Technology 
Agile Project Management Cloud Continuous Delivery  Data Science & Engineering Defending the Free Internet Evolutionary Architecture Experience Design IoT Languages, Tools & Frameworks Legacy Modernization Machine Learning & Artificial Intelligence Microservices Platforms Security Software Testing Technology Strategy 
Business 
Financial Services Global Health Innovation Retail  Transformation 
Careers 
Career Hacks Diversity & Inclusion Social Change 
Blogs

Topics

Choose a topic
  • Technology
    Technology
  • Technology Overview
  • Agile Project Management
  • Cloud
  • Continuous Delivery
  • Data Science & Engineering
  • Defending the Free Internet
  • Evolutionary Architecture
  • Experience Design
  • IoT
  • Languages, Tools & Frameworks
  • Legacy Modernization
  • Machine Learning & Artificial Intelligence
  • Microservices
  • Platforms
  • Security
  • Software Testing
  • Technology Strategy
  • Business
    Business
  • Business Overview
  • Financial Services
  • Global Health
  • Innovation
  • Retail
  • Transformation
  • Careers
    Careers
  • Careers Overview
  • Career Hacks
  • Diversity & Inclusion
  • Social Change
Continuous Delivery PuneTechnology

Keep Your Code Clean..And Your Environment Too!

Yahya Poonawala Yahya Poonawala

Published: Feb 10, 2015

As I watched some of my fellow travellers absent mindedly throw garbage out of the window on a recent train journey, I struck a conversation with them to understand why cleanliness awareness campaigns haven’t had any impact on them. While I heard them defending themselves, it occurred to me that there is a striking similarity in the mindset behind littering our surroundings and in writing code which is not considered ‘clean’.

1. The area / code is already very messy, why bother?

“The streets and railway tracks are already littered with garbage and no one has cleaned it up; adding to the trash is not a problem.”

Similarly, people believe that a piece of code that does not have a good design or has duplication is already messed up. Hence, it is okay to not fix it and instead write substandard code. This is also known as the “Broken Window theory” (Ref : The Pragmatic Programmer). One broken window in a building that is left unrepaired will result in the inhabitants believing that no one cares. This will in turn result in another broken window, littering, graffiti and soon enough the clean building turns into an abandoned mess.

Don’t leave broken windows. Fix each one as soon as it is discovered. Similarly, don’t leave garbage lying around for very long. Clean it or get it cleaned immediately.

2. Someone else will clean it

“Sweepers are paid to clear garbage. It is okay to litter as there is someone to clean up after.”

Likewise, many a time we end up with a “tech debt monkey” in our teams who are the only people fixing these technical debts. We don’t think twice about making an entry in the “tech debt” sheet and leaving it to these “experts”.

All team members should be conscious of the fact that tech debt will hurt them eventually and hence strive not to create this debt. Even if there is any, they should, contribute in cleaning up the code.

3. Really? It’s just one paper / line of code!

“It’s just a small wrapper, throwing it outside the window will not add to littering”.

Similarly, a mindset of “it’s just these 2 lines of code which are messy, the rest is good” is just the start and will slowly spread and spoil the code.

4. Laziness

“The trash can is too far away, I can’t go  all the way to throw it”.

Similarly, we might believe that a certain code is not the best solution to a problem. But if the right way takes a lot more time and effort, we might compromise and use the quicker solution and postpone the better solution to later.

This anti-pattern almost always results in refactoring the necessary code which leads to more effort and requires a lot more time later. So, don’t take the shortcut, get your best possible code out at the first shot!

5. People are starving! What do you care about littering?

“There are bigger problems in life to solve than caring about our surroundings”.  

Likewise, reasons like “this needs go to production” or “I need to get this story done today”  are excuses we make which will ultimately hit us in the long run.

Here at ThoughtWorks, on some projects we use the pull request based model or tools like CodeClimate to monitor code quality.

I have myself been a culprit of littering a couple of times. Just being aware of the  consequences has made me think twice and prevented me both from throwing waste in a public area and also keeping my code as clean as possible.

Let us strive to keep our environment and code litter free!

Technology Radar

Don't miss our opinionated guide to technology frontiers.

Subscribe
  • What we do
  • Who we work with
  • Insights
  • Careers
  • About
  • Contact

WeChat

×
QR code to ThoughtWorks China WeChat subscription account

Media and analyst relations | Privacy policy | Modern Slavery statement ThoughtWorks| Accessibility | © 2021 ThoughtWorks, Inc.