-
Point/Size & PointF/SizeF pairs contain equal code and test cases for both Point and Size counterparts, shouldn't they be merged? They even have conversions between each other: ImageSharp/src/ImageSharp/Primitives/Size.cs Lines 62 to 66 in 993f96e ImageSharp/src/ImageSharp/Primitives/Size.cs Lines 95 to 96 in 993f96e Both these changes would break API unfortunately but isn't it possible to be set to some "Future"/"2.0" major milestone? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No they should not... they are conceptually different. Yes from purely a data point of view they could easily be a single type but from an API/code understanding point of view they are very different. If it was a single shared type it would cause way too much additional cognitive load requirements forced onto our users and make our APIs way less self documenting. You must not forget that source code is not really for machines/the compiler first its for developers first and the compiler second. The reason for that is developers are going to to have to read and mentally process the code as they write it today, and in several years time when they have to come back to maintain it, so its really important they they can understand what the code means without having to keep too much additional state in there heads. For example much easier to reason about |
Beta Was this translation helpful? Give feedback.
No they should not... they are conceptually different. Yes from purely a data point of view they could easily be a single type but from an API/code understanding point of view they are very different.
If it was a single shared type it would cause way too much additional cognitive load requirements forced onto our users and make our APIs way less self documenting. You must not forget that source code is not really for machines/the compiler first its for developers first and the compiler second. The reason for that is developers are going to to have to read and mentally process the code as they write it today, and in several years time when they have to come back to maintain it, so its real…