zet

Global Shell Variables are Good for Learning

It occurred to me that POSIX shell just might be the simplest (if not the weirdest) language to learn first. Obviously, global variables have significant draw backs. But they are also so easy to learn when just starting out. So long as the dangers of having no scope on any variable is understood (perhaps by crashing those learning into a wall where this is a very bad thing and learning from it) then they are not only fine, but possibly preferable for beginners. It’s definitely not a popular opinion. But they are already using the shell language every time they enter a command, so might as well built on that, then build on that base into a structured language like C and/or Go. It really makes the case to use a very strictly scoped language immediately after shell to show the contrast. Once again, Python is horrible for beginners because of this, as is JavaScript.