3 ms·
> It really does hurt some excellent languages (e.g. OCaml) that they look so alien to mainstream, working programmers. How will you explain a relative success
by klibertp 11y ago
> It really does hurt some excellent languages (e.g. OCaml) that they look so alien to mainstream, working programmers.
How will you explain a relative success of F#, then?
In my opinion "looking alien" is not important at all. To the mainstream real qualities are much less important than marketing; that's true in many areas and mainstream programming is not an exception. Given enough marketing, you can turn "alien syntax" into a perceived advantage relatively easily.
> To mention OCaml again, I find it ridiculously hard to read because there are tiny, similar-looking characters that are significant all over the place.
Have you seen J? I'll just paste a bit of code in it:
join =: 1 : 0
((([:{.[:>{.),:[:([:<(>"0))"1[:{:[:1 2 0&|:[:>([:,u"0)#]) (pr y))
)
Is it readable? I'm told that yes, it is. There are people who can read this mess just fine, no problems at all.
Readability is an artifact of familiarity and, in some cases, tooling. You can get used to reading (and writing) even the most "unreadable" of syntaxes. Ask a PERL programmer if she finds her language readable. Will she say "no"?
My point is: until readability is formally defined and we're able to measure it objectively it's utterly useless to talk about it.
> But it is Haskell's problem if it can't overcome the catch-22 that people don't use a language if other people don't use it.
Yes, but this problem cannot be solved with technical qualities alone. Was it possible we wouldn't use C, Java or JavaScript at all.
It's marketing and "killer use-cases" that matter. You want to use the same language your OS is written in, for example. Was Windows written in OCaml you'd use OCaml to write Windows programs. If there's a program you really like, which is scriptable in Lua, you will use Lua.
- smt88 11y ago> My point is: until readability is formally defined and we're able to measure it objectively it's utterly useless to talk about it. It's more defined than we, as programmers, pretend it is. There's research in cognitive psychology, linguistics, and lexicology that tells us that some things are easier for human brains to process than others. For example, if you skim through a block of code, it's easier to pick out "&&" than it is to pick out "and". There are lots of rules like this. This is partially because of the way humans read words. If yuo spel a bunhc of words wrng in a sentence in minor ways that don't alter the shapes too much, it's still very readable. That's why your example of J is very hard to read (objectively, not relatively). If someone removed or altered a few of those symbols, no one would notice upon skimming it. It's ludicrous to argue that it's readable just because some people say it is (and I think they're just bragging to begin with).
- klibertp 11y ago> There's research in cognitive psychology, linguistics, and lexicology that tells us that some things are easier for human brains to process than others. I'm not convinced that such research controls for familiarity effects. Not to mention, programming languages have much richer syntaxes than natural languages. I think (suspect), in regard to PLs, what you're talking about (you mention "skimming" later) is actually legibility - ease of recognizing letters and words. Not readability, that is ease of understanding the meaning of what's written. > For example, if you skim through a block of code, it's easier to pick out "&&" than it is to pick out "and". Why? What if the rest of the line is similarly composed of punctuation? Are you sure in a line looking like this: >&.@:/"1\and[: NB. some nonsensical J phrase you'd have an easier time spotting the "and" were it written as "&&": >&.@:/"1\&&[: > If someone removed or altered a few of those symbols, no one would notice upon skimming it. Possibly, but we're not talking about "skimmability", but readability. Removing or altering a few characters in that line would result in an incorrect, nonsensical sentence and you'd notice it right away. "Right away" is subjective, of course. I spent nearly an hour trying to read this damned thing when I attempted it for the first time. Every J phrase was a challenge then. It's still hard, but it got much easier with practice. The trick here is exactly the same as in your example: > yuo spel a bunhc of words wrng that is, once you learn how the words look like you can recognize them easily, even if they are a bit mangled. > (and I think they're just bragging to begin with) Yeah, I get the same feeling sometimes ;-) But a human brain is great at pattern recognition. It has to be trained, and it's possible that some shapes are harder to learn to recognize than others, but once you learned them... is there really a difference? Learning different PLs is my hobby, I've looked at ~80 languages to date and learned quite a chunk of them. Every single time I noticed this effect: once you internalize shapes of common phrases, you stop having trouble reading the code. It's much, much harder in some case (J is an abomination here - I'm trying to really learn it for the second year now and... it's not going that well) and easier in others (Smalltalk, Lisp, Forth, ...). But I strongly suspect every language, if studied and used enough, becomes readable.