3 ms·
Yes? I'm fairly certain you used their account to get an ordered list of their transactions.
by exabrial 9y ago
Yes? I'm fairly certain you used their account to get an ordered list of their transactions.
- trixie_ 9y agoThat exact statement could be said if there were no type definitions there. So what is the point?
- exabrial 9y agoI'm sorry but you are plain wrong. var transactions = account.getTransactions(); ...tells you nothing. Is transactions iterable? Is it an enum? Is it ordered? Are duplicates allowed? Maybe you're returning a basic type? Maybe it's another pojo?
- trixie_ 9y agoThe type definition alone wouldn't tell you if it's an enum, ordered, or no duplicates allowed... The writer would know what type they're working with through intellisense. The reader would know it's iterable based on just reading the code that follows it.. So again, what does the type info give you? Most of what you mentioned you wouldn't be able to figure out from just a type name...
- exabrial 9y agoList<> tells me it's an ordered collection of a singular superclass that allows duplicate instances. var tells me nothing.
- trixie_ 9y ago'var transactions' is enough information for most people to understand it's a list of some sort. If it really matters to you then use the IDE. The full type info is just not that useful. That's why most languages are moving towards inferred typing - typescript, c#, java, c++, rust, go, scala, etc...