> On 24 Jun 2016, at 22:33, Erica Sadun via swift-evolution
> <[email protected]> wrote:
>
> most of these read as if there is too much logic stuffed into a single line:
>
>> for otherWall: Wall in self where otherWall != wall &&
>> !removedWalls.contains(otherWall) {
>>
>> for otherPieceOfFurnitureNode in
>> localFurnitureModelUUIDsToInterfaceElements!.values where
>> otherPieceOfFurnitureNode !== pieceOfFurnitureNode {
>>
>> for lineSegmentObject in wallRelatedLineSegments where
>> remainingLineSegments.contains(lineSegmentObject) {
>>
>> for colinearLineSegmentObject in remainingLineSegments where
>> colinearLineSegmentObject.angle.isEssentially(infiniteLineAngle:
>> lineSegmentObject.angle) {
>> …
Personally the logic seems pretty simple to me (especially the second and third
one, plus the fourth isn't actually complex), I'd say the biggest problem to
readability here is that the names seem too verbose, though without seeing the
rest of the code that's hard to judge. For example the last example doesn't
look so bad if you shorten the names like so:
for colinearSegment in remainingSegments where
colinearSegment.angle.isEssentially(angle: segment.angle) { // Is parameter
name even necessary?
Basically on the basis that it's probably obvious from context that this is to
do with lines that this is to do with lines, not sure if .isEssentially()'s
parameter name can be changed, but I'm not sure why there needs to be a
distinction that the angle is for an infinite line (an angle is an angle)._______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution