3 ms·
> a lot of these queries are simple and obvious to a Q programmer I'm not sure if it was you, but I most definitely saw a couple of posts like this on HN. Each
by klibertp 9y ago
> a lot of these queries are simple and obvious to a Q programmer
I'm not sure if it was you, but I most definitely saw a couple of posts like this on HN. Each time I had just one wish: for the poster to provide an explanation, preferably from the basics, of what is going on.
As a programmer, due to my hobby, I learned a lot more programming languages than average and am pretty confident in my ability to learn new ones, yet K and Q elude me completely. Every time I get interested in it, I struggle with its complete lack of entry-level documentation. I learned J, and while it's similarly impenetrable at first, there are tons of good documentation on J wiki. With Q I couldn't find anywhere near that amount of explanations.
So, I'm not against pasting Q snippets in comments, but I think they would bring much, much more value if accompanied with a detailed explanation of both syntax, semantics, and library functions. As it stands, even things I thought I know, like that : means assignment, only add to the confusion, because looking at your code I see that apparently it sometimes means something else entirely...
- is0tope 9y agoI usually recommend Q for Mortals. Vhttp://code.kx.com/q4m3/ http://code.kx.com/q4m3/ The thing I love is that the SQL and regular programming syntax can be mixed. For instance, if I wish to apply a lambda function for each group I can do, eg: select result: {lambda code here...} column by category from table Since a table is implicitly a list of dictionaries under the hood, you can iterate over a table where each column will be a dictionary. Tables and dictionaries are first class objects in q, so it is a lot easier to reason about certain manipulations as they are essentially the same as if you had used regular code. One issue I've always had with SQL itself is that I learned KSQL first, and the way many things are done in regular sql just seem strange.