3 Minutes With Kent

Single Letter Variables (and Types) Considered Harmful

Informações:

Sinopse

Hey there friends Today is January 11th 2021, and I want to talk about single variable names in TypeScript. Well think of variable names in general, but for some reason in TypeScript when we're making like generic types or type names whatever we've just I don't know where it came from. I guess people say it came from C sharp and stuff they do this, but using the letter T to denote the type force like a generic or something. Pretty ridiculous. I mean, there are some situations where it's obvious that like what what the types are.And there's no real better name necessarily assuming that everybody understands the convention that T stands for type. But there are so many cases where you've got a couple of different types that you're providing. Each one has a unique purpose and we could just communicate that purpose with a actual variable name but instead for some reason we're using single letter variables. I'm not sure where this came from but it does need to stop please stop doing this and just use a descriptive