Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save xen0f0n/6d1d4e48ca28872365686a2ed5015ca2 to your computer and use it in GitHub Desktop.

Select an option

Save xen0f0n/6d1d4e48ca28872365686a2ed5015ca2 to your computer and use it in GitHub Desktop.

Revisions

  1. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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:
    Syntax for common use cases is usually the same:

    Wildcards are the same

  2. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 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.
    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.

    ![highlighting args](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/command-highlighting.png)

  3. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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 to use my choices as defaults
    ------------------------------------------
    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!

  4. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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'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.

  5. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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

    ![editing in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/editing.gif)

    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!
    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!

    ![arrays in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/arrays.png)

  6. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 (they later added `$'this kind of string'` to compensate).
    It correctly handles string escaping where bash completely falls down (Bash later added `$'this kind of string'` to compensate).

    ![fish quotes correctly bash does not](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/quoting.png)

  7. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 such as
    It's 90+% compatible with bash, for common use cases:

    Wildcards are the same

  8. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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, 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!
    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!

    ![suggestions](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/suggestions.png)

  9. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 13 additions and 13 deletions.
    26 changes: 13 additions & 13 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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
    -----------------

    ### 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!

    ![suggestions](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/suggestions.png)

    It understands program options and lets you tab complete to see what the option is and a brief description of the option:

    ![suggests option completion with summary](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/option-suggestions.png)

    ### 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.
    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.

    ![highlighting args](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/command-highlighting.png)

    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.
    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.

    ![highlights incorrect commands](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/highlight-incorrect-command.png)

    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:

    ![highlighting identifies command vs arg vs quoted arg vs incorrect quoting](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/highlight-command-vs-arg-vs-quoted-arg-quoting-error.png)

    ### Highly compatible
    ### 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!

    ![suggestions](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/suggestions.png)

    It understands program options and lets you tab complete to see what the option is and a brief description of the option:

    ![suggests option completion with summary](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/option-suggestions.png)

    ### Highly compatible with bash

    It's 90+% compatible with bash, for common use cases such as

  10. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 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.
    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
    -----------------
  11. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    -----------------
  12. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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, I understand their perspective (I make it a point to) so I'll bear that burden for them.
    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). 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.
    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
    -----------------
  13. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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, 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.
    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.

  14. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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! 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 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.

  15. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 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.

  16. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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) 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 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.

  17. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    ------------------------------------------
  18. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    -----
  19. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    -----
  20. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    -----
  21. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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! 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 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.

  22. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 14 additions and 3 deletions.
    17 changes: 14 additions & 3 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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!
    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 everyone's environment was inconsistent, and they weren't really able to make those decisions anyway.
    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 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.
    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
    -----------------

  23. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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.

  24. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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 (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.
    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.

  25. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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
    -----
  26. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions why_i_chose_fish_over_bash_for_students.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    Why I chose Fish over Bash for students
    =======================================

    I often get asked/challenged on my choice of fish for students. Here is my reasoning:
    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

    ![fish quotes correctly bash does not](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/quoting.png)

    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)
    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)

    ![success displays in the prompt](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/success_in_prompt.png)

  27. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 19 additions and 11 deletions.
    30 changes: 19 additions & 11 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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!

    ![suggestions](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/suggestions.png)

    It understands program options and lets you tab complete to see what the option is and a brief description of the option:

    ![suggests option completion with summary](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/option-suggestions.png)

    ### 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.

    ![highlighting args](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/command-highlighting.png)
    @@ -30,21 +38,11 @@ If they type an incorrect command, it highlights this in red, so they immediatel

    ![highlights incorrect commands](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/highlight-incorrect-command.png)

    It correctly handles string escaping where bash completely falls down (they later added `$'this kind of string'` to compensate).

    ![fish quotes correctly bash does not](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/quoting.png)

    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:

    ![highlighting identifies command vs arg vs quoted arg vs incorrect quoting](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/highlight-command-vs-arg-vs-quoted-arg-quoting-error.png)

    It understands program options and lets you tab complete to see what the option is and a brief description of the option:

    ![suggests option completion with summary](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/option-suggestions.png)

    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)

    ![success displays in the prompt](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/success_in_prompt.png)
    ### Highly compatible

    It's 90+% compatible with bash, for common use cases such as

    @@ -60,6 +58,16 @@ Pipes are the same

    ![pipes are the same](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/pipes.png)

    ### 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).

    ![fish quotes correctly bash does not](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/quoting.png)

    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)

    ![success displays in the prompt](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/success_in_prompt.png)

    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.

    ![functions in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/functions.gif)
  28. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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!
    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!

    ![suggestions](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/suggestions.png)

    @@ -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
    Wildcards are the same

    ![wildcards are the same](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/wildcards.png)

    Redirects
    Redirects are the same

    ![redirects are the same](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/redirects.png)

    Pipes
    Pipes are the same

    ![pipes are the same](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/pipes.png)

  29. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 20 additions and 2 deletions.
    22 changes: 20 additions & 2 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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.
    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).
    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 :)
  30. @JoshCheek JoshCheek revised this gist Feb 17, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions why_i_chose_fish_over_bash_for_students.md
    Original 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.

    ![functions in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/functions.png)
    ![functions in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/functions.gif)

    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!

    ![editing in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/editing.png)
    ![editing in bash vs fish](https://s3.amazonaws.com/josh.cheek/images/fish-and-bash/editing.gif)

    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!