Week 5

Week 5

We get to play with the internet! Weeks (four is still plural...) of coding towards web development, and only now do we get to touch the internet. And hey, it's pretty cool to actually know some of how the internet works.

Also, URLs aren't URLs. I mean, I'd kinda heard it before, but it's still weird.

Also, also, modern browsers don't use all of the HTTP protocol. Which is disappointing, in a way. Obviously I'd be more disapoointed if I understood all the things involved, but you know, there's a sadness in principle...

Status code 418 is "I'm a teapot".

So, Sinatra. Sinatra's a library that helps you build web apps. When you boot up the server, it says "Siantra has taken the stage." When you shut it down, it says "Sinatra has finished his set (crowd applauds)." For that alone I'm pretty comprehensively in favour of it. Apparently it's pleasantly unonpinionated in a way that Rails isn't (or Enrique, for that matter...). Having had the problems with Bootstrap that Enrique likens to those Rails, I'm slightly wary, but then I'm pretty happy with my CSS - my web development... well...

Anyway, it's really satisying to create a web application for the first time. Even if it just boots up a picture of a cat. It feels like you made a thing! And that's cool! And it's not even that hard! Well, the cat bit, anyway. I imagine there's more to it later...

Enrique doesn't like writing erb (or html, really) as it involves too much typing. I find haml different and scary so will avoid it as until the last moment, clinging desparately to my familiar Walkman as all around delight in their shiny new iPods. But that's still weeks away. For now, on this one small point, I'm safe.

Oh, also, urls are case sensitive. This, probably more than anything else, blows my tiny little mind.

So, I've spent a year working as a freelance web designer. I work in HTML and CSS, and think I know them reasonably well. At the very least, I think of myself as being pretty much up to date. I have, in fact, been known to complain about other web developers not using modern techniques, and how they really need to read, you know, the internet some time. So, this week I found out that there's a <main> element that I had no idea existed. I guess I need to read the internet sometime...

But yeah, you're never all that. There's never an excuse to stop learning. And hey, if you learnt more, maybe you'd be a little higher on the CodeWars leaderboard...

Still, nice to hear actual people talking about semantic HTML, and good CSS. One of the glorious things about Makers is that there are interesting, interested people all around you, ready to talk about all these things I'd spent ages jsut learning on my own. It's really nice to have an experienced developer explain actual best pracrtices, rather than just scraping them together of a few online articles. Not, however, sure how possible it is to code a page with no <div> tags... Good challenge, though. Never an excuse, and all that...

You can deploy software on the internet with

git app:create <appname>

and

git push heroku master

That's it. I don't want to seem like I'm ungrateful for this glorious gift, or anything, but this seems a little easy. Like, there should be a higher barrier to entry. Some kind of test. Even just a small riddle... Doesn't even need to be that hard...

Heroku's another thing we have to thank the Ruby community for (see also Gems, which are little bundles of open source code, easily sharable and installable, and pretty amazing). Thanks, Ruby community!

If you really want, you can make Sinatra apps really complicated. This is another one of those things that seem pretty appalling and unnecessary now, and in a week or so will just seem pretty natural. At some point I may get used to that phenomenon, but that might involve retrospection, and for now there just isn't time.

Only a little sick of Sudoku. Very sick of buttons. Seven "buttons". Two actual buttons, two input[type=submit]s and three links. All class .button. Won't stay in a line. Two of them are roughly a pixel and a half off. Despair. Mockery from people that don't care as much about button alignment. Deep unhappiness.

Finally, we get a picture of how git use looks in a real project. It's kinda cool. Doing a small version of it makes you feel like a real developer (NB: you are definitely not a real developer). It's amazing how much of a difference following the right process makes. A lot of education involves lying, necessarily. You can't just tell people to start coding with several branches at once because (a) you just don't need it, and (b) it'll confuse the hell out of you. But every now and again, in the first few weeks, I've gotten the sense that the way we're doing things isn't really how they'd be done in "real life." So things like learning about modular Sinatra applications make a difference. The git flow system makes a difference. Testing things properly makes a difference. The problem I had when trying to teach myself code before, was that I'd finish the course or tutorial and still have no idea how actual software was made. That problem's getting smaller and smaller each week.

I'm also convinced the amount of time spent coding on Fridays before beer appears is getting smaller and smaller, too...