DEV Community

Cover image for Pre-Course Week 1: Making A Start!!
kealanheena
kealanheena

Posted on • Updated on

Pre-Course Week 1: Making A Start!!

This is the first entry in my Makers blog which I will be using to make a record of my progress through the Makers Academy course. Wish me luck!
At the start of this week, I began my journey through the Makers Academy Pre-Course, It is a little nerve-racking but also somewhat exhilarating to be starting on the path to a new job. Even though I've practised with other languages like HTML, CSS and JavaScript, Ruby is a whole new language with different syntax and new functionality, so I'm looking forward to seeing what it can do!! Although the first week is covering version control and the command line so I'll just have to wait.

COMMAND LINE

The first part of the Pre-Course after getting your laptop set up is the basics of the command line, to access the command line I have to use the terminal (the terminal is that black screen you see in every hacker movie!), I was taken through the basics of the command line using commands like "ls" to list the files in a directory or "cd" to change your current directory ect., although you can do all of this with the GUI(graphical user interface) the command line is faster and can do a somethings that you can't do with the GUI, Like, in the case of parameters, which are additions to your commands to make them more specific, you can use the "-a" which is a parameter that goes with the "ls" command to specify to show hidden files along with the rest of the files in your current directory. The command line has the additional benefit of being able to everything the GUI can do(even if its not as visually pleasing), this includes viewing files through the "cat" or "less" commands you can even specify to only see the first or last few lines of a file using the "head" and "tail" commands.

Alt Text

Now that I've completed the basics of the command line I'm learning the more complicated uses but this also means more functionality, like pipes for example which can be used to chain commands or even redirections which can be used to overwrite files and make new files if the redirections destination does not exist. Wildcards are also very useful if your looking for something specific within your computer cause they can be used to specify a search for example if you were looking for all your .rb files you could type "find. -name ".rb" -print"* this would fin all the files with .rb in their name and print them in the console. I used permutations throughout this section as well as how to add and remove them with the "chmod" command which enables you to add the "x"(execute) permission to the .rb files allowing me to use them in the terminal.

The next things I'm learning are under the Advanced Commands part of the Pre-Course. I started by using a Shebang which was this little line of code "/usr/bin/env ruby" which allowed me to run Ruby files without explicitly telling it to use the "ruby" command. I also used the "echo" command which simply prints whatever text you give it but it can be used to push text into a file as well, which would look like this "$ echo "Hello!" > hello.txt", which can be useful for adding short strings to a file. I got to set some environment variables which are useful for making shortcuts to common commands, you could use this to set the "history" command to "hy" using "alias hy="history"" saving you time typing up lengthy commands. Although this is best to do using the "~/.bash_profile" which makes these shortcuts accessible even if you close and reopen the terminal. The last thing I was taught in the command line was "vim" which you can use to make file and changes to it, by changing the mode you're in, "i" to insert text, "o" to open a new line, "dd" to delete a line ect., this is particularly useful because it means you can manipulate files through a shell(text-only command-line).

Alt Text

VERSION CONTROL

Alt Text

The second and last section of week ones lessons was version control and by extension Git and GitHub. The first thing I had to do was set up which was pretty standard just copy and pasting some code into the console and signing up to GitHub, easy enough, but then I'm shown this whole new way of storing files using repositories, where you have to add files to a staging area and then commit them usually adding a bit of information on how you changed the file, which seemed like a lot of effort at first, but later down we're shown why we went through all this extra effort. Git stores all the information you committed in the "git log" which you can use to see all this information and better yet you can go back and retrieve the old files using "git checkout"(yes all git commands start with "git"). This feature is very useful as you can use it to explore different possibilities with what code you want to use in a given situation, and after if you decide you want to return to the original branch you can by using "git checkout master" to get you back to the master branch. Git also has GitHub which is very similar but a little more aesthetically pleasing, you can use it to share your code so other people can work on it or "pull" other people code so you can help, which means this is a great developer tool for collaborating with other developers.

SUMMARY

Its only my first week and I've still learned a lot I had used the command line before this but not the extent I've used it this week with doesn't really surprise me because I only really used the main commands ("ls", "touch", "cd", "mkdir"). I'm looking forward to using Git and GitHub too because they're completely new to me which means there's a lot more to unpack, but I like using them and I can see them being very useful. So next up is Ruby so that'll be exciting, I've already got a head-start on it but I did do a lot of JavaScript leading up to this course so I'm feeling ready for it. I'll be back next week to tell you about Ruby!!

Top comments (0)