Hacker News new | ask | show | jobs
by skybrian 2364 days ago
> For instance, I teach programmers to tune out the noise of refactoring catalogs and learn how most familiar refactorings instead follow from a few primordial algebraic laws

Why "instead?" Knowing more math is good, but I think the author is doing his students a disservice. You don't need to memorize refactoring catalogs, but if someone says "maybe you should use a visitor pattern here" it's helpful to look it up and know what it means. It's not deep, but this is the vocabulary of the programming profession, not noise, and we're not going to switch to speaking in abstract mathematics just because some people like math or see a deeper meaning in it.

Defunctionalization seems like it might be a useful addition to the catalog.

1 comments

They can learn that stuff after they've become familiar with the fundamentals. Visitor pattern is just a way to implement pattern matching starting from the primitives Java and the like provide.
That's like saying that people can learn arithmetic after they learn group theory, which they can learn after they learn category theory. No, learn the concrete first, then learn the abstractions, so that you have some concept of why the abstractions are relevant.
I'm not sure we do kids a service by skipping over fundamental aspects of mathematics in order to stick to the 'more concrete' stuff. The staggeringly vast majority of kids will never learn a lick of group theory or category theory, and I think that is unfortunate because the fundamentals aren't difficult or big. Most high school grads will hardly have touched even basic logic, and it is frighteningly common to run into people who don't understand that "A -> B; B; Therefore A" isn't valid.
We would do a worse disservice by skipping over more concrete stuff to teach group theory or, worse, category theory.

First, even if you can teach group theory or category theory to an 8-year-old, if you wind up with an 8-year-old who knows category theory but can't add, is that a win? No, it isn't. They need to be able to add in a way that they don't need group theory.

But, second, you can't in any meaningful way teach category theory, or even group theory, to an 8-year-old. But you can teach them to add.

So again, I say, concrete first, then abstractions. First because they can function better knowing one concrete form and no abstract than they can knowing the abstract and zero concrete forms. And second, they are able to learn the most-useful concrete form younger and with less background than they are able to learn the abstraction.