doctoshotgun icon indicating copy to clipboard operation
doctoshotgun copied to clipboard

Use type hints in the codebase

Open seranpion opened this issue 2 years ago • 2 comments

As I was reading the code, I noticed that it would be much easier to understand with type hints. At least on function signatures.

Also, enforcing a max line width on the project would help readability.

seranpion avatar Dec 06 '21 13:12 seranpion

https://lkml.org/lkml/2020/5/29/1038 :)

rbignon avatar Dec 06 '21 15:12 rbignon

That answer is not saying much. It's a reaction about the specific limit of 80 columns. The last sentence summarizes my opinion as well:

And yes, we do line breaks at some point. But there really isn't any reason to make that point be 80 columns any more.

While my screen is QHD and can fit a lot of text, side panels take some space too. I find code readability to start decreasing with lines above 120 columns (there are a couple of them here).
But anyway, back to the main point of the discussion:

What are your thoughts on type hints specifically? If one was to introduce them in the code, would the PR be rejected?

seranpion avatar Dec 07 '21 13:12 seranpion