Live data from Hacker News

Stages of denial in encountering K

nsl.com

21–30 of 432 posts

Re: Stages of denial in encountering K

#21
post #5
post #2

If you are stuck in a boring language and want something more concise, you don’t have to give up legibility by going to K. There are plenty of languages where you are not expected to use “for” loops. Python/numpy is most accessible and probably closest to “instant gratification”. Mathematica is great for, you know, mathematics, but you’ll need a license. And there is always haskell.

k is perfectly readable. That's like, one of the biggest points of the post. The post mocks the mindset featured within your comment. None of the languages you listed are quite as readable as k to someone who knows it. All of the languages you listed are significantly slower and feature none of the benefits of a concise notation, even with fast.ai's Python style guide made to imitate Arthur Whitney. http://www.eecg.t…

> k is perfectly readable [...] to someone who knows it

A great example of a tautology. Every language in existence passes this test...

The real test is a language that is readable by those who don’t know it.

Re: Stages of denial in encountering K

#23
post #21
post #5

Earlier quoted context omitted.

k is perfectly readable. That's like, one of the biggest points of the post. The post mocks the mindset featured within your comment. None of the languages you listed are quite as readable as k to someone who knows it. All of the languages you listed are significantly slower and feature none of the benefits of a concise notation, even with fast.ai's Python style guide made to imitate Arthur Whitney. http://www.eecg.t…

> k is perfectly readable [...] to someone who knows it A great example of a tautology. Every language in existence passes this test... The real test is a language that is readable by those who don’t know it.

If you don't know the language, you won't be writing, editing or improving code in it anyway. Your test is therefore irrelevant for programming languages.

Re: Stages of denial in encountering K

#24

His diff was lame, I'm sure the coworker would have gone along with Math.max(...list);

That hack isn't guaranteed to work with long lists, since the standard allows a fixed limit on argument count. For example, in Node 12:

  > Math.max(..._.range(0, 1000000))
  Thrown:
  RangeError: Maximum call stack size exceeded

Re: Stages of denial in encountering K

#25
> +/!10

I personally find the given example harder to read than the equivalent in python/matlab/javascript with lodash/probably many other languages

sum(range(10))

sum(1:10)

With "K", you have to know a few new conventions. In the second case you just have to read, and the data flow is more obvious.

Re: Stages of denial in encountering K

#26
post #23
post #21

Earlier quoted context omitted.

> k is perfectly readable [...] to someone who knows it A great example of a tautology. Every language in existence passes this test... The real test is a language that is readable by those who don’t know it.

If you don't know the language, you won't be writing, editing or improving code in it anyway. Your test is therefore irrelevant for programming languages.

Perhaps, but passing this test implies a lower learning curve, which is extremely relevant for programming languages.

Re: Stages of denial in encountering K

#27
post #2

If you are stuck in a boring language and want something more concise, you don’t have to give up legibility by going to K. There are plenty of languages where you are not expected to use “for” loops. Python/numpy is most accessible and probably closest to “instant gratification”. Mathematica is great for, you know, mathematics, but you’ll need a license. And there is always haskell.

"Mathematica is great for, you know, mathematics, but you’ll need a license."

Incidentally, if you have a relatively recent Raspberry Pi you already have a Mathematica license.

Re: Stages of denial in encountering K

#28

Earlier quoted context omitted.

Many smaller CS departments in the US have no such a course in their curricula. There simply aren't enough professors to maintain that breadth of courses in those departments.

Really? That’s quite surprising; I would expect all of them to have some sort of “programming languages” course or similar…what classes do they have then?

AFAIK most or all of those curricula do include a sirvey course for programming languages.

IIUC the GP was talking about courses that specifically focused on functional programmimg.

Re: Stages of denial in encountering K

#30
post #26
post #23

Earlier quoted context omitted.

If you don't know the language, you won't be writing, editing or improving code in it anyway. Your test is therefore irrelevant for programming languages.

Perhaps, but passing this test implies a lower learning curve, which is extremely relevant for programming languages.

It really doesn't. k's ancestors were taught to high school students and admin in incredibly short spans of time. Here's an anecdote from Kenneth Iverson about a man who learned APL in two weeks, completely alone, and the results after he taught his students it:

My daughter Janet attended Swarthmore High School, and recommended Rudy Amann (head of the math department) as an excellent teacher. I therefore approached him with a proposal that we put an APL terminal in his school as a tool for teaching mathematics, suggesting that he first spend the summer with the APL group to assess the matter.

Rudy responded that he could spend only two weeks, which he did. I gave him an office with a terminal (and the Calculus text in APL that I had written after our earlier experiment with high school teachers), and invited him to come to me or anyone in the group with questions. Since he never stirred from his office, I despaired, but at the end of the two weeks he announced that he wished to go ahead with the project.

Rudy was pleased with the results, and told me of canvassing those of his students who went on to college, finding that they were pleased with the preparation he had given them. One thing he had done was to use some of the final two “review” weeks to show them the translation from things like +/ to the sigma notation they would encounter in college.

Here's another where they taught it to high school teachers, with a direct explanation as to how students responded:

I believed that APL could be used in teaching, and Adin said that to test the point we must take a text used in the State school system, and try to teach the material in it. He further proposed that we invite active high school teachers.

We hired six for the summer, with the plan that two (nuns from a local school, who could provide a classroom in which we supplied a computer [typewriter] terminal) would do the teaching, while the other four (with a two-week head start) would write material.

To our surprise, the two teachers worked at the blackboard in their accustomed manner, except that they used a mixture of APL and conventional notation. Only when they and the class had worked out a program for some matter in the text would they call on some (eager) volunteer to use the terminal. The printed result was then examined; if it did not give the expected result, they returned to the blackboard to refine it.

There were also surprises in the writing. Although the great utility of matrices was recognized (as in a 3-by-2 to represent a triangle), there was a great reluctance to use them because the concept was considered to be too difficult.

Linda Alvord said to introduce the matrix as an outer product — an idea that the rest of us thought outrageous, until Linda pointed out that the kids already knew the idea from familiar addition and multiplication tables.

Finally, it was this interest in teaching that led us to recruit Paul Berry, after seeing his Pretending to Have (or to Be) a Computer as a Strategy in Teaching when it appeared in Harvard Educational Review, 34 (1964), pp. 383-401.

(From KEI's delightful but sadly unfinished autobiography: https://www.jsoftware.com/papers/autobio.htm)

Post reply on HN