> +/!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.
Stages of denial in encountering K
111–120 of 432 posts
Re: Stages of denial in encountering K
#112Earlier quoted context omitted.
is this like a code golf example? or what you expect "good" K to look like?
Which part do you not understand? In any case, raya.k is quite splendid. Did you check that one out? It's very clean and quite simple. (I linked to it right below that one.)
Re: Stages of denial in encountering K
#113Earlier quoted context omitted.
is this like a code golf example? or what you expect "good" K to look like?
Which part do you not understand? In any case, raya.k is quite splendid. Did you check that one out? It's very clean and quite simple. (I linked to it right below that one.)
I know several major languages and this program looks like noise to me. is it standard to give functions terrible names? and to not pull out constants to make things understandable? i'm unclear what semi-colons, colons and commas do here or why the lines are so long.
Re: Stages of denial in encountering K
#114Earlier 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.
If people don't know a language, yet find it readable, they are more likely to end up getting involved in doing those things. Poor readability is not a good way to keep people out; you're not selecting for talent.
Re: Stages of denial in encountering K
#115Earlier quoted context omitted.
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 h…
So then, why is K less popular than pretty much any other language? Because people are stupid? Uninformed? There's a lack of PR-minded people working with K? What exactly is your theory? It's funny that a language this flawless is slightly less popular than S or D or pretty much any other one-letter language. There must be something that makes it unappealing for the masses of programmers - what is it?
Or, to put it another way: history.
Re: Stages of denial in encountering K
#116Earlier quoted context omitted.
> I'm sorry, but that sounds like the juvenile fantasy of someone who is still in their programming puberty. For larger applications what PeCaN was saying still mostly holds true. I work on large (1-10 million loc systems) enterprise java code bases and write some side projects in k as a hobby. I can get the equivalent of around 30-40 java class files on screen at once with k. Even on poorly written enterprise code b…
...and in idiomatic K code, you apparently still need to constantly wonder what 'a' or 'X' means in your current context, with likely 5 different usages on your screen at once.
If you see many different usages of the same identifier then it’s probably a common construct/pattern you aren’t aware of.
In the same way as ‘i’ tends to be used as the current array index in a for loop - but devs don’t get confused by seeing ‘i’ used in lots of different loops.
Or kotlin devs seeing ‘it’ or class based language devs seeing ‘this’.
Re: Stages of denial in encountering K
#117Earlier quoted context omitted.
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 .
Not saying that it’s a preferred way, though.
Re: Stages of denial in encountering K
#118Earlier quoted context omitted.
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 choi…
This probably assumes your conclusion, since AP computer science probably teaches one style of programming rather than another.
Re: Stages of denial in encountering K
#119The irony of claiming to represent a readable language, that others are in denial of reality about this, and presenting your thesis on a '90s looking website with typographic lines spanning almost 400 chars at 100% width... ABTASTTSBMR than the whole sentence. OK.
That objection seems trivial.
Re: Stages of denial in encountering K
#120A million-line program isn't readable by anybody, no matter how readable the language is. If the equivalent program can be written in, say, a thousand lines in some more concise language, that's more than worth the learning curve, even if the language is strange and off-putting.
When my assumptions about the underlying problem are wrong a million line program is much easier to fix than a thousand line one.
Or rather, a thousand line concise program in a quirky language will become a million line program in a quirky language when exposed to changing business requirements.