Live data from Hacker News

Stages of denial in encountering K

nsl.com

31–40 of 432 posts

Re: Stages of denial in encountering K

#31

Are reduce and lambdas really that cryptic/complex to people? I think I need an adult. -.-

range(100).reduce(plus, 0) isn't cryptic, what's cryptic is single character symbols. Looking at that line, unless you know K specifically, it's very difficult to figure out it's a reduce. Where as `sum(range(100))` is pretty self explanatory to most programmers who don't know python.

Re: Stages of denial in encountering K

#32
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.

Lots of OOP boilerplate makes absolutely no sense to me because I have never had to write such code. I would consider Java and C# unreadable compared to an array language.

Re: Stages of denial in encountering K

#33

Are reduce and lambdas really that cryptic/complex to people? I think I need an adult. -.-

range(100).reduce(plus, 0) isn't cryptic, what's cryptic is single character symbols. Looking at that line, unless you know K specifically, it's very difficult to figure out it's a reduce. Where as `sum(range(100))` is pretty self explanatory to most programmers who don't know python.

Not to mention it's a lot easier to search for `reduce` than `+`.

Re: Stages of denial in encountering K

#34

> +/!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.

As I understand author’s point, your example with “sum” is only valid because “sum” word has very few meanings, especially in software engineering world.

Even the word “product” would introduce certain ambiguity in context of real world codebase: is it “math” product or some “domain” product?

It’s even worse with most other words.

So if in any given codebase you still have to know the specific meaning of every word, how is it different from having to know specific meaning of every K symbol?

Re: Stages of denial in encountering K

#35
post #11
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.

What does "legibility" really mean? Presumably it means something like the ease of going from looking at code to understanding what it does and how, and having a mental model to reason about the code and what modifying it will do. How many times have you opened a Java/C#/C++ project and opened up class file after class file trying to understand how the whole thing is pieced together, faced with a monstrous system and…

> However, with Python (or any mainstream language) you are only looking "down". You see what the function uses and how. You cannot see how the function itself is used.

You could find cross references…

Re: Stages of denial in encountering K

#37

Earlier quoted context omitted.

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.

Fair, but I from the context of the top comment I was talking more about being able to recognize and use basic functional constructs.

Re: Stages of denial in encountering K

#38
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.

Uh, no? I read a lot of code, and much of it which is in languages I cannot write. But I can often get the gist of what it's doing, and this in itself is quite a useful thing to be able to do.

Re: Stages of denial in encountering K

#39

> +/!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.

You still need to know that range starts at 0 and the end is not inclusive. Also, the second example is not the same as the first one, unless the second is non-inclusive.

Re: Stages of denial in encountering K

#40

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?

My CS program (class of 2007) was mostly c++. There was one semester of Java, but it was optional.

We learned fundamentals, discrete math, symbolic logic, and also "databases" (read: MS Access), object-oriented design, and I forget what else.

With the benefit of hindsight, I feel like I overpaid for that education :)

Post reply on HN