WDI week 2: the internet, real web apps and the front end

CSS is awesome

Two down, 10 to go!

The second week of WDI has been much more of a mixed bag in terms of the topics we covered. Awesome in that we now know enough to build a real, working application from back to front, but tough because of the breadth of new material we had to cram into our brains in five days.

We spent Monday morning learning about the internet. Stuff like ports and protocols and IP addresses and the cloud (yup, turns out it's not really a cloud), which was important in setting us up for what we were about to get onto that afternoon: Sinatra.

Sinatra is a Ruby framework (similar to Rails but less bulky), which formed our introduction to concepts like convention over configuration, the philosophy behind most web frameworks. It stems from the fact that there are several core things that will be common to most applications - things that have to be there in order for the app to work. The idea behind convention over configuration is that if everyone does these things according to a standardised set of conventions (rather than creating a new process from scratch, independently and in slightly different ways every time), the code of any app using the framework will avoid repetition, be more efficient and more easily understandable by anyone else looking at or working on it.

Sinatra also helped us understand things like URL structure (and how parameters entered into forms on the page affect this), HTTP actions and methods, and the importance of separating your logic (back-end code) from your views (the part of your app that determines what the user sees).

Tuesday we spent the morning on HTML and CSS, which was a welcome break from learning new things for me. The front end is something I've been doing for quite a while already, so it's where I'm most comfortable at this point in the course. I think the opposite is true for some of the people from other engineering backgrounds, who maybe learnt to program in different languages, but haven't necessarily had any experience with (or interest in) front-end development.

In the afternoon we covered REST, which stands for representational state transfer. This is another set of conventions, this time to say which routes (or HTTP requests) should modify data. We finished the day with an introduction to RSpec, which is a testing tool for Ruby. Testing forms the core of a process called test-driven development or TDD. This is a way of working adopted by a lot of forward-thinking tech companies, and we're also going to be following it for our projects throughout WDI. The idea is that you have a separate file in which you write tests to run against the code you've written. Once every test is passed, you know your app is working, at least to the specifications you have defined in your tests so far. The process inevitably involves a lot of refactoring as you work through the tests and find more efficient ways to integrate new code into the code you've already written.

Wednesday morning was advanced CSS (again, nothing particularly new here for me). We covered things like the box model, more complex selectors and media queries for responsive layouts.

The afternoon was JavaScript time. I'd not done a huge amount with JavaScript before, but am relatively comfortable with the syntax having completed Codecademy's JavaScript track. However, Codecademy doesn't touch on using JavaScript in the browser at all, which is our primary use for it in this course. So learning about things like event handling (writing JavaScript that will be executed when a user does a particular thing or triggers an 'event' in the browser) was another learning curve for me.

Thursday was an all-day lab, where we got to practise with the JavaScript from yesterday's lesson. Although an all-day lab session was generally a great idea, as it's awesome to get time to play around with actually using what you've been learning, I found I was grasping this new in-browser JavaScript stuff slower than I'd have liked, which I found a little frustrating.

Friday morning we recapped everything so far by making a movie search app. This involved pulling data from the Open Movie Database API, interpreting a JSON file and practising our RESTful routing. We finished Friday afternoon with learning about prototypes in JavaScript.

Overall I'm still much more shaky than I'd like to be on JavaScript, and I feel like we're progressing at such a pace that I'm not really getting time to fully understand things to the extent I'd like before having to move onto something else. But I'm pretty sure this is intentional, and that it will all fall into place with more practice over the coming weeks.