Great article, never really had the courage to deep dive into Dart but I'll do one day for sure! One thing that bothers me when writing things like
classCache<T>{}
and then reading later, or in a comment
T meaning Type
Is that often when you say meaning, it really means that you could have just written it full length and not say that (I'm not talking about you personnally, just this kind of convention in general). Why not just write directly
So that it gets clearer for newcomers or people getting into this code someday. I like to think that my code is a form of art that another person will have to continue after me.
You can use multi-letter placeholders if you want, like the Microsoft docs, although they still prefixed the placeholder letters docs.microsoft.com/en-us/dotnet/cs...
Personally I would be careful doing CacheType as that feels like there is a class CacheType somewhere, especially looking at addItem(item: CacheType)
Great article, never really had the courage to deep dive into Dart but I'll do one day for sure! One thing that bothers me when writing things like
and then reading later, or in a comment
Is that often when you say
meaning
, it really means that you could have just written it full length and not say that (I'm not talking about you personnally, just this kind of convention in general). Why not just write directlySo that it gets clearer for newcomers or people getting into this code someday. I like to think that my code is a form of art that another person will have to continue after me.
Hey Amin,
You can use multi-letter placeholders if you want, like the Microsoft docs, although they still prefixed the placeholder letters docs.microsoft.com/en-us/dotnet/cs...
Personally I would be careful doing
CacheType
as that feels like there is aclass CacheType
somewhere, especially looking ataddItem(item: CacheType)
I see, hence the prefix like
TCache
. I never really understood that until now. Thanks Jermaine!You're welcome Amin.