The Struggle is a Feature, Not a Bug

Makers Week 4

Naz M
codewhale
7 min readApr 9, 2017

--

Sofía Zelaya

Welcome to my blog about learning to code at Makers Academy. If you missed the last post, you can find it here. If you’re hungry for more, here’s the next.

Title taken from a quote by Gina Trapani.

Everyone warned us this would be one of the hardest weeks at Makers.

There was a hell of a lot of new stuff to learn, and at the end of the week I started to feel my first real stress. It was as if the torrent of content was flying past my eyes before I could take any of it in.

The weekend project went surprisingly smoothly (despite lacking a few features), and I was surprised how much of what I’d tried to learn had stuck. I think I’ll be more resilient in the future.

Bookmark Manager

This week we were challenged to create a web application that would allow users to save their favourite websites, tag them, view them, and sort them by tags. We also leant about implementing the functionality for users to sign up, sign in and out, and have their passwords encrypted and later verified.

This was tricky. When you sign up to a website, your data is stored on that company’s servers (or whoever’s servers they use — most likely AWS) in a database. Then, when you return to the site to sign in, the information you enter is matched against the information in their database to retrieve your details.

We used DataMapper to automate this process, so that once a database was set up, I only had to point to it in my code so pass on information. However, you don’t actually see the database growing with tables and rows. As a result, it all feels very abstract.

Another difficult point was implementing the ability to sort links by their tag. Link my table of links to our table of tags via another ‘join’ table with their ID’ and programming my Ruby code to access the right information was not easy, the walkthrough’s were heavily relied on by all.

Once our programs were starting to breathe, we learnt how to deploy them to the web using Heroku. To see my work on the internet for the first time was immensely satisfying, and many high-fives were had.

Cool codey tips

Roi showed me this great font for coding. It’s called FiraCode. It’s super readable and it looks great. As a bonus, ligatures are supported, which are very pleasing indeed.

To get the ligatures working, you’ll need the nightly build of iTerm2 (a much cooler version of the terminal for mac).

I also learnt some super useful terminal commands that are making my life easier:

  • cmd + r: clears the terminal screen but (unlike cmd + k) doesn’t get rid of it, so you can still scroll up and see what you were doing.
  • ctrl + a/e: motion to the start/end of a line
  • ctrl + k: delete everything after the cursor

And finally the Vim Plugin SplitJoin. I’ve yet to evaluate how useful this actually is, but it sure looks nifty.

Look! 1,000 piles of poop:

“play around in pry” they said

Weekend Challenge

This week we were asked to make a Twitter clone that would allow users to post messages to a public stream.

We had to add all the database functionality from the bookmark manager in order to store users’ details and encrypt their passwords, and to store their messages for other users to see.

Here’s my knitting-themed effort:

you can see my first knit tip “Tough knitties” at the bottom —It looks a little bare because I wrote it before I added the timestamps

Despite my fledgeling HTML and CSS skills, I’m pretty happy with the overall feel of the site. Design is something that really interests me, and I’m excited to learn more. It’s a really cool feeling to watch your projects come to life in front of your eyes as a result of all the little changes, and I think it’ll be surprising to non-dev’s just how much has to be done (notice my beautifully rounded corners dammit!).

Being a colourblind coder, I always use software to sanity-check my choices. Once I settled on a background picture I used the Eye Dropper Chrome extension to get hexadecimal colour codes for the balls of wool at the bottom. I then took advantage of Adobe Color to select a harmonious colour palette. Highly recommended tools, even if you have all your photoreceptors.

There are some things I didn’t have the time to achieve. I really wanted a ‘Gaussian Blur’ effect on the transparent box behind my messages, which would blur the image behind it but leave the messages untouched. However, repeated attempts just left me with blurry knitting tips, felling both colourblind and blind. Second, my fonts don’t come up on all browsers. I really like my choice of ‘Futura’ on the main heading, so am keen to find a way to make that work for Safari etc.

There’s a dirty secret hidden away in one of my view files. To get my tips to appear in reverse order, with the newest first, I had to flip my HTML list. Instead of editing the Ruby code, I rotated the parent box then rotated the child content inside it the opposite direction. It worked but it was a crappy hack, and now I have to refer to my bottom margin as the top margin and vice-versa. I’m sure it’s the kind of thing that you get punished for down the line.

Regarding back-end stuff, I still need to ensure that users can only submit tips once they have signed in and would like to make their usernames appear under their submitted tips. Hopefully there’ll be time to sort that out in Monday’s refactoring session.

We’re now deploying our apps with Heroku, meaning you can actually visit Knitter here, although link’s doomed to die pretty soon (Heroku only do free hosting for a limited time).

And here’s the repo over at Github.

“Relaxation”

I followed up on my intentions to start listen to coding podcasts on my commutes, and found that I’ve enjoyed every one.

The below link is for part II of an episode I listened to on Thursday evening. Gina Trapani was being interviewed, creator of Lifehacker turned developer. She now hires other devs and had some really interesting things to say about making it in the tech world.

One take home was that companies really do look at your Github commit messages. I’m now definitely going to start taking more care with mine — no more “I did a thing”.

I also loved the way she spoke about her mindset towards the learning process of a developer: that struggling to solve problems is part of the deal, and is to be looked on positively. There’s so much to learn that you never ‘get there’. There’s always new software coming out and a better way of doing things. Very much in line with Makers’ education philosophy.

Stuff I learnt:

  • Vim finally feels natural, and, as an unexpected byproduct, my touch-typing is improving loads.
  • How to use binding.pry. I feel like I’m way better at debugging than I was a week ago.
  • How to use postgreSQL for relational databases.
  • Deploying websites with Heroku.
  • How to make my own hummus.

Stuff that hasn’t clicked yet:

  • Learn more CSS. I’m still not comfortable with most of the stuff I see on StackOverflow. I’m not yet a CSS google ninja.
  • A lot of this database stuff feels unclear in my brain. I don’t feel comfortable with SQL, although I don’t know how much of the language I’ll actually need to know in practice, and how much will be taken care of by interacting with an ORM (such as DataMapper).
  • That said, I’m not comfortable with DataMapper either. Specifying one-to-many and many-to-many relationships is a skill I’m going to need.

TODAY’S JAM

I’ve been waiting for this album for ages, and on Friday it finally came. Luscious stuff.

If you read past the tapir, chances are you read the whole thing. If you enjoyed it, please click the little heart below. It’ll help others find this and enjoy it too.

--

--