Hello, Blog.

Here we go…

Some post has got to be the first post. I figure writing about how this website is set up and what I learned while making it is as good a place as any to start.

To begin I forked the repo of Bernerd Schaefer’s website and took out most of the stuff. There’s a lot of really cool css and front end work going on in there that is part of the standard package that thougthbot uses for static html sites, but I opted for simplicity that I could wield easily and quickly so I couldn’t put off doing this even longer.

Let’s talk about bin

For the first 6 months bin wasn’t somthing I really thought about, because let’s be honest, there is an overwhelming amount to learn and think about in your first 6 months of programming. I’d type it in to the console while reading a README.md as I installed a new repo and then promptly forget all about bin.

If you fork the repo for this site, the first step to get it up and running is to run bin/setup from the command line. What happens next is the code that is in your bin/setup file is run. A bin file is an executable file, which means its contents can be run from the command line. The bin folder/directory is a conventional location for storing (and sharing) commands that will get repeated along with an app. Sometimes projects use a directory called scripts instead of bin. But using bin is a nice use of naming convention. It gets the name bin from the word binary. Learning this made me chuckle, because I kept thinking of it in the terms of a trash receptacle.

In this app, the setup file contains code that checks if bundler is installed, installs bundler if it is not, and then runs bundle to install all of the dependencies (gems that the program relies on). `bin/server’ runs the middleman server. Which saves you a bit of typing.

When the middleman gem is installed, it generates its own bin file, giving you access to middleman commands such as:

$bin/middleman article "The title of your rootin' tootin' article"

Cool, huh?

Let’s talk about em in stylesheets

Compare the following two css bits.

body { max-width: 60px;
     }
body { max-width: 60em;
     }

em gets its name from the width of the capital letter M in and is a standard unit from the field of typography. Nowadays it comes in handy in css stylesheets, especially for making sites responsive. While you can get the same look using pixels, once you start playing with screen sizes, pixels become harder to work with. Because the meausurement of the size of the letters changes as fonts become smaller for smaller screens the unit of an em changes, while a pixel has a fixed size.

Pop open a browser tool and try it out!

One thought for the road

One of my favorite German phrases from time spent in Berlin is ‘Mut zum punkt.’ Roughly translated as 'The courage to end a sentence’. 'Punkt’ is 'period’, 'Mut’ is 'courage’. I heard this a lot from my favorite German teacher, especially when I started learning how many commas a German sentence can squeeze in. I think a lot about it while writing code too. The courage to end the method and not over-complicate it. The courage to end one thought so you can start the next one. The courage to end a blog post, so you can publish it. We can make it better and faster later, but first we have to to have 'Mut zum punkt’.