Showing posts with label OOP. Show all posts
Showing posts with label OOP. Show all posts

Monday, October 10, 2016

CODE CLAN WEEK 3 - PROGRAM LIKE EFEN REYS

So I have made it to week 3... Go me! last week ramped up a bit towards the end with blocks and enumerators. The weekend homework task was to create a Karaoke bar which was apt as I was lucky to be staying at the Crieff Hydro for the weekend. Sitting on my Mac in the bar with a beer coding had just the right inspiration and atmosphere. 3 objects were created Room, Guest, and Song. All had to interact with each other and it was fun to play with the objects.

Monday's standup was interesting to hear how my cohorts also enjoyed the homework. The Monday lesson began with a bit of thought for the day and a pep talk for the cohorts to make sure we were having fun and enjoying coding. We should program like Efren Reyes who is a famous pool player. When he makes mistakes he takes them on the chin and laughs them off rather than getting all stressed. So when our code is not working don't stress it, just laugh and work through it. A good mental attitude will help us code better.

This week is SQL week, so in the classroom, lessons introduced us to databases. Lots of CRUD (Create, Read, Update and Delete). This class was made easier by creating a Star Wars example database. Luckily for me, Jamie (my son age 8) and I watched The Force Awakens in the hotel cinema the night before so I was up on my Jedi.

Tuesday and the 'SQL' homework was summed up during the 9am scrum by a fellow cohort as 'SQ-Hell'.

The homework was a challenge to format SQL queries on a database to retrieve data with Increasing complexity. The last few questions required multiple inner-joined tables! The day progressed with more SQL and introducing Ruby into the mix. Programming Ruby to push and pull data from the database meant that data used in the Ruby programs could be persistent. So we created a Pizza Shop and started passing pizza orders into the database and removing them to an array of Pizza objects. Both Luke Skywalker and Darth Vader placed pizza orders.

In the afternoon lab, we split into pairs to program methods to recover data on the pizza sales and who placed orders.


The homework challenge was to map out the Facebook database structure and identify 'one-to-one', 'one-to-many', and 'many-to-many' relationships

Wednesday and SQL continues to advance; We moved the database calling logic out to its own class and passed it an SQL query as a string... Then placed method calls on the objects using a block to retrieve the data... Check me with all that jargon in one sentence.

Thursday, following the scrum we get a presentation from Cohort6 of the projects they have been working on for the past week. They are 10 weeks ahead of us and were assigned a team challenge last Thursday. A couple of words come to mind: 'Wow!' they achieved that in a week!; and 'PANIC!' we need to do that in 10 weeks?. The brief was to create a raw JavaScript web app. The range of solutions and functionality presented was brilliant. From Dashboards for Astronauts to Munro Bagging tool, to a Disease mapper. I still have lots to learn. Afternoon and it's back into class and we are still in SQL databases, only this time we have moved into the world of Pokemon. The lesson is to create Many-to-Many database interactions, between Pokemon and their Trainers with a Joining Table. The lab was to create our own databases with Wizards and Magical Items. Thankfully Thursday is social night. Some well-deserved beers and a burrito closed off the day.

Friday is standup at 10:00am and the issue of the weekend homework. I've not had it yet but I'm guessing it's SQL databases with joined inner tables with many-to-many relationships...

So to sum up... another great week at CodeClan => still very challenging => but I have some brilliant Cohorts enjoying the Journey with me => Roll on to week 4, where we get to add an interface to our Ruby and Databases.

Tuesday, October 04, 2016

CODE CLAN WEEK 2 - AND WE ARE PUTTING THE BAND BACK TOGETHER

So week 2 starts with a scrum and then a review of the previous week's homework. I was lucky to have 3 hours of quiet time on the train back to Aberdeen on Friday where I managed to get the bulk of the homework done. It did make me laugh that Jamie my son (age 8) and I were both finishing our homework in the kitchen on Saturday evening. Jamie had grammar and reading and I was making a fantasy model pet shop using Test Driven Development (TDD).

Monday saw us learning about cats, wizards, and wands to model classes and multiple classes... No, wait, that's the other way round. The homework was to continue with classes and model a speedy car (with turbo) and a slow car (non-turbo, Normally Aspirated). The type of engine would affect the car's performance and fuel economy which would be passed into the car object.

Tuesday was a brilliant day of coding along with an instructor to form a "simple" snakes and ladders game. 21 cohorts clattering away at the keyboard churning out ruby code. The game of snakes and ladders turns out to be quite complicated if you break it down into a program. Thankfully Object-Oriented Programming (OOP) simplified it into objects, boards, players, dice, etc.

Wednesday, following the scrum, was a whole day exercise where we were split into pairs and tasked with making our own objects and having them interact with each other. The world was our oyster, so as a team, we decided to put the band back together and form band-related objects including, songs, venues, and gigs. It can get very complicated very quickly but we met the brief of having objects interact with each other.

Thursday introduced us to the 3 pillars of Object-Oriented Programming (OOP) -> Inheritance. Abstraction and Encapsulation. This covered a superclass bird object and its sparrow, duck, robin, and penguin sub-class objects. All had methods quack, chirp, and fly. (except penguin who couldn't fly). Blocks were the final lesson for the day with a small lab. Thankfully this was Thursday's "social" evening so no homework and a chance to go for a beer with the rest of my cohorts. Blocks were hard, so much chat in the pub was discussing coding

beer_array = beer.select{ |beer| beer.type}.count

Friday is revision time and a chance to go over anything we need a refresher on from the week. Oh, and we get issued the weekend homework challenge.

So week 2 is in review. Another big thumbs up to Code Clan, my instructors, and my cohorts. I can't believe how much I have learned in the two weeks. I feel part of something special and really BIG...