←back to thread

873 points belter | 2 comments | | HN request time: 0.019s | source
Show context
geophile ◴[] No.42950393[source]
After more than 25 years in the industry, and 10 years of retirement, I agree with pretty much everything on this list. A few things that struck me:

- Don't get too fundamentalist about OO or functional programming. Each has its place.

- "Spend time hunting for an algebra" is somewhat obscure, but truly excellent advice, and I have spend a lot of my career doing exactly that. That has never been time wasted. This connects to a couple of other points. 1) Once you have an algebra, you have the basis of a good API for functional programming. (This point is not explicit in the list.) 2) The things manipulated by your algebra are also the basis of a good OO design.

- "Elegance is not a real metric." It is absolutely dangerous as a metric, because it is a subjective goal we all aim for, and can therefore be used to justify anything, no matter how dumb. That said, elegance is something to strive for in your day-to-day programming life. You know it when you see it in someone else's work, and you appreciate it. You see a small set of principles, implemented in one place, that can then combine in many ways to do many useful things. Hmm, sounds a lot like an algebra!

replies(1): >>42952119 #
1. physicles ◴[] No.42952119[source]
As I understood it, the “algebra” is the domain-specific language/abstraction that you build — and if you’re lucky, discover — that encodes something fundamental about the domain you’re working in. Once you’ve found that, further coding is easier than you’d expect.

I’ve had the pleasure of finding a few of these over my career.

replies(1): >>42955192 #
2. geophile ◴[] No.42955192[source]
I think it goes beyond that. An algebra has operators that take objects of some type as input and yield objects of the same type as output. E.g. arithmetic (numbers in, numbers out), and relational algebra (tables in, tables out).