Aqueductron – toying with dataflow in Ruby

I love playing with Ruby because it lets me express concepts clearly[1]. In my aqueductron gem, two concepts are expressed. It’s about processing data, and about code modifying code, all without modifying anything[2]. The metaphor of Aqueductron is an aqueduct. Data is the water, taking the form of droplets flowing through the ducts. Each piece of duct … Read moreAqueductron – toying with dataflow in Ruby

Pragmatism

As @franklinchen points out, the word “pragmatic” has negative connotations because people use it as an excuse to do whatever is convenient to them at the moment. “Pragmatic” does not mean “convenient.” It means carefully considering the balance of time spent now vs time spent later. It means picking your fights, and fighting hard for … Read morePragmatism

What’s dirtier than comments? Exceptions!

I postulate that comments are a code smell. Craig Buchek suggests a possible counterexample: # Let this raise its exception if the fields don’t exist as expected.user = c.get_setting(‘username’) How else could one express the intention here, he asks? I say, the output of a function should be expressed in its return value. Exceptions are … Read moreWhat’s dirtier than comments? Exceptions!

Jen Myers Tumblings: Three words

jenmyers: For the past two and a half years, I’ve been learning and considering three words and their concepts in succession: forgiveness, absolution and atonement. These concepts are steeped in religion. But I am not. So I come to them for their distilled applicable wisdom and not their spiritual promise…. Jen Myers Tumblings: Three words

What FP taught me about OO: Liskov Substitution Principle explained

TL;DR – functional programming taught me that LSP is a special case of PLS: Principle of Least Surprise. One thing that bugs me while reading Java: I’m reading along, come to a method call, ctrl-click on the method name, and get a list of implementations of the interface. IntelliJ can’t tell me exactly what will … Read moreWhat FP taught me about OO: Liskov Substitution Principle explained

Twisting the rules of logic in our code

In philosophy, there are very few things that can’t be doubted. The basic laws of logic are among them. There’s one that seems completely obvious and indisputable to normal people: Law of Identity: Everything is identical to itself. In my audiobook, the professor is going on about how not only is this statement true in … Read moreTwisting the rules of logic in our code