Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A lot of folks are giving you reasonable flack around “well both of these encode it”, because encode can mean lots of things, but I think the specific feature you are referring to is that the amount of source code used to indicate the fizz buzz cycle is linear in the length of the cycle; basically a unary representation. Is that accurate?


My objection is that the author presents it as a totally different approach, but to me it looks like the same approach as the original but with constant propagation applied. (With a little time away from this discussion, i guess tbf i must admit determining the order of the group is a bit more than constant propagation)

Also with a little more sympathetic eye, i suppose the new version is more evocative of the underlying group and such representations are much more in line with the mores of functional programming. At the same time, i cant help but think its a bit pretentious to talk about being isomorphic to a cyclic group and otherwise evoke high level math, just to say, you know this program whose output by definition repeats in a very obvious pattern, well guess what, its output is cyclic.


To a sufficiently advanced compiler, any correct implementation is equivalent to any other. The difference is how we think about it.

If you look at it as taking something simple and making it needlessly complicated, then it seems pretentious, but if you look at it as taking very abstract concepts and making them more understandable with a concrete, well-known example, it's not.

This might give you a good idea of where the author is coming from and trying to accomplish:

https://blog.ploeh.dk/2017/10/04/from-design-patterns-to-cat...


> This might give you a good idea of where the author is coming from and trying to accomplish:

I've been telling people that design patterns were algebras glimpsed darkly for years, but it's nice to see someone finally write that up.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: