DEV Community

loading...

Discussion on: Variables names don't need their type

Collapse
fronkan profile image
Fredrik Bengtsson

So, in many cases I agree with you, especially for most of the built in structures.
For those there often exists some common naming patterna. I think dicts are a bit harder to name in general. I often think of names like key2value/key_to_value or keys_values but it is very context dependent. I must admit I also use df prefix/postfix for data frames at times. It is short and communicates that the data is in the shape of a table. I, in general, prefer using type annotations over baking the information into the name as they are kind of made for it.