When it comes to code:
* 0.5
19.2%
/ 2
80.8%
Poll ended at .
You have a constant that’s used in only one place. You
Add a comment to explain what it represents
25%
Assign it so it gets a name
75%
Poll ended at .
The stuff your program operates over are:
Entities
45.8%
Models
54.2%
Poll ended at .

```
if let result { return result.union(frame) }
else { return frame }
```

or

```
guard let result else { return frame }
return result.union(frame)
```

If else
50%
Guard
50%
Poll ended at .
In case you wonder: yes I’m taking these seriously
@RosaCtrl i have no intuition about Swifts Syntax whatsoever. It's impossible to type a syntactically correct swift program by hand

@RosaCtrl I prefer guards for the reasons described here: https://testing.googleblog.com/2017/06/code-health-reduce-nesting-reduce.html

The TotT series is a pretty good resource from the times people still cared.

Code Health: Reduce Nesting, Reduce Complexity

This is another post in our Code Health series. A version of this post originally appeared in Google bathrooms worldwide as a Google Testin...

Google Testing Blog
@mlen right, I often go with guards, but in this tiny snippet I think if is more obvious

@RosaCtrl ```
return (if let result { result } else { emptySet() }).union(frame)

@samir you would think that in Swift if is an expression! This makes me so mad
@RosaCtrl You have some kind of ternary condition operator, surely? Do ? and : work?
@RosaCtrl Not sure I'm parsing these. Swift? Something else? I can't make any sense of the second form at all.
@RosaCtrl result.map(union)?? frame
@RosaCtrl wait the idiomatic way is frame?.union() isn't it
@Andrev @RosaCtrl Maybe (result ?? emptySet).union(frame) would work?
@samir @RosaCtrl ah yes! I like this one
@Andrev @samir guys you rendered this poll useless 😭
@RosaCtrl @Andrev When presented with two options, always choose option three!
@RosaCtrl what's the difference? 😭
@hecate exactly. Just curious what’s the consensus
@RosaCtrl I put my business domain types in a folder called "Model" so I guess for me it's model :')
@RosaCtrl Bits! 😃
@penryu what?
@RosaCtrl My program operates on, and is composed of, bits!
@penryu that’s fake!
@RosaCtrl FAKE?! Then all these bits I've been twiddling are imaginary?!

@RosaCtrl
I'd say a "Model" describes types of entities, while an "entity" is an instance of a model.

Example: a blog may have a "Post model" (in general).
One specific deployment of a blog may have 1000 "Post entities" (i.e. instances of the Post model).

If a model is backed by a database, I'd use the terms "entity", "record" and "row" synonymously.