Week 1 at Command Shift

Week 1 at Command Shift

Welcome to my Hashnode blog page! I'll be documenting my progression of learning to code, as well as my progress primarily through the Command Shift bootcamp(previously known as Manchester Codes) so I can keep a tab on where I am up to with it all as well as share my experience of it here.
Moving forward, I will be documenting everything here on a week-by-week basis. This will allow me to review and record everything that I've worked on throughout the week, the new topics covered with the tutors and also the challenges I came across.

What is Command Shift?

Command Shift is a coding boot camp that is done part-time over 24 weeks. The aim is to prepare you with the necessary skills and requirements to make you job ready for an entry-level role as a Front-End, Back-End or Full Stack developer.
The course curriculum is as follows:

  • Foundations: Introductions, CLI, Git, HTML, CSS and DOM Manipulation

  • Building Blocks: JavaScript, Test-Driven Development(TDD), Object-Orientated Programming

  • Backend: Databases and SQL, Backend Basics

  • Front End: React Framework and Testing

  • Group Project: Creating Projects in pair programming and ready to showcase at the end.

That's a brief overview of the course, and I'll be focusing on the foundation's area for the first few of my blog posts.

You can find out more by checking the link to their site here https://www.commandshift.co

Week 1: Intros, CLI and Git!

We're not limited to working within a certain area and waiting for the next week before we progress. I have just started the CSS portion of the course, however, in our intro, we were told that this would be touched on during week 3 (Foundations last approximately 4 weeks) but we are aiming to do 14-20 hours of study time outside of our lectures. In this post, I'll just be touching on everything we've covered regarding the CLI(Command Line Interface) and Git.

For our intro, we spent the first 90 minutes of the lecture meeting some of our tutors and introducing ourselves to everyone we'd be working with over the coming weeks. It's a good feeling being able to code along with individuals who are working on the same curriculum as you, as you can all ask questions and help each other out with progress and problem-solving.

For the first task, we had to install Homebrew which is a programme that installs a tonne of packages that aren't preinstalled on our Macbooks (the list is huge! https://formulae.brew.sh/formula/) We then progressed with installing Node.JS which allows Javascript to run on our laptops/computers. Next was Git, which allows us to upload to GitHub and track changes within the files that we work with. And finally, we installed VSCode for our text editor, so we will be using that throughout the course. Overall, it was a very easy experience to install everything and progress forward. The tutors were on hand to answer any issues that cropped up as well. Now that the workstation was set up, we moved on to the CLI.

Command Line Interface (CLI)

We started learning how powerful the CLI is and using it to navigate our files and folders. The usual way we would do this is through a Graphical User Interface (GUI) which is the icons on the screen (files, app icons etc) The CLI allows us to operate a little more directly, and this is how we would work with Git.

To start, we used a very basic command: pwd. This will show us what our current directory (file) we're currently working in. Moving on we learnt the ls command which lists all the directories and files that are located in the current directory we are in. We then practised using switches, which look like ls -a ls -d etc. Switches allow us to modify the behaviour of certain commands. cd allows us to move into a new directory (cd desktop, cd project etc) which means we now have access to files in those directories.

We then learnt about creating and deleting directories and files. To create a new directory, we use the command mkdir(make directory) to create a file we use touch <filename> (example: touch notes.txt) and then to delete we use the command rm <filename> when deleting a file like this, it doesn't end up in your trash like any other time. It's best to double-check the file or use rm -i which will prompt you to check to make sure you're happy.

We then started on Advanced Commands and I'll admit, this is where I struggled a little bit. Trying to understand the Pipe operator was difficult, as I was unsure of how exactly to type out the command overall. More on that soon.
Primarily the pipe operator is used to combine 2 commands and is represented by this symbol: |
An example: grep "hello world" file.txt | grep "how are you?" This is asking the CLI to search a file (grep searches a file) for the text Hello World and also to search for how are you? Time and time again I couldn't figure out how to type out that line properly, but the tutor showed me how it should look and it worked instantly.

A Murder Mystery

We had a challenge at the end of the module which was to solve a murder mystery through the CLI using the commands we had learned so far. This was an excellent exercise to show how versatile the command line is. I got stuck on part 2 of the challenge as I couldn't figure out the Pipe operator properly but got there with the tutor's help. There were 7 steps overall to progress through and by the end, it would reveal the murder. This involved using everything we'd learned through the basic cd commands to the advanced pipe operators and grep commands. A great little exercise that tested what we had learned in the CLI course.

GIT

For this, we downloaded an external source called Git-It which is an interactive challenge programme for learning the basic commands of Git, as well as creating branches and also pushing files to GitHub from your desktop.

To start, we installed git on our machines which was fairly easy to do. Then we moved on to creating a repository (known as a repo) for our work which involved using the mkdir command to create a directory and then using the command 'git init' to begin tracking the updates and changes for that folder. The first part ticked off!

We used 'git status' to check the files. This came up as red as we hadn't committed any changes to our file yet, which leads us to 'git add '. 'Add' will add the file to the staging area which means it is ready for us to commit the changes we have made to it. 'git commit -m' is what we use to implement the changes to a file (added an image, made a new text file, updated some code within a folder) it will track and change made, including just pressing the space bar once! -m means we add a small message to the commit, which allows you and others to see exactly what has been changed since the last time. Now it's time to 'push' it to GitHub.
Once the changes are made, we then 'git push origin main' to our profile. Origin means the link to our GitHub page, and main represents the main branch of that file. When pushed, the updates will be applied to the file and we can see exactly what has been updated.

We then learnt about branches! Git repos use branches to isolate work when needed. You create a separate branch from the main one so you can work on the parts you need to, without disrupting the main branch until your changes have been authorised and are ready to be merged. To make a branch you would type out 'git branch <BRANCHNAME>' and begin working on that you'd type 'git checkout <BRANCHNAME>' Now we're working within this branch and can safely make changes to a project.

The Git-It project touched on Pull requests and also Contributors as well, allowing us to add extra people to our projects. This makes Git and GitHub powerful as it means anyone anywhere can work on whatever they need to!

That's a wrap!

Phew, there's a lot here but it's safe to say I feel pretty confident with the CLI and Git, but I also feel like there is a lot more to it and we've only scratched the surface. I have started the HTML and CSS parts of the course now and will be updating with these areas next week. Thanks for reading!