3 ms·
I do not understand how having it on the right should help where type inference is used, as in that case you do not write the type at all! There's absolutely no
by Nimitz14 8y ago
I do not understand how having it on the right should help where type inference is used, as in that case you do not write the type at all! There's absolutely no difference in readability.
How about we consider the normal case (where you write out the types):
int num_entries = ..
float div = ..
float result = num_entries // div
vs
num_entries: int = ..
div: float = ..
result: float = num_entries // div
Because they are on the right, they aren't aligned which makes it harder to parse (imo). It gets even worse with more complicated types (lists etc).
- bluejekyll 8y agoYou left out a type inference example: let foo = Bar(); Anyway, these are all subjective perspectives, but I was personally won over to them, especially as I started using type inference more often.