General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
Brent Jacobs
ThePrimeTime
comments
Comments by "Brent Jacobs" (@br3nto) on "Have Strong Opinions" video.
Type vs var keyword - that’s the ultimate discussion. Var should of course be used everywhere unless Type is explicitly required. The reason is simple: var is like an interface to a concept. This requires a slightly different way of thinking when reading code. The “concept” is described by the expression after the assignment operator. This means the variable name and the expression must be descriptive and readable, so it leads to self-describing code that is easier to read/understand. And because we are coding to an interface (of a concept), future devs are free to refactor as they wish as long as the concept holds; they aren’t constrained by the type decided previously.
1