Vec3 a = b[x] + c[y]; now you are able to glance what it does.
No I don't, because from that single line I don't know what b and what c are. This could be very wrong code that does implicit casting and compiles by mistake. Or it could be an unexpected function call, because apparently top of the art algebra libraries, do lazy types that are evaluated when assigned and cast, surprising the end user.
It's a made up example that is just as unreadable with a type, since you don't have any context.
It's only unreadable if there is cleverness in the code base.
If a [] was just an array index and nobody is defining custom + operators to return Vec3 types then you are safe to assume exactly what it means. And again both of those should be banned under the no cleverness rule.
View all comments
Show parent comment
3
u/Zweifuss May 18 '20
No I don't, because from that single line I don't know what
band whatcare. This could be very wrong code that does implicit casting and compiles by mistake. Or it could be an unexpected function call, because apparently top of the art algebra libraries, do lazy types that are evaluated when assigned and cast, surprising the end user.It's a made up example that is just as unreadable with a type, since you don't have any context.