The state pattern is a technique that is useful for structuring code in a way that makes bugs less likely to arise. This article walks through a simple example to show how the state pattern works.
Articles
Ruby is one of the few programming languages that gets equality right. Nonetheless, equality in Ruby is not straightforward: there is
#==
, #eql?
, #equal?
, #===
, and more. In this article, I will take you through all forms of equality in Ruby and how to implement them.How do you write a lexer for
print "one plus two is ${1+2}";
? The interpolation makes this tricky, as the string forms a sublanguage that is different from the main language. To make things worse, interpolation can be nested. Textbook lexers won’t cut it, and we need something stronger. Enter modal lexers.
In any collaborative environment, opportunities for change often arise. When such an opportunity presents itself, write up a structured proposal document describing how to tackle this opportunity. With this document, a decision on whether or not to implement the proposal can be made quickly and confidently.
One way in which budgeting reduces financial anxiety is by predicting expenses based on the expected lifetime of a purchase.
On wide screens, a column of text often needs a considerable amount of whitespace to the left and to the right. I experimented with CSS’ multi-column layout to use screen real estate more efficiently. While I ended up quite liking the aesthetic, usability problems and spotty browser support make this unfortunately an impractical approach.
Lenses enable building complex forms quickly and with confidence. Lenses themselves are simple, but they provide significant benefits when used with React forms with TypeScript, reducing the change of mistakes and speeding up the feedback loop.