← back to the pile

One page, held up to the light

p.142ch.5 ↗

Constants should be frozen, really!
byroot 🙂

In a chapter titled "Them What Make the Rules and Them What Live the Dream", over a line of code that defines a CONSTANT as an array literal, @byroot writes:

Constants should be frozen, really! byroot 🙂

@byroot

The code below the note shows a #mutable array sitting smugly behind a SCREAMING_CASE name, pretending to be immutable. Jean could not walk past it.

Them what make the rules. Them what frozen the constants. #whysfoxes #WhysPoignantGuideToRuby #WPGTRPage142 #ruby #immutable #RubyLang

posted

see it on ruby.social ↗

Replies

  1. Nobody has replied yet. The fox is waiting. Foxes are very good at waiting.

Reply on Mastodon ↗ if you've got something to add. It'll turn up here eventually.

A tall white fox from the chunky bacon comics, holding the replies up for you.