> On 24 Jun 2016, at 23:38, William Jon Shipley <[email protected]> 
> wrote:
> 
>> On Jun 24, 2016, at 3:00 PM, Haravikk via swift-evolution 
>> <[email protected] <mailto:[email protected]>> wrote:
>>       for colinearSegment in remainingSegments where 
>> colinearSegment.angle.isEssentially(angle: segment.angle) { // Is parameter 
>> name even necessary?
> 
> My terminology sucks because I don’t remember math terms but basically I’m 
> trying to distinguish between angles of rays (0..<360º) and angles of lines 
> (0..<180º). Because, like, if you have a line at 45º and another at 225º, 
> well, they’re either collinear or parallel.
> 
> So I call the variants “rayAngle:” and “infiniteLineAngle:”. Not my finest 
> hour.

Sorry, I think I got a bit side-tracked, didn't mean to seem too critical of 
the name choice, my point was that the logic is actually pretty 
straightforward, and the line is long because of the verbose naming rather than 
the presence of a where clause (which could also be moved to another line as 
another option). As always you should use whatever names help you to understand 
and remember the intent of the code best, meanwhile I should actually focus on 
what my point was supposed to be =D


So yeah, I don't think any of the examples presented have had "too much logic" 
for a where clause, while more complex cases with ands, ors, etc. might become 
a bit less immediately readable, it's no more so than any other if-condition, 
and it's an issue of personal style choice regardless, rather than a fault with 
a where clause.
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to