CRUD on a REST day

It’s Sunday today. The end of another crazy week of learning how to code.

Almost every day this week I woke up at around 3am with my head full of code. I don’t know what exactly I was dreaming about but it was a mix of Ruby, SQL queries and string interpolation whizzing around in my brain. So I’m glad that I can relax a bit today.

Luckily I managed to finish my homework yesterday evening. Combining our knowledge of PSQL queries, Sinatra, Ruby and HTML/CSS we had to create a Youtube video library which allows the user to Create, Read, Update and Delete videos = CRUD!

But that’s not the only acronym we learnt this week. We also talked a lot about RESTful routing which is a specific way in which the HTTP verb (i.e. the order you give to the server) and the URL name are combined in Ruby code.

*I think*

Well, as long as I follow the example structure it seems to work, so I’m happy.

So that’s what we learnt on Thursday. On Friday’s agenda was a code quiz! Urgh… I don’t really like competition or quizzes.

We had to solve a quiz called Pling Plang Plong. Print out the numbers of 1 to 105 and write ‘Pling’ for every number that is divisible by 3, ‘Plang’ if it’s divisible by 5 and ‘Plong’ by 7. And if two or more apply you’ll get a combination of PlingPlang, PlongPlang and so on. Even though we have such limited knowledge of code, we had a lot of different solutions to this problem. Really interesting to see that! Some of us then submitted their solutions and Michael measured how fast the code ran. It turned out to be a really good fun Friday activity! So I won’t complain about quizzes in future.

In the afternoon we had time to ask questions about the things we learnt this week and I have to say that I knew most of the things! All in all week 2 went a lot better for me than week 1. I feel less confused.

And then it was time to go to the pub.

Which brings me to an important ‘side effect’ of this course. Not only do I enjoy the mental challenge but I also really, really like the people in my cohort. It’s kind of like being back in school where you get thrown in together with a bunch of random people and then spend every day with them in a small, airless room. And I’m happy to say that in our case it’s a really good bunch of random people! (The air in our classroom is terrible though.)

We have people from many different countries and with completely different backgrounds. Journalists, ex-bankers, recent university graduates, someone from a remote Greek island that I had never heard of, a girl who is going to live on a boat and travel Europe, an artist and Brazilian restaurant owner, a guy who laughs every time someone mentions the CRUD operations – he cracks me up.

It’s a really good mix of people. And they’re a lot of fun to hang out with.

Start spreading the news…

…I’m leaving today, I want to be part of it…

That song was in my head pretty much the whole day. Because today we had our first introduction to Sinatra!

(Most likely that song will also be in your head now. You’re welcome).

Sinatra is a framework which enables Ruby apps to be deployed on the web. So basically for the first time today we saw functionality that we wrote in Ruby in our internet browser. Sooooo cool!!

We just ran them on our local server, so I can’t share a link unfortunately. But still, just to see the functionality on a web page was a lot more fun than messing around with the command line applications we were writing up until now.

Sinatra seems quite straight forward so far and I feel like I understand the basics that we learnt today. Apparently there will be more Sinatra tomorrow and Friday before we learn Rails next week. Michael, our instructor, described Rails as “Sinatra on steroids”, so I’m fearing that this might mean that the complexity for us as developers will increase but let’s see. I’ll just take it step by step.

Anyway, our homework today was to put the calculators from last week into Sinatra, create an HTML page layout for them and style the website in CSS. I found the Ruby/Sinatra part relatively straight forward and then I spent a lot of time playing around with the styling of my pages. I’m really enjoying the front-end part at the moment. It’s a lot easier than Ruby and the results are a lot more satisfying. I wish I had a better eye for design though – I never really have any good ideas for the designs of my website. But I did get an ok styling done in the end, which I’m happy with for now.

New York, New York!

Week 2 day 2 – Introduction to SQL databases and binary numbers

The good thing about the first few weeks of this course is that we learn something new almost every day. And that means every day presents a fresh opportunity for understanding something. If you didn’t understand the subject yesterday – no problem, there’s most likely going to be something new today that you can give a go.

So today we learnt about SQL databases. And I got it! I find it much easier to see my data stored in tables than in those airy fairy hashes and arrays. Tables are solid. And make a lot more sense in my head.

When I told this revelation to one of my fellow students he asked me what the difference was between seeing the data in a hash or in a table (indicating that there wasn’t one and I was slightly crazy) but for me this is much clearer.

We worked with PostgreSQL in class and the homework was to figure out some SQLite database queries, where the syntax is slightly different. Google helped a lot and the homework turned out to be completely doable without any huge problems. Phew! A free evening for me today!

This afternoon in class we also learnt about binary and hex numbers. I remembered that I briefly learnt this in school a couple of decades ago and thought it was completely logical but I couldn’t for the life of me remember what exactly it was. Michael explained it really well (being his usual entertaining self) and again I think it makes complete sense. And I assume that this time it will actually stick in my head because it relates to this whole development malarkey.

Oh, and we talked about hexadecimal numbers! I’ve been using them for ages for colours in CSS but never really thought about how these weird combinations of letters and numbers come about. Now it all makes sense.

Overall a good day today!

Week 2 – Monday front end fun day

After having an awful time with my object orientated homework over the weekend, I was very relieved to see HTML and CSS on our agenda for today. Yay! Something that I know and understand!

And indeed the whole day was pretty much a breeze. We just went over a lot of stuff that we had done in the pre-work anyway. But unlike in the first week where I felt a bit annoyed that we’re just going over super basic stuff again, this time I was quite relieved to have a bit of a break from racking my brain.
I used our lunch break to sit with one of our wonderful teaching assistants and ask a lot of questions about the homework, which helped a lot.

Tonight’s homework was basically creating a web page following an example that we were given, which was a comparably quick and easy task. Almost the same task that we had to do as part of the admissions process to get into the course! So when I was done with, I sat with one of the homework assistants that come in almost every day and asked a lot more stuff about objects and classes and hashes inside hashes in Ruby.

Slowly but surely I feel like the fog is clearing up. We won’t be doing anymore object orientated programming until the end of the week, so I’ll let the knowledge settle and hopefully my brain will have made sense of it by then.

A couple of us stayed behind with the homework assistants (who are WDI graduates) and talked to them about their experiences after completing the course and how their job hunting went. Really interesting to hear but basically it comes down to: it’s really hard and the pay is low.

OK, I kind of knew that. And I’m not doing it for the money. I’m doing this to hopefully find more job satisfaction and happiness.

Once Ruby and I become friends…