Code Smell 85 - And Functions

Code Smell 85 - And Functions

Maxi Contieri
·Aug 21, 2021·

1 min read

Subscribe to my newsletter and never miss my upcoming articles

Play this article

Do not perform more than requested.

TL;DR: Unless you need atomicity, do not perform more than one task.


  • Coupling
  • Single Responsibility Principle violation
  • Readability
  • Low Cohesion
  • Testability


  1. Break the function

Sample Code


def fetch_and_display_personnel():
  data = # ...

  for person in data:
def fetch_personnel():
  return # ...

def display_personnel(data):
  for person in data:


Functions including "and" are candidates. However, we need to check them carefully since there might be false positives.


  • Readability
  • Naming


We should avoid doing more than needed, and our functions should be both minimal and atomic.

More Info


Photo by Paul on Unsplash

This smell was inspired by

If it takes more than a sentence to explain what you are doing, it’s almost always a sign that what you are doing is too complicated.

Sam Altman

This article is part of the CodeSmell Series.

Share this


Technical Opinions are my own. I don't have the revealed truth.

Software Design is a creative activity. These are hints and not rigid rules.

I write on BackEnd Business Systems and OOP Design. My advice/experience might not suit other systems.

You can write me at info(at)