Tag Archives: Development

Omaha Code School Wiki

A week ago we wrapped up our first group project. My team decided to create a Omaha Code School Wiki. It’s a wiki about anything related to Omaha Code School. Anyone can read the articles we put together so far. You have to sign up for an account in order to add or modify the articles, but anyone can do it. Make sure you provide a legitimate email, because we figured out how to send email to confirm before we activate your account. We’re pretty proud of that.

Here is the link for your enjoyment. Let me know what you think. It’s on a free hosting service, so I apologize in advance if it’s a little slow to respond.

http://project-ocs-wiki.herokuapp.com

Advertisements

Our First Project

This week we started our first project, creating a blog from scratch. We were told to research different blogs and put together a list of features we would like to implement. I looked at a couple of the blogs I read regularly and put together the following list.

  • Static Pages
  • Posts with pagination
  • Comments
  • Polls
  • Contact Us page that emails form comments
  • Ability to sort by category

We learned how to use GitHub to build a project plan. Using the ‘Issues’ feature to create a buildout checklist was really easy, and made sure I didn’t leave anything out. I used a whiteboard to sketch out some of my ideas and took a pictures so I could add them to my documentation. Once I finished my plan, I sent it off to Sumeet for approval. He wanted to make sure that our plan was achievable with what we have learned in the first three weeks.

Once I got the okay, I started coding. We are using SQLite for our backend database and Sinatra for the web server. It took a little trial and error to get my database relationships defined correctly, but eventually it started working. I started knocking out features pretty quick. First users, then posts, then pages. I was feeling pretty good, but then I tried to get comments working. My comments are tied to two other objects, users and posts. I got them working with posts pretty quickly, but users were just not working. This is where Omaha Code School really comes into it’s prime. I got up and went around to get idea’s from what other people were doing. Having 12 other people working on the same thing as I am is a great resource. After asking some classmates, and looking at their code, I figured out I had capitalized the ‘u’ in ‘users’ when it was supposed to be lowercase. Errrg. The one thing I dislike about coding is how sensitive the syntax can be.

My Blog

My Blog

By Friday afternoon, I was feeling pretty happy with my project. It wasn’t complete, but the basics were working well. Unfortunately, it didn’t look as good as it worked. Everything was black text on white background. Since we had an Open House at OCS that night, I wanted to make sure my project was something I could demo if needed. So I decided to look up how to do some basic CSS(cascading style sheets) even though we haven’t talked about it yet in class. In a little less than an hour, I had a blog that I was pretty proud of. I’m glad I put in some time on the aesthetics, because I did get to show it to a handful of people and they all seemed to like it.

I’m still really enjoying my time at OCS. I can’t believe it’s already been three weeks. We are bonding as a class and everybody seems to be keeping up pretty well.


Tools of the Trade

People have asked me what programs we are using in class. At its core, a website is a collection of text files, so you don’t need much. I remember using Microsoft Notepad to create my first website. At Omaha Code School(OCS) we use a program called TextMate. It is a text editor specifically designed for development.

TextMate 2 Logo

TextMate Logo

At first, TextMate and I were not friends. I think it was more to do with my unfamiliarity with my new MacBook then the program itself. I was having a problem remembering menus and shortcut keys. As time passed, I started to see the power of using this program. Specifically, built-in GIT and code bundles.

At OCS we upload all our code to a service called GitHub. This forces us to save and commit our code frequently, and makes backups of what we are working on. TextMate is aware that we use GitHub and shows us the current status of each file. It’s really helpful when I make a mistake and need to roll my project back to my previous commit.

The feature that separates out TextMate from the other text editors I’ve used is code bundles. Bundles are small pieces of code that you can insert into your code. It doesn’t sound major at first, but it could eliminate almost all my stupid human syntax errors.

To use a bundle you select Bundles -> Select Bundle Item, or use the keyboard shortcut ^ + ⌘ + T. This will show you the bundle search window. TextMate is aware of the type of file you are working on and will only show you the applicable code bundles. Once you find the bundle you need you can then import it into your file.

TextMate bundle search window

TextMate bundle search window

Ruby requires that almost everything we do be a member of a class. To create a class, there are about 10 lines of code that are almost identical. Using a bundle, all you need to type is the following:   ^⌘T + “class” + return

TextMate Class Bundle

TextMate after inserting a Ruby Class bundle.

If you look closely, the class name is highlighted. TextMate bundles know which keywords need to be modified. You can type a value and then press TAB to move to the next field. This allows you to update everything you need without having to use your mouse or arrow keys to move around. It doesn’t seem important at first, but after using it to create a couple of objects I know I will be using it a lot.

The built in bundles are helpful, but I have already found that I have a slightly different style. Fortunately, TextMate has a built in bundle editor. I’m the first to admit that I don’t fully understand what is going on in the editor. I can make my way around enough to add another line or change the style a little bit, but that is about it. As I continue to learn about formatting and syntax I’m sure I’ll start to understand more.

I know I’ll be using these features a lot, hopefully you will too.


Everything Clicked

Yesterday was horrible. I couldn’t wrap my head around the problem we were given for homework. I felt bad for my partner because I wasn’t much help. We couldn’t figure out which pieces we needed, let alone where they were supposed to go.

Today was the exact opposite. Once we received our assignment, I got it right away. My partner for the day was none other than Kaitlyn Hova. (Check out her website, she does amazing things!) We had a plan, and were on the same page right away.

We got to work and started writing our test cases. I should let you know that our instructor is trying to get us to use Test Driven Development for our assignments. That’s where you write a test before you write any actual code. It can be hard to understand at first, but totally made sense today. We were able to come up with about 20 tests for our program. As we changed something here or there a test that used to pass would fail, and that is a good thing. Since we had automated test cases that validated our entire program every time it ran, we knew instantly if our change broke another part of the program. We would find the issue and fix it so that our tests would pass again before moving on.

Since we were cruising, it didn’t take us long to finish our initial assignment. Unfortunately, we were sitting right next to our instructor. Every time he heard us mention that we were about done, he updated the assignment’s requirements to add something else. We barely skipped a beat and knocked them out too.

Today was one of the more satisfying days in my adult life. It feeds something deep inside and makes you want to wake up tomorrow and do it all again. I hope these days become more frequent in my life. They are awesome!