Exercise 2: Why the Opt-Out Symbol Is Always Visually Distinct — Possible Solution ==================================================================== THE TWO CHOSEN MECHANISMS ------------------------------ Blade: {{ $note }} (escaped, default) vs. {!! $note !!} (raw) Pug: #{note} (escaped, default) vs. !{note} (raw) WHY BOTH CHOSE A NEW, UNUSUAL-LOOKING SYMBOL ------------------------------------------------ In both cases, the "safe" opt-out isn't a hidden flag, a config option, or a keyword argument tucked away somewhere else in the code -- it's a different, visually loud character sitting right at the exact spot where the value gets inserted: - Blade doubles up its own curly braces into exclamation marks: {!! !!} instead of {{ }}. Exclamation marks read, at a glance, as an alarm -- the same instinct that makes "!!" a common way to mark something urgent in plain writing. - Pug swaps its pound sign for a bang: !{ } instead of #{ }. A bang (!) carries the identical "warning" connotation in nearly every programming context a developer has likely already seen it in. If either system instead used, say, a boolean second argument (escape(note, false)) or a config toggle set once per template, the "this value is unescaped" fact would be genuinely easy to miss while reading the template later -- a reviewer scanning the file would have to already know to go looking for it. Putting a visually different symbol directly at the point of use means the unsafe spot is impossible to skim past. Anyone reading {!! $note !!} or !{note} sees, immediately and without extra context, that this one specific value is being trusted rather than protected. THE SAME PRINCIPLE, DIFFERENT SPELLING ------------------------------------------------ This is exactly the same real design decision Chapter 4's own SafeString class made, and the same one every other system in this chapter's own big table makes, whatever the exact symbol: React's dangerouslySetInnerHTML spells the danger out as an actual English word in the prop's own name; EJS distinguishes <%= %> from <%- %> with a single different character; Django/Jinja2 use a named |safe filter instead of a symbol, but the filter's own name is doing the identical job -- making the decision to skip escaping something a reader has to consciously notice, not something that can happen by accident. WHY THIS WORKS AS AN ANSWER ---------------------------- It picks two genuinely different-looking real symbols from the chapter's own table, explains the concrete readability problem a hidden flag or config option would create instead, and connects both back to the single underlying design principle -- make the unsafe path visually loud -- that the chapter's own finding-box already identified as shared across every system checked.