24
iridic
8y

I have become so lazy that I write things like
int reservations = getReservations()
and then use the IDEs quickfix to change int to Arraylist<Reservation>
Saves me roughly 15 characters but its always worth it :D

Comments
  • 0
    In C# you might use var as type
  • 1
    Use type inference :P
  • 0
    In Swift just through a var, pretty much like C# but in a more innovative way :P
    Though I like ur idea, might try it soon 😁
  • 1
    @hyvte @Krokoklemme @gitpush
    Strongly disagree actually. While technically it might be the same, it is a big difference in coding style and the next dev that has to read the code has to do type inference in his brain...
  • 1
    @iridic while this is a downside of using var, but IDEs are now advanced just put the cursor over the variable name and a tooltip will show up and tell you it's type. As for Swift, we can use for example: var myArray: [String] = getNames()
    And I do that since XCode does not do that 😒
  • 0
    @iridic I dont use it and I dont recommend to use it. But in this case it is possible
Add Comment