Avoid Using Flags as a Function’s Parameters

Avoid Using Flags as a Function’s Parameters

A function should only do one thing. If flags are used as a function’s parameters, the function is doing more than one thing.

When you find yourself using flags as a way to run different code, consider splitting your function into different functions.

My previous tips on good Python practices.

Search

2 thoughts on “Avoid Using Flags as a Function’s Parameters”

Comments are closed.

Scroll to Top

Work with Khuyen Tran

Work with Khuyen Tran