Hacker News new | ask | show | jobs
by naasking 1634 days ago
> Contrary to some other languages it gives the developer maximal freedom and does not impose a particular way of doing things on the developer

You seem to be implying that's a good thing. It's literally not.

Imagine if I created a programming language where every random string of characters was a valid program (cue the Perl jokes). Clearly this language permits even more freedom than C++, but this would be a nightmare for programming.

Constrained structure is essential to programming. Sometimes you need to beyond the constraints of a more common language, in which case C++ might be a good choice, but that's the exception not the rule.

2 comments

Your assumption seems to be that if: 1) an existing language has finite utility 2) a language where any string is a valid program has no utility

, that it must be true that utility decreases with the unconstrained-ness of a language (and thus increases with more constraint).

However, this is not true. You only have to look to the other extreme to see there must be a middle ground. A language where there is only one valid program has no more utility than one where any string is a valid program.

Because this relationship of constraint and utility is clearly not simple, we can't use those extrema to judge if C++ is less useful because it gives so much control. There might be some "local extrema" where a language fits a niche. C++ might fill that niche, or it might not, but I think it needs a bit more of a nuanced consideration than "less constraint, bad".

> Your assumption seems to be that if: 1) an existing language has finite utility 2) a language where any string is a valid program has no utility, that it must be true that utility decreases with the unconstrained-ness of a language (and thus increases with more constraint).

The converse is actually the OP's argument, ie. that a language's utility increases with unconstrainedness. I merely showed that to be false, and argued that constraints are essential, but nowhere did I suggest that utility scales with the number of constraints.

>"You seem to be implying that's a good thing. It's literally not."

I think it is.