Hacker News new | ask | show | jobs
by tugberkk 906 days ago
I believe this is the way. That is why I sometimes think whether programming can be taught by using shell environment at first. Every command is like a program and you can do a lot without loops.

Piping also helps. But maybe piping is not a good way to start, dunno.

1 comments

Shell (and its odd cousin the .BAT file) is interesting because it’s got such wildly different sets of “easy things” and “complex things” compared to almost any language.

Write some ASCII to a file - one character in Bash, 2-?? lines of annoying boilerplate in every other language

Pick the second item in an array - in Bash, a series of random-looking punctuation I can never recall to even create a true array. In any other language, roughly myArray[1]

So I worry that in some cases the student forced to only learn using shell might be bitter once they learned other languages.

PS: it’s funny you mentioned loops as a “do without” — I’d say bash is pretty okay with that — as long as you’re looping over a list of files ;)