Closed chungonn closed 8 years ago
👍
I don't like making the project more "friendly" to null
s.
In general, I feel the number of times null
sneaking into your template is a mistake far outweighs the number of times null
sneaking into your template is intentional. For example, you almost never want to show your users null
on your website, your CEO null
on your analytics reports, or your prospective-employers null
on your resume.
If that is true, then we should make null
fail as early as possible, in a way the developer can debug it as easily as possible. That probably means making String => Frag
, AttrValue[String]
, StyleValue[String]
, and all that check for nulls and blow up if they find one. There are a number of cases, not just the String => Frag
case being changed in this diff.
Obviously the status quo, where a null
sneaks in and blows up with an indecipherable stack trace, is sub-optimal. Although this PR makes it better, I don't think it's a step in the right direction.
+1 Good call.
Below are the changes I made and hope you are agreeable to it.