My coworker Tom finds Ruby unreadable. What?? I’m thinking. Ruby can be quite expressive, even beautiful. But Tom can’t be sure what Ruby is going to do. Some imported code could be modifying methods on built-in classes. You can never be sure exactly what will happen when this Ruby code executes. He’s right about that. … Read moreReadable, or reason-aboutable?
TL;DR – Clojure’s threading macro keeps code in a legible order, and it’s more extensible than methods. When we create methods in classes, we like that we’re grouping operations with related data. It’s a useful organizational scheme. There’s another reason to like methods: they put the code in an order that’s easy to read. In … Read moreLeft to right, top to bottom
Property-based testing and functional programming are friends, because they’re both motivated by Reasoning About Code. Functional programming is about keeping your functions data-in, data-out so that you can reason about them. Property-based testing is about expressing the conclusions of that reasoning as properties, then showing that they’re (probably) true by testing them with hundreds of … Read moreProperty-based testing of higher-order functions
The book Structure of Scientific Revolutions (1962, Thomas Kuhn) brought the word paradigm into common use. Ideas from fifty years ago about research science apply today to computer science and the software industry. This is one parallel Kuhn makes, extended to illuminate how we think about programming. The human mind does not perceive objects incrementally, … Read moreMental revolution
I’m currently distracted from life, immersed in Concepts of Modern Mathematics. Did you know that you can find out whether a number is prime by multiplying all the integers before it, adding one, and then dividing by the number of interest? Me neither! it’s like this: a number p is prime if and only if: … Read moreFinding Primes in Haskell