---
title: Stylistic choices
description: Hot takes!
---

import { Callout } from 'fumadocs-ui/components/callout';

## No classes

- [red-javascript-style-guide - why disallow class](https://github.com/GrosSacASac/JavaScript-Set-Up/blob/master/js/red-javascript-style-guide/why-disallow-class.md)
- Sheriff is trying to promote a "light functional" approach. Javascript classes don't fit such design

## No reduce

- [Is reduce() bad? - HTTP 203](https://www.youtube.com/watch?v=qaGjS7-qWzg)
- [TkDodo - Why i don't like reduce](https://tkdodo.eu/blog/why-i-dont-like-reduce)

<Callout title="Info">

Sheriff actually allows using `reduce` for very simple operations like summing up numbers. Complex operations are banned.

</Callout>

## No enums

- [eslint-plugin-typescript-enum - README](https://github.com/shian15810/eslint-plugin-typescript-enum/blob/main/README.md)
- [Enums considered harmful](https://www.youtube.com/watch?v=jjMbPt_H3RQ)
- [How to use TypeScript Enums and why not to, maybe](https://www.youtube.com/watch?v=pWPClHdcvVg)
- [Let's Talk About TypeScript's Worst Feature](https://www.youtube.com/watch?v=Anu8vHXsavo)
- [Effective Typescript book](https://effectivetypescript.com) explicitly warn against this, saying that `enums` belong to a legacy design choice of Typescript.

## No overloads

- generics supersedes them. Overloads are a legacy feature that was made available in Typescript before generics were a thing. Overloads are mostly a C#/Angular leftover. Simply put: there are no problems that function overloads solve better than generics
- overloads clutter the code and make it more verbose and harder to read, which increase the cognitive overload
- overloads clutter the VScode tooltips
- overloads force you to write non-standard javascript syntax
- overloads are a bad practice. The flexibility that they enable also enable your team to write inconsistent code. Which is exactly the problem that ESLint is designed to solve
- [Effective Typescript book](https://effectivetypescript.com) explicitly warn against this, saying that "conditional types" are preferrable.
