Live data from Hacker News

Stages of denial in encountering K

nsl.com

41–50 of 432 posts

Re: Stages of denial in encountering K

#42
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…

> You do not need to press "go to definition" ever.

Do these languages have a module system, or just copy-paste?

What do you do when you get more than a page of code? I'm skeptical of a claim that every program fits on one page.

Re: Stages of denial in encountering K

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

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.

For you, not for anyone actually working with the language. Which again points to the test being entirely irrelevant for the stated purpose.

Some random high school student probably can't read your Swift. Sure, it might help them out somehow with the Excel functions they're needing, but it doesn't change whether or not Swift is a good or bad language, or whether the test actually means anything significant.

Re: Stages of denial in encountering K

#44
> When the entire system fits in a page of code you can understand everything about it from the top down.

I'm sorry, but that sounds like the juvenile fantasy of someone who is still in their programming puberty.

Good luck fitting an operating system, web browser or air traffic control system into a page of code.

Re: Stages of denial in encountering K

#46
post #43

Earlier quoted context omitted.

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.

For you, not for anyone actually working with the language. Which again points to the test being entirely irrelevant for the stated purpose. Some random high school student probably can't read your Swift. Sure, it might help them out somehow with the Excel functions they're needing, but it doesn't change whether or not Swift is a good or bad language, or whether the test actually means anything significant.

I think a random high school student who has just finished AP Computer Science should be able to read my Swift, at least when the task itself is not complicated. Maybe not all of it, but I think it's a failure if they can't get the gist of it. (Interesting anecdote: I have gotten emails from people who have translated some of my Swift code which talked to an API endpoint I reverse-engineered to their platform of choice. They knew what at GET request is, but they were familiar with was JavaScript or Kotlin or whatever–but they were able to make use of code written in a language they couldn't write. I think that's really great.)

Re: Stages of denial in encountering K

#48
post #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,…

> “sum” word has very few meanings, especially in software engineering world

Sum types, checksums, …

Re: Stages of denial in encountering K

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

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.

Boilerplate can be stripped away, though, while you can't pull meaning out of a symbol without knowing what the symbol is.
Post reply on HN