logoalt Hacker News

stingraycharlestoday at 12:16 PM14 repliesview on HN

I don’t understand how people can remember all these custom scripting languages. I can’t even remember most git flags, I’m ecstatic when I remember how to iterate over arrays in “jq”, I can’t fathom how people remember these types of syntaxes.


Replies

crispyambulancetoday at 1:09 PM

I am convinced that the vast majority of professionals simply don't bother to remember and, ESPECIALLY WITH GIT, just look stuff up every single time the workflow deviates from their daily usage.

At this point perhaps a million person-years have been sacrificed to the semantically incoherent shit UX of git. I have loathed git from the beginning but there's effectively no other choice.

That said, the OP's commands are useful, I am copying them (because obviously I won't ever memorize them).

show 6 replies
Cthulhu_today at 12:42 PM

I don't, I will google things and fiddle, then put it in a git alias (with a comment on what it does and / or where I got it from) and push it to my private dotfiles repo, taking it with me between computers and projects.

dzaimatoday at 4:22 PM

jj's template and revset languages are very simple syntactically, so once you're comfortable with the few things you do use often it's just a question of learning about the other existing functions (even if only enough to know to look them up), which slot right in and compose well with everything else you know (unlike flags which typically have each their own system).

Or, perhaps better yet, defining your own functions/helpers as you go for things you might care about, which, by virtue of having been named you, are much easier to remember (and still compose nicely).

deweytoday at 1:58 PM

You research it once, use it and then remember that it has "ancestor" in the command somewhere and then use ctrl + R to dig up something from your shell history.

limaoscarjuliettoday at 4:54 PM

Some things are idioms that one repeats so often they just stick, e.g. I use "grep.... | cut -c x-y | sort | uniq -c | sort -nr" to quickly grep frequency of some events from a log file.

Don't feel bad - no one remembers them all, we just remember a few idioms we use...

usrbinbashtoday at 3:16 PM

> I don’t understand how people can remember all these custom scripting languages.

We can't.

Why do you think the `man` command exists?

NoSalttoday at 6:42 PM

So, how does one iterate over an array in jq? Asking for a friend.

mgfisttoday at 12:20 PM

Same, but now with AI I don't have to remember that anymore

show 1 reply
gsprtoday at 7:09 PM

You and me both. Git is just so prevalent and fundamental to so much these days that I forced myself to use only a cheat sheet lying on my desk until I could comfortably use a reasonably productive subset by memory. Little did I know that that would make my colleagues think I'm some sort of git sage.

But jq I use maybe once a week, and it just won't stick. Same for any git features beyond basic wrangling of the history tree (but, on the flip side, that basic wrangling has eliminated 99% of the times I have to look things up).

robraintoday at 2:57 PM

If I look something up twice, I record it in Obsidian. If I need it more than a couple of times, I'll probably make an alias, a script or a mask [1] file. Autocomplete and autosuggest are essential to my workflow. And good history search.

[1] https://github.com/jacobdeichert/mask

drob518today at 3:54 PM

Nobody does. One person figures it out, then writes a blog post, and we all Google for it. Even git’s man pages are long and sometimes cryptic.

SoftTalkertoday at 3:12 PM

Yeah especially with git. All I know is pull, add, commit, push. Everything else I have to look up.

Fokamultoday at 4:11 PM

You add them into your GIT config file as shortcuts?

If you have multiple machines (/must have), just apply your user config to current machine?

TheRealPomaxtoday at 3:09 PM

If you don't have to codedive new projects all the time, there's zero reason to memorize these. If your job is to look at new codebases all the time, you probably learn to remember these commands pretty quickly.