Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: why not promote the plague ? (brace|rc|alternative|modern) syntax



Well, context is king (as well as being for kings). The shell started with dead simple syntax that couldn't do anything but run other commands, one at a time in order every time. No conditionals or looping, not even variables at first. 

Since running other commands is still the shell's primary job - it's a UI first, an API second - everything that was added to make it a usable Turing-complete programming language was designed to minimize interference with day to day operations. Stuff like how assignment statements can't have space around the operator, using a variable usually means it has to be expanded explicitly with $, and on and on. 

Every new feature added over the years was carefully woven into the syntax in such a way that the minimum number of old scripts and user habits would break. Everything Korn added to ksh, most of which was adopted exactly as-is by the creators of bash and zsh. Everything added since. It's a delicate tightrope act.

You make it sound like reckless devs are sacrificing elegance in the pursuit of power, but that pursuit started with the power to program the shell at all; it hasn't really been simple and elegant since it first grew parameters. I certainly don't think the teams working to improve the shells have destroyed something beautiful in a mad dash to make a super expressive proglang. 

Mark J. Reed <markjreed@xxxxxxxxx>


On Thu, Dec 12, 2024 at 17:30 Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:



On 2024-12-12 13:30, Lawrence Velázquez wrote:
> I don't begrudge anyone their productivity shortcuts, but IMO there
> are too many asterisks and pitfalls to recommend the short forms.
> (Shell scripting is already a minefield of asterisks and pitfalls
> and other mixed metaphors; new ones should be introduced with care.)
That's the sort of comment that would save a beginner endless hours of
grief.  One should know what to expect.  I myself expected something as
clean and precise as C.  To know ahead of time that shell is nothing
like C, and that cleanliness has been long since lost in the pursuit of
power -- but that that power can be awesome -- would have been invaluable.





Messages sorted by: Reverse Date, Date, Thread, Author