3 ms·
> a level of verbose expression seems to be beneficial. Quorumlang did studies on this. Brainfuck is a sufficient example. > Maybe it "can", but usually the t
by Supermancho 5y ago
> a level of verbose expression seems to be beneficial.
Quorumlang did studies on this. Brainfuck is a sufficient example.
> Maybe it "can", but usually the terseness just comes from removing pointless clutter.
Abstraction is not clutter. FP adds new abstractions which have variable syntax across languages or even within the same language.
>> The idea of limiting side effects is simple to achieve through modern language "static" functions and other mechanisms to the same degree.
> No it isn't - if it were then we'd see non-functional languages that had effective control of side effects, and we don't.
This is circular logic. Languages would use FP if they saw the value because FP is worth using.
A program can be written in a conceptually non-fp language, that is composed of functions without side effect. Practically, this has no advantage, so no effort is put into going farther in that direction with the syntax.
> I'd argue that hidden mutable state (which is the essence of non-functional programming) is inherently unsafe - non-threadsafe by default and, even more dangerously, confusing to the reader by default.
I know side effects are a feature that can be managed, but this requires discipline. People try FP-centric languages, but unless someone pays them, generally people stay away from it except in spurts (eg map, fluent chaining, etc). This should give some pause, as to what that means. GL with whatever.
- lmm 5y ago> Brainfuck is a sufficient example. How so? It's both very verbose and not very maintainable. > Abstraction is not clutter. Most of the overhead in non-functional languages is not abstraction. > FP adds new abstractions which have variable syntax across languages or even within the same language. What are you talking about? Generally FP languages have less special-case syntax and less special-case concepts, e.g. fewer control flow keywords, exceptions are less prominent, coroutines don't use special keywords or new concepts, mutable variables aren't needed.... I guess do notation is more common in functional languages, but it's a very lightweight piece of syntax sugar that obviates a bunch of what would be special-case syntax in less functional languages: http://philipnilsson.github.io/Badness10k/escaping-hell-with-monads/ http://philipnilsson.github.io/Badness10k/escaping-hell-with... . > A program can be written in a conceptually non-fp language, that is composed of functions without side effect. Static doesn't mean side-effect free, and a binary distinction between "side effect" and "not side effect", while somewhat useful, is very crude. But the biggest issue is that it's not practical to write without side effects unless the language's standard library, ecosystem, and most of all culture support it. > People try FP-centric languages, but unless someone pays them, generally people stay away from it except in spurts (eg map, fluent chaining, etc). This should give some pause, as to what that means. On the contrary, popular programming culture creeps slowly in the FP direction every year. Five or ten years ago map was some wacky far-out functional thing.