From 20b59f327eacf7bd33896819f5eaff05c002d2e3 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Tue, 25 Jun 2024 01:14:48 +0100 Subject: [PATCH] Add daily email for 2024-06-21 Don't use aliases --- source/_daily_emails/2024-06-21.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 source/_daily_emails/2024-06-21.md diff --git a/source/_daily_emails/2024-06-21.md b/source/_daily_emails/2024-06-21.md new file mode 100644 index 000000000..12bfa64e8 --- /dev/null +++ b/source/_daily_emails/2024-06-21.md @@ -0,0 +1,28 @@ +--- +title: Don't use aliases +date: 2024-06-21 +permalink: daily/2024/06/21/dont-use-aliases +tags: + - software-development + - git + - zsh +cta: ~ +snippet: | + If you're giving a presentation or mob programming, avoid using custom aliases. +--- + +Shell aliases are a good way to increase productivity by shortening long commands, adding additional options to existing ones or creating new ones that even combine multiple commands. + +Common aliases are `g` for `git`, `gs` for `git status` and `dr` for `drush`, but they will be different for each person depending on what tools they use and what commands they type often. + +Whilst aliases are great for personal productivity, there are times I'd suggest not using them. + +If you're giving a demo as part of a presentation or working in a pair or mob, either use the full commands or explain what custom aliases or functions you're running, what they do, and how they differ from the default functionality. + +I recently watched a video where someone was using a `gc` command. + +It could have been an alias for `git clone`, `git checkout`, `git commit` or `git cherry-pick` - just to name a few options. + +It could have been something else altogether. + +Another approach I use is to have aliases auto-expand and show the full command. This makes it possible for others to see the commands being executed and reminds you, too.