Hacker News new | ask | show | jobs
by agentultra 3627 days ago
> that seems to be some of the least intuitive code I have ever seen

There's nothing intuitive about programming. A pencil is intuitive. Learning how to program gives us advantages but it requires effort.

The real problem here is that you don't want to learn. You'll be repeating the same mistakes.

> What are the practical applications of knowing AWK over knowing JS?

It's fast, has a small memory footprint, and plays well with unix pipes.

> Besides the shell voodoo

It's not voodoo. It's a useful programming environment for getting work done.

> I just want to understand why learning a completely new set of grammars with a very limited domain would be worth the effort.

It's a specialized language for extracting data from delimited byte-streams. It's not a big language and not a lot of effort is required to benefit from it.

Where the domain is well-understood it's great to have a domain-specific language with short-hand syntax that abstracts away the unimportant details. I don't have to define functions or call any methods. I just get some variables because I know awk just takes a pattern and splits it on a separator... it saves me a bunch of work. Once I understand the language I can manipulate field-delimited byte-streams with little ceremony.

The bonus is that awk plays well with the *nix environment. Anonymous and named pipes, etc are really useful.