Permalink
Browse files

tweak conclusion

  • Loading branch information...
1 parent 7fdfc2b commit 01c33836c7254f6171ae4eeb2ce7a3b63b578123 @lihaoyi committed Apr 30, 2016
Showing with 12 additions and 7 deletions.
  1. +12 −7 post/8 - Strategic Scala Style: Practical Type Safety.md
@@ -1195,22 +1195,27 @@ giving them separate wrapper-types.
In this post we've talked about what it means to be "type safe" from a
practical point of view, and gone over a number of techniques that help
improve the type-safety properties of your Scala code. In all these cases,
-the added safety is statistical: there isn't any
+the added safety is approximate: there isn't any
theoretical barrier stopping people from reaching around "behind" your code
to do bad things, e.g. unwrapping your boxed integer IDs or converting your
non-string flags back into strings with by `match`ing on it. We just hope that
the added inconvenience of unwrapping these when we really need to is
outweighed by the added safety of eliminating these "easy" mistakes in other
situations.
-Whether the benefit *actually does* outweight the cost is an
-empirical question depending on how you are using the code: how often you
-would get inconvenienced vs how often you'd be saved from your mistakes.
-Basically all of these techniques have trade-offs, whether in terms of
-performance or convenience, and it's up to each developer to use their
+But how do you know if the benefit *actually does* outweight the cost?
+
+That is an empirical question depending on how you are using the code: how
+often you would get inconvenienced vs how often you'd be saved from your
+mistakes. Basically all of these techniques have trade-offs, whether in terms
+of performance or convenience, and it's up to each developer to use their
judgement to decide what's the right trade-off for each scenario.
-What other tips or techniques to you use to help maintain type-safety when
+Hopefully by reading this post, you've learned some useful techniques that
+you can make use of in your own Scala code to get the compiler to help catch
+your mistakes and improve type-safety.
+
+What other tips or techniques to you use to increase type-safety when
you're writing Scala? Let us know in the comments below!

0 comments on commit 01c3383

Please sign in to comment.