Pre-Course Week 4: Fizzling Out of the Pre-Course
Tags: makers, ruby, tdd, rspec
Published: 2019-11-10 09:40:27

At the start of this week, I began the fourth and final week of the Makers pre-course. Week 4 covers Test-Driven Development(TDD), pairing over the *"FizzBuzz"* challenge, a project named *"student-directory"* and finally making my CV(arguably the hardest part of the course so far). I say that because like most people I find it weird to almost try to sell myself to potential employers, it's like I'm a phone and I need to tell them about all my new features and capabilities.

TDD/PAIR-PROGRAMMING

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ek164cy8x8264cn7c5tn.png)

So for this section, I had to meet up with someone from the cohort to do the *"FizzBuzz"* challenge with. After that we started the Test-Driven Development(TDD), this is where you write tests and then make your code pass them you continue to do this until the program does what you want. We used the ping-pong pairing method, this is where I'd write a test my partner would make the code work then they'd refactor it and then the roles switch he writes a test I make it pass then I refactor it. The challenge we did wasn’t particularly hard and we had already done it although getting used to *"RSpec"* syntax was challenging. We first had to require our file at the top, as you can see. the *"it"* part is our test we put our function(*"fizzbuzz()"*) into *"expect"* then we use *".to eq"* and set what we want the result to be. We run the *"RSpec"* file and it tells us where the code went wrong and we work on getting the code to do that. It was quite a useful method of coding this way it made us think about one problem at a time, which focused our attention.

STUDENT DIRECTORY

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/p8yqb0i0hmzsdo13sbjl.png)

The next challenge of this week was the student directory which was a programme that allowed you to add, save and load students, and then display all these students. This was like a recap on all the other lessons because we were putting all the things we had learned previously to use. We learned something called a *"CSV file"* which allowed us to store our information and use it when we needed it like some sort of database. This can be very useful because it's just a file so no need to download anything to use it. All you need to do is open the file and run an *"each"* loop on our array, create a data structure, join it together with a comma in between and finally puts it to your *"CSV file"*. Then to load it all you have to do is reopen your file, run an *"each"* loop on *"file.readlines"* set your variables (I have *"name"* and *"cohort"*), then push the students onto an array(I use a method for this) and voila the students are loaded.

![Alt Text](https://thepracticaldev.s3.amazonaws.com/i/ojmxgiths4qoitskvbhe.png)

CURRICULUM VITAE

The last part of this week was creating a CV, this was quite difficult because I'm not a great writer(although I'm working on it) and it feels kind of unnatural trying to be your own hype-man. Although Makers did provide some good example and templates which helped me out a lot. It was nice to see how other people approached it, one of the main things they said was to have an engaging opening paragraph because employers tend to read the first paragraph and unless you catch their attention there they'll probably skim over the rest. After I got it done I was very happy with it, we'll be going over our CV's again onsite so I'll know how good mine is then.

SUMMARY

Ultimately I feel like this week was doing the final touches for getting us ready for the onsite course. Monday is the start of onsite and I honestly can't wait, so I'll tell you about it next week.