Forked from JoshCheek/why_i_chose_fish_over_bash_for_students.md
Created
January 19, 2019 13:22
-
-
Save xen0f0n/6d1d4e48ca28872365686a2ed5015ca2 to your computer and use it in GitHub Desktop.
Revisions
-
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -63,7 +63,7 @@ It understands program options and lets you tab complete to see what the option ### Highly compatible with bash Syntax for common use cases is usually the same: Wildcards are the same -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -39,7 +39,7 @@ The case for Fish ### Highlighting Fish will highlight the command they are typing differently from the arguments they are giving, making it apparent that this first bit of text is different. If it is not made explicit like this, students can go months before they understand that the first thing they type is a program and the things after it are arguments.  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,8 +10,8 @@ TL;DR Fish addresses many of bash's shortcomings and is much kinder to newcomers, with only 3 or 4 new things to learn for people coming from Bash. The decision give students my defaults -------------------------------------- I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students would defer all choices and 6 months into the program wouldn't have so much as a coloured prompt. Why does a coloured prompt matter? It means that every command they type, they have to scrutinize carefully to see what the command was and what the output was. Add that to all the other costs of being new, and it gets expensive quickly! -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Why I chose Fish over Bash for students ======================================= I'm currently the lead instructor at [Code Platoon](http://www.codeplatoon.org/) and an instructor/developer at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -95,7 +95,7 @@ Fish handles string escaping and allows you to edit across lines. I'm not sure w  Bash only recently got basic data structures like hashes and arrays, and the syntax to use them is both unintuitive, and forgiving of mistakes (meaning it is easy to do the wrong thing, and difficult to realize it). Here's an example: setting arrays involves complex syntax, whereas in fish, it's the same syntax you use for everything else (a command followed by args) and look how many ways there are to access it wrong in bash, many of which you wouldn't realize you got wrong unless you knew to check it against an element with a space. And you have to opt into safe behaviour by quoting everything... I'm not even sure what the unquoted use case is!  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -79,7 +79,7 @@ Pipes are the same ### Things Fish does much better than Bash It correctly handles string escaping where bash completely falls down (Bash later added `$'this kind of string'` to compensate).  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -63,7 +63,7 @@ It understands program options and lets you tab complete to see what the option ### Highly compatible with bash It's 90+% compatible with bash, for common use cases: Wildcards are the same -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ It highlights quoted args differently to let you know they are a single argument ### Suggestions Fish will suggest previously typed commands. What was that command to start postgresql? type `pg` and it will suggest whatever I put last time! This is even directory aware, so that suggestions will be be prioritized based on where I use them!  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -37,31 +37,31 @@ My perspective: We are installing many new things already, and don't accept this The case for Fish ----------------- ### Highlighting Fish will highlight the command they are typing differently from the arguments they are giving, making it easier to understand how the shell parses commands. If it is not made explicit like this, students can go months before they understand that the first thing they type is a program and the things after it are arguments. Even with this, they often don't understand how the arguments are delimited or how quoting works. They resort to memorizing comands and have no ability to reason about things like adding additional arguments.  If they type an incorrect command, it highlights this in red, so they immediately know, as opposed to knowing when they get an error message after running the completed command.  It highlights quoted args differently to let you know they are a single argument, and if you have incorrect syntax, it highlights this in red:  ### Suggestions Fish, for example, will suggest previously typed commands What was that command to start postgresql? type `pg` and it will suggest whatever I put last time! This is even directory aware, so that suggestions will be be prioritized based on where I use them!  It understands program options and lets you tab complete to see what the option is and a brief description of the option:  ### Highly compatible with bash It's 90+% compatible with bash, for common use cases such as -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ Based on conversations I've had, there are 3 arguments for Bash: 2. Most shell code is written for Bash. 3. Most people that can help know Bash. My perspective: We are installing many new things already, and don't accept this as an argument that we should stick with many other defaults. Fish is mostly compatible with Bash. And there are only a small number of new things someone with Bash knowledge needs to learn in order to use Fish. The case for Fish ----------------- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ I used to let students choose whatever shell/editor/etc they wanted. But most st I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness. Students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, and what they struggle with, so I'll make those choices for them. So then, the question becomes _"what environment should I give them?"_ I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). In the end, I realized that most of the decisions I make for myself are better than the defaults, and due to my prioritization of feedback, my choices are generally good for learners. One of those decisions was the Fish shell, and this post is intended to explain why it is a better default than the Bash shell. The case for Bash ----------------- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,9 +19,9 @@ I used to let students choose whatever shell/editor/etc they wanted. But most st > > -- [Tim Gallwey](https://www.youtube.com/watch?v=50L44hEtVos) I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness. Students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, and what they struggle with, so I'll make those choices for them. So then, the question becomes "what environment should I give them?" I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). In the end, I realized that most of the decisions I make for myself are better than the defaults, and due to my prioritization of feedback, my choices are generally good for learners. One of those decisions was the Fish shell, and this post is intended to explain why it is a better default than the Bash shell. The case for Bash ----------------- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ I used to let students choose whatever shell/editor/etc they wanted. But most st > > -- [Tim Gallwey](https://www.youtube.com/watch?v=50L44hEtVos) I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness. Students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. So then, the question becomes "what environment should I give them?" I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). My conclusion was that most of the decisions I make for myself are generally better than the defaults. Further, due to my prioritization of feedback, my choices are generally good for learners. One of those decisions was the Fish shell, and this post is intended to explain why it is a better default than the Bash shell. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,11 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students would defer all choices and 6 months into the program wouldn't have so much as a coloured prompt. Why does a coloured prompt matter? It means that every command they type, they have to scrutinize carefully to see what the command was and what the output was. Add that to all the other costs of being new, and it gets expensive quickly! > The problem with being a beginner is that you get a lot of practice in staying a beginner. What a beginning tennis player does most of the time is chase the ball. They get to be really good at chasing the ball, but all other forms of tennis involve hitting the ball. > > -- [Tim Gallwey](https://www.youtube.com/watch?v=50L44hEtVos) I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness, and students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs, anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students would defer all choices and 6 months into the program wouldn't have so much as a coloured prompt. Why does a coloured prompt matter? It means that every command they type, they have to scrutinize carefully to see what the command was and what the output was. Add that to all the other costs of being new, and it gets expensive quickly! Tim Gallwey [describes this](https://www.youtube.com/watch?v=50L44hEtVos) for people learning tennis "The problem with being a beginner is that you get a lot of practice in staying a beginner. What a beginning tennis player does most of the time is chase the ball. They get to be really good at chasing the ball, but all other forms of tennis involve hitting the ball." I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness, and students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs, anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students would defer all choices and 6 months into the program wouldn't have so much as a coloured prompt. Why does a coloured prompt matter? It means that every command they type, they have to scrutinize carefully to see what the command was and what the output was. Add that to all the other costs of being new, and it gets expensive quickly! Tim Gallwey [describes this](https://www.youtube.com/watch?v=50L44hEtVos) for people learning Tennis "The problem with being a beginner is that you get a lot of practice in staying a beginner. What a beginning tennis player does most of the time is chase the ball. They get to be really good at chasing the ball, but all other forms of tennis involve hitting the ball." I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness, and students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs, anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ I've been advocating the [Fish shell](http://fishshell.com/) and when the choice TL;DR ----- Fish addresses many of bash's shortcomings and is much kinder to newcomers, with only 3 or 4 new things to learn for people coming from Bash. The decision to use my choices as defaults ------------------------------------------ -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,9 @@ Why I chose Fish over Bash for students ======================================= I'm currently the head instructor at [Code Platoon](http://www.codeplatoon.org/) and an instructor/developer at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. TL;DR ----- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Why I chose Fish over Bash for students ======================================= I'm currently the head instructor at [Code Platoon](http://www.codeplatoon.org/) and an instructor/developer at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. TL;DR ----- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Why I chose Fish over Bash for students ======================================= I'm currently the head instructor at [Code Platoon](http://www.codeplatoon.org/) and a instructor/developer at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and when the choice is up to me, I choose that for my students. Enough people ask about the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. TL;DR ----- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students would defer all choices and 6 months into the program wouldn't have so much as a coloured prompt. Why does a coloured prompt matter? It means that every command they type, they have to scrutinize carefully to see what the command was and what the output was. Add that to all the other costs of being new, and it gets expensive quickly! Tim Gallwey [describes this](https://www.youtube.com/watch?v=50L44hEtVos) in Tennis "The problem with being a beginner is that you get a lot of practice in staying a beginner. What a beginning tennis player does most of the time is chase the ball. They get to be really good at chasing the ball, but all other forms of tennis involve hitting the ball." I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness, and students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs, anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 14 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,12 +11,23 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students wouldn't even have a coloured prompt 6 months into the program (Turing is 7 months long, this is our first Code Platoon, it will be 4). The cost of this is that they cannot easily scroll up and see what commands they've run. Add that to all the other costs of being new, and it gets expensive quickly! Tim Gallwey [describes this](https://www.youtube.com/watch?v=50L44hEtVos) in Tennis "The problem with being a beginner is that you get a lot of practice in staying a beginner. What a beginning tennis player does most of the time is chase the ball. They get to be really good at chasing the ball, but all other forms of tennis involve hitting the ball." I eventually decided that letting them choose had little value because it meant inconsistent environments, most in some state of brokeness, and students were mostly overwhelmed by all the decisions they had to make, and were too ill-informed to understand the tradeoffs, anyway. It turns out that [overchoice](https://en.wikipedia.org/wiki/Overchoice) leads to dissatisfaction, regret, and [paralysis](http://www.ted.com/talks/barry_schwartz_on_the_paradox_of_choice?language=en). I know the tradeoffs, I understand their perspective (I make it a point to) so I'll bear that burden for them. So then, the question becomes "what environment should I give them?" I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). My conclusion was that most of the decisions I make for myself are generally better than the defaults. Further, due to my prioritization of feedback, my choices are generally good for learners. One of those decisions was the Fish shell, and this post is intended to explain why it is a better default than the Bash shell. The case for Bash ----------------- Based on conversations I've had, there are 3 arguments for Bash: 1. It is already installed. 2. Most shell code is written for Bash. 3. Most people that can help know Bash. My perspective: We are installing many new things already, and don't accept this as an argument that we should stick with the Ruby that comes on our computer (to do this correctly is a matter of setting some environment variables). Fish is mostly compatible with Bash. And there are only a small number of new things someone with Bash knowledge needs to learn in order to use Fish. The case for Fish ----------------- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,9 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students wouldn't even have a coloured prompt 6 months into the program (Turing is 7 months long, this is our first Code Platoon, it will be 4). The cost of this is that they cannot easily scroll up and see what commands they've run. Add that to all the other costs of being new, and it gets expensive quickly! I eventually decided that letting them choose had little value because it meant everyone's environment was inconsistent, and they weren't really able to make those decisions anyway. So then the question was what environment should I give them? I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). My decision in the end was basically that most of the decisions I make for myself are good ones generally (not all of them, which is why they get a student version of the dotfiles rather than my version. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ Fish addresses many of bash's shortcomings and is much kinder to newcomers, with The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students wouldn't even have a coloured prompt 6 months into the program (Turing is 7 months long, this is our first Code Platoon, it will be 4). The cost of this is that they cannot easily scroll up and see what commands they've run. Add that to all the other costs of being new, and it gets expensive quickly! I eventually decided that letting them choose had little value because it meant everyone's environment was inconsistent, and they weren't really able to make those decisions anyway. So then the question was what environment should I give them? I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). My decision in the end was basically that most of the decisions I make for myself are good ones generally (not all of them, which is why they get a student version of the dotfiles rather than my version. -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Why I chose Fish over Bash for students ======================================= I'm currently the head instructor at [Code Platoon](http://www.codeplatoon.org/) and a instructor/developer at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and choose that for my students, when the choice is up to me. Enough people ask/question the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. TL;DR ----- -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ Why I chose Fish over Bash for students ======================================= I'm currently the head instructor at [Code Platoon](http://www.codeplatoon.org/) and a developer/instructor at the [Turing School of Software and Design](https://www.turing.io/). I've been advocating the [Fish shell](http://fishshell.com/) and choose that for my students, when the choice is up to me. Enough people ask/question the decision, particularly in relation to the preinstalled [Bash shell](https://www.gnu.org/software/bash/), that I figured it's worth laying out my reasoning. TL;DR ----- @@ -64,7 +64,7 @@ It correctly handles string escaping where bash completely falls down (they late  It's much easier to set up a prompt that changes based on the success of the previous command (bash can do this, too, it just took me several years to figure out the right way to do it -- the [`PROMPT_COMMAND` variable](https://github.com/JoshCheek/dotfiles-for-students/blob/e94d46b9cd34deed8d704e0504dfde5fd7e85228/bash_profile#L112-L135), if you're curious)  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 19 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,10 +18,18 @@ So then the question was what environment should I give them? I've tried 4 diffe The case for Fish ----------------- ### Suggestions Fish, for example, will suggest previously typed commands What was that command to start postgresql? type `pg` and it will suggest whatever I put last time! This is even directory aware, so that suggestions will be be prioritized based on where I use them!  It understands program options and lets you tab complete to see what the option is and a brief description of the option:  ### Highlighting And it will highlight the command they are typing differently from the arguments they are giving, making it easier to understand how the shell parses commands.  @@ -30,21 +38,11 @@ If they type an incorrect command, it highlights this in red, so they immediatel  It highlights quoted args differently to let you know they are a single argument, and if you have incorrect syntax, it highlights this in red:  ### Highly compatible It's 90+% compatible with bash, for common use cases such as @@ -60,6 +58,16 @@ Pipes are the same  ### Things Fish does much better than Bash It correctly handles string escaping where bash completely falls down (they later added `$'this kind of string'` to compensate).  It's much easier to set up a prompt that changes based on the success of the previous command (bash can do this, too, it just took me several years to figure out the right way to do it -- the `PROMPT_COMMAND` variable, if you're curious)  When you get to scripting it, the language syntax is dramatically more understandable. I tried to write a function just now, in bash it took me 2 tries, then I wrote it long-hand so I could press up to see how it translates to one line (5 tries in the recording because I messed up). Notice that even if the fish version wasn't obvious, the autosuggestion from my previous success would let me know. And while defining it, I get syntax highlighting and proper indentation.  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -18,7 +18,7 @@ So then the question was what environment should I give them? I've tried 4 diffe The case for Fish ----------------- Fish, for example, will suggest previously typed commands What was that command to start postgresql? type `pg` and it will suggest whatever I put last time! This is even directory aware, so that suggestions will be be prioritized based on where I use them!  @@ -48,15 +48,15 @@ It's much easier to set up a prompt that changes based on the success of the pre It's 90+% compatible with bash, for common use cases such as Wildcards are the same  Redirects are the same  Pipes are the same  -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 20 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,11 +3,20 @@ Why I chose Fish over Bash for students I often get asked/challenged on my choice of fish for students. Here is my reasoning: TL;DR ----- Fish addresses many of bash's shortcomings and is much kinder to newcomers, with only 3 or 4 new things to learn for people coming from bash. The decision to use my choices as defaults ------------------------------------------ I used to let students choose whatever shell/editor/etc they wanted. But most students are not in a position to understand the tradeoffs, and they fear making changes. This would often lead to situations where students wouldn't even have a coloured prompt 6 months into the program (the other school I teach at is 7 months long). The cost of this is that they cannot easily scroll up and see what commands they've run. Add that to all the other costs of being new, and it gets expensive quickly! I eventually decided that letting them choose had little value because it meant everyone's environment was inconsistent, and they weren't really able to make those decisions anyway. So then the question was what environment should I give them? I've tried 4 different editors now (Sublime, Atom, RubyMine, and Vim), and two different shells (bash, fish). My decision in the end was basically that most of the decisions I make for myself are good ones generally (not all of them, which is why they get a student version of the dotfiles rather than my version. The case for Fish ----------------- Fish, for example, will suggest previously typed commands What was that command to start postgresql? type pg and it will suggest whatever I put last time! This is even directory aware, so that suggestions will be be prioritized based on where I use them! @@ -65,8 +74,17 @@ Bash only recently got basic data structures like hashes and arrays, and the syn And here's bash's syntax for hashes: [http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash](http://stackoverflow.com/questions/1494178/how-to-define-hash-tables-in-bash) Another thing about Bash ------------------------ Also, the relationship between .bashrc, .bash_profile, and .profile is utterly confusing and leads to bugs when things get placed in the wrong file (I'm pretty sure this is because it's inconsistent across operating systems). A very competent friend (maintainer of gems we all use, who prides himself in knowing everything) once confidently told me what they all did, and I tried it in front of them and it was incorrect. Summary ------- So, Fish addresses many of bash's shortcomings and is much kinder to newcomers, with only 3 or 4 new things to learn for people coming from bash. I documented most differences I could think of [over here](https://github.com/fish-shell/fish-shell/wiki/Shell-Translation-Dictionary), and that document goes much further than even I actually need. In our material on the shell, there's only one place we need to differentiate it from bash, which is in how environment variables get set ([1](https://github.com/CodePlatoon/curriculum/blob/4f7c376949ea9090f325c135e8cc92f499cebe4c/phase1/unix1.md), [2](https://github.com/CodePlatoon/curriculum/blob/4f7c376949ea9090f325c135e8cc92f499cebe4c/phase1/unix2.md)). So the cost is low and the value is high. Salutation ---------- Hope that explains my motivations sufficiently :) -
JoshCheek revised this gist
Feb 17, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,11 +53,11 @@ Pipes When you get to scripting it, the language syntax is dramatically more understandable. I tried to write a function just now, in bash it took me 2 tries, then I wrote it long-hand so I could press up to see how it translates to one line (5 tries in the recording because I messed up). Notice that even if the fish version wasn't obvious, the autosuggestion from my previous success would let me know. And while defining it, I get syntax highlighting and proper indentation.  Fish handles string escaping and allows you to edit across lines. I'm not sure what library bash uses, but watch what happens when I try to go up to edit what I wrote (also notice I got the name wrong at first, but fish highlighted it in red, so I knew to go fix it). It's good enough that I've written 30 line programs inside of strings in the shell!  Bash only recently got basic data structures like hashes and arrays, and the syntax to use them is both unintuitive, and forgiving of mistakes (meaning it is easy to do the wrong thing, and difficult to realize it) -- you can see the cost of this in the PATH variable, which is passed around as a string with colons between it, even though the OS gives it to a program as an ["array" of string pointers](https://gist.github.com/JoshCheek/8634f3b9efd1aeabf36c). Here's an example, setting arrays has its own fancy syntax, whereas in fish, there is no special syntax, it's the same syntax you use for everything else (a command followed by args) and look how many ways there are to access it wrong in bash, many of which you wouldn't realize you got wrong unless you knew to check it against an element with a space. And you have to opt in to safe behaviour by quoting everything... I'm not even sure what the unquoted use case is!
NewerOlder