4 ms·
The interviews revealed that programmers make failed attempts to relate a new programming language with what they already know. I've seen this a lot in shell c
by chubot 7y ago
The interviews revealed that programmers make failed attempts to relate a new programming language with what they already know.
I've seen this a lot in shell code while working on Oil [1]. For example, ${array} means ${array[0]} in bash and ksh-derived shells. That is, if you don't put an index on array, it evaluates to the first element in an array.
This is a weird semantic that basically no other language has. And it's been true for decades, and is documented. But people still report bugs about it on the bash mailing list (I saw on a few days ago).
I got rid of this behavior in Oil for exactly that reason, along with fixing tons of other warts, while remaining compatible. You can opt back in with 'shopt --set compat_array'.
Another issue is using (a; b) to mean grouping when { a; b; } is technically more correct. () starts a subshell in addition to doing grouping. You wouldn't really know unless you mutate a variable in the group -- it will show up in one case but not the other.
The wart where ; is required before } and not ) doesn't help.
---
So shell is full of surprises, and Oil is meant to be more comfortable for programmers coming from say Python, JS, or Ruby. People bring those expectations to shell, and they get frustrated with it.
[1] http://www.oilshell.org/blog/2020/01/simplest-explanation.html http://www.oilshell.org/blog/2020/01/simplest-explanation.ht...
- zimpenfish 7y ago> The wart where ; is required before } and not ) doesn't help. Also the spaces are required between the {} and commands in Bash which is another brainclunk to deal with.