WDI week 2: the internet, real web apps and the front end07 Oct 2013
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.