model

This is a page from my book, Functional Programming, Simplified

“Excuse me, you’re in the way”

“A man of knowledge lives by acting,
not by thinking about acting.”

Carlos Castaneda

By now you know that I think a lot about attitude, and if there are any major secrets to my success, one of them is that at some point I learned that I was smart enough, and aggressive enough, to know when I was right about something. Once I gained confidence in myself, if I was clearly right about something and someone didn’t agree with me, I didn’t hesitate to say, or at least think, “Excuse me, you’re in my way.”

Port covers

Just a few months out of college, I was assigned to a missile project that had to do with something known as “port covers.” In short, port covers are like little doors on the sides of air-breathing rockets. If you’ve seen a little model rocket, or perhaps a firework that shoots up into the sky, you know that a rocket is basically a tube, like the cardboard tube that’s inside a roll of toilet paper. A normal solid rocket motor like this is filled with solid rocket fuel, which is something like a solid version of gasoline.

Charlie Munger on having and using multiple mental models alvin April 10, 2018 - 10:41am

“What are the models? Well, the first rule is that you’ve ot to have multiple models — because if you just have one or two that you’re using, the nature of human psychology is such that you’ll torture reality so that it fits your models.”

“You must know the big ideas in the big disciplines, and use them routinely — all of them, not just a few. Most people are trained in one model — economics, for example — and try to solve all problems in one way. You know the old saying: to the man with a hammer, the world looks like a nail. This is a dumb way of handling problems.”

~ from the book, Charlie Munger, The Complete Investor

Show me your flowcharts and conceal your tables ...

“Show me your flowcharts (source code), and conceal your tables (domain model), and I shall continue to be mystified; show me your tables (domain model) and I won’t usually need your flowcharts (source code): they’ll be obvious.”

~ Fred Brooks, “The Mythical Man Month

A terrific Model View Controller (MVC) diagram

Every once in a while when something hits you, you really remember it; it stands out in your mind as an “Aha” moment. One of those moments for me was when I saw a particular “Model/View/Controller” (MVC) diagram, and the light bulb went on. This diagram made the MVC pattern very simple, and I’ve never forgotten it.

How to add new behavior to closed classes in Scala (type classes)

This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 19.7, “How to add new behavior to closed classes (models) in Scala (type classes).”

Back to top

Problem

You have a closed model, and want to add new behavior to certain types within that model, while potentially excluding that behavior from being added to other types.

Back to top

Solution

Implement your solution as a type class.

Table of Contents

  1. Problem
  2. Solution
Back to top