Having empty blocks in the code is redundantKT-W1012
Having empty blocks, such as empty functions, empty classes, or empty control flow blocks is generally considered bad practice because it reduces code clarity and can indicate a lack of proper implementation or unnecessary code.
Empty blocks add unnecessary noise to the code and can make it harder to understand the intended purpose of the block. It may confuse other developers who read the code, as they may wonder why the block is empty and what its purpose is.
Empty blocks can hide logical errors or indicate incomplete implementation. If a block is intended to contain code but is left empty, it may lead to unintended consequences or bugs. It's important to ensure that all blocks have appropriate code that performs the necessary actions or contains the required logic.
Bad Practice
fun foo() {
}
Recommended
fun foo() {
// The implementation of the function
}