That's a great metaphor for language smells! Some more anecdotes:
- Python shepherds you into using list comprehensions, even when it's almost always premature optimization and much harder to read than a loop. As a language smell that's not bad, it's just the worst I could think of in a post-v2 world. Luckily there's `black`, `flake8`, `isort` and `mypy`.
- Bash shepherds you into using `ls` and backticks, useless `cat`s, treating all text as ASCII, and premature portability in the form of "POSIX-ish". Luckily `shellcheck` takes care of several common issues.
- Lisp shepherds you into building your own language.
There's also tool shepherding:
- IDEA shepherds you into refactoring all the time, since it's the only IDE which does this anywhere near reliably enough. (At least in Java. In other languages renaming something with a common name is almost guaranteed to also rename unrelated stuff.)
- Firefox shepherds you into using privacy extensions.
- Chrome shepherds you into using Google extensions.
- Android shepherds you into installing shedloads of apps you hardly ever use.
- *nixes other than Mac OS shepherd you into using the shell and distrusting software by default.
- Windows and Mac OS shepherd you into using GUIs for everything and trusting software by default.
> Lisp shepherds you into building your own language.
the feeling of the racket community is that you build a DSL or DSLs in your code all the time, in any language, so why not take it seriously and codify your DSLs?
My personal feeling about this is that shared base language mecanisms such as functions, classes, control structure, interfaces imports, properties etc allow you to reason locally about some files. You don't need to read the whole library in order to understand one piece of it.
With macros this goes out of the window. You have to read all the custom macros before you can understand what is their behavior.
With haskell the same issue exists with complex monad stacks and control libraries like lens.
The ability to analyse a tiny piece of a big system is a major factor in building those in a manageable way.
I dont think list comprehensions are used to improve performance. One reason to use them is to improve readability, as the execution doesnt jump around with continue/break etc.
> - Android shepherds you into installing shedloads of apps you hardly ever use.
I disagree with you on this one but I could be in the minority. I have about 8 apps that I trust and that rarely change. I don't go looking for new apps to install and I resist attempts to use the app version of a website.
> Lisp shepherds you into building your own language
I see the propensity of developers to build DSLs in all languages. I think the act of programming shepards us into creating elaborate abstractions.
> and I resist attempts to use the app version of a website.
If you weren't being shepherded into installing apps, why are you resisting?
I could install apps on my old Nokia dumb phone, but I never resisted installing apps. It never really seemed like it was worth the trouble to install one.
I actually looked into it once, despite the system shepherding me away from installing apps.
You can improve that situation somewhat by starting scripts with `set -o errexit -o noclobber -o nounset -o pipefail` and `shopt -s failglob` to fail fast.
But then you will have to deal with the non-negligible amount of programs that use the exit value to return information. It is still better to place exceptions on failing code than to ignore errors that can wipe out your entire system, but it's not really good either way.
>since it's the only IDE which does this anywhere near reliably enough.
Have a look at the Language Server Protocol implementations for java (eclipse jdtls and to a lesser extent boot-ls). Not all the features from IDEA are there, but the gap is closing.
> Python shepherds you into using list comprehensions
I'd argue LCs have more limits than loops, and hence are easier to read (because you can make more assumptions about what it does). That said, I find nested comprehensions harder to read.
> Windows and Mac OS shepherd you into using GUIs for everything and trusting software by default.
Not sure how familiar you are with modern Windows, but you can try powershell. You can manage everything in Windows with it, and it’s a very cool shell language with a lot of feature.
I agree with what you said, but I also agree that Windows shepherds you into using GUIs for everything. It's possible to use powershell, but Windows makes GUIs seem like the "natural" way to do things.
As someone who used PowerShell for a year and has used Bash for 10+, PowerShell is much less scary than Bash. The scariest thing about PowerShell is .NET, which (at least 8 years ago or so, so cue someone correcting that below) had extensive but often low quality documentation, with undocumented features you basically had to use to write useful code, uselessly trivial code examples (think "`0 + 0 == 0`" as an example of arithmetic) and some bad names. That's not to say Bash is better, just that they still had some way to go.
Microsoft online documentation is very good. I initially spent just a weekend trying to create a nice prompt, just because I was annoyed by the ugly “PS >” when using Windows. The online documentation had everything I needed, and I enjoyed so much that I switched all my systems to using powershell as their default shell.
That will direct you to the documentation page specific to a command. That way you can discover the environment little by little by experimenting.
Also, the auto completion for all commands and their arguments is helpful to learn what is possible.
Also, if you want to keep your bash habits, be sure to install powershell 7, and enable the emacs edit mode (which is similar to bash defaults, with C-a, C-e, etc):
- Python shepherds you into using list comprehensions, even when it's almost always premature optimization and much harder to read than a loop. As a language smell that's not bad, it's just the worst I could think of in a post-v2 world. Luckily there's `black`, `flake8`, `isort` and `mypy`.
- Bash shepherds you into using `ls` and backticks, useless `cat`s, treating all text as ASCII, and premature portability in the form of "POSIX-ish". Luckily `shellcheck` takes care of several common issues.
- Lisp shepherds you into building your own language.
There's also tool shepherding:
- IDEA shepherds you into refactoring all the time, since it's the only IDE which does this anywhere near reliably enough. (At least in Java. In other languages renaming something with a common name is almost guaranteed to also rename unrelated stuff.)
- Firefox shepherds you into using privacy extensions.
- Chrome shepherds you into using Google extensions.
- Android shepherds you into installing shedloads of apps you hardly ever use.
- *nixes other than Mac OS shepherd you into using the shell and distrusting software by default.
- Windows and Mac OS shepherd you into using GUIs for everything and trusting software by default.