Hacker News new | ask | show | jobs
by blain_the_train 3131 days ago
Right, a function isn't a pattern. But a pattern in the common usage is some functionality that needs to be communicated outside the core language. In languages that offer that functionaliry in the core, I would argue there no longer "patterns". I don't think many of the gof patterns are remarkable in a modern Language like clojure, because the options are obvious.
2 comments

It should be clarified that the whole thing is about functional patterns in Clojure that are expressing same functionality as well known OO patterns in Java.

Adding "it's just..." in front of functional patterns doesn't make them non-patterns.

Patterns are named ideas on how to approach/solve similar problems.

They are not tied to OO programming, Java, they are not good or bad per-se; it's just a cookbook with recipes that have names.

Otherwise nice format, I like it.

Presumably the point is that most functional programmers wouldn't have bothered giving dedicated names to, say, “strategies” or “factories”, more or less the same way nobody would bother calling “(a + b) / 2” the “average pattern”.
> nobody would bother calling “(a + b) / 2” the “average pattern”.

don't you mean.... the arithmetic mean?

https://en.wikipedia.org/wiki/Arithmetic_mean

Oh my god, and people bother themselves calling the addition o sequences of numbers as summation.

https://en.wikipedia.org/wiki/Summation

Where does this madness end? These morons even bothered themselves forming whole fields in mathematics by studying adding numbers

https://en.wikipedia.org/wiki/Series_(mathematics)

Why is humanity so wrong about such a simple concept? Why is everyone bothered to give dedicated names to concepts you fail to understand?

The mean is an precisely defined operation in mathematics, not a vaguely defined “pattern” in software engineering.

I insist: You only need “patterns” when you can't articulate your ideas precisely in a formal language, such as a programming language or mathematics.

Maybe they would call it a monoid or something much clearer like that.
Fortunately you have about an hour to edit your comment into something that, at least, is not patently stupid.
> But a pattern in the common usage is some functionality that needs to be communicated outside the core language.

What a truism. Programming languages exist to implement functionalities outside of the core language. So what? Does this mean that software projects aren't designed, and parts of the design may not be shared and integrated in other projects? Those working on software projects still need to discuss design issues, and it's easier and more efficient to assign names to recurring patterns. Those who don't understand this issue and opt to manifest their ignorance by criticizing the existence of patterns are simply fools who try to feign competence by ridiculing the consequences of their own ignorance.

Names are useless unless they convey a precise meaning. And, if you can't write down that meaning in a formal system (such as a programming language or mathematics), then it can't be that precise after all.
> Names are useless unless they convey a precise meaning.

They do convey a precise meaning. You simply fail to understand it, and even make it your point to complain about something you systematically fail to understand where you stand on your dunning-kruger corner.

> They do convey a precise meaning.

Then formalize it. Mathematically.

You are aware you're asking to "mathematically formalize" algorithm constructs, right? Either you know nothing about the subject or are trolling this thread in spite of being completely removed from the field.
Algorithms are mathematical objects, and they sure as hell can be formalized. Alas, software design “patterns” aren't algorithms. And, so long as they resist formalization, they are non-ideas.

Accusations of trolling are completely unwarranted.