Showing posts tagged Code Academy

“If I can code, I can cook.”

WEEK 4

There’s a good reason why I’m combining week 4 and week 5 into a single post and that reason is something that happened yesterday in class. I couldn’t wait till next week to tell everyone…

Last week we covered a wide range of topics from DRY, partials, git hub, to model validations. The first topic DRY stands for “Don’t Repeat Yourself,” this is a methodology many in the development community follow and is something everyone in the RAILS community SHOULD follow. It basically means not to repeat the same code over and over again in your application. The best way to do this is through what’s called a partial, which allows us to write a set of code in one location that can be accessed by multiple areas in our app.

One the most useful tools we developers use when saving our code is GIT. Git is a version control system that takes snapshots of code, which makes it useful to go back and forth between different versions of our code. Mac users can compare this to Time Machine for code; OR Windows users can compare this to “system restore”. If I want to save my code in the cloud, I can use a service called Github, which is a web-based service for Git and is used for hosting all code in case my computer craps out. Github allows me to store my code in public repositories which means anyone can access my code; OR I can keep my code in private repositories – (which is where I keep the top secret Facebook DESTROYER app I’m building, which I will eventually launch and IPO one day at a much higher valuation than the one in Palo Alto coming up

Last week we worked on building data based backed applications, and this week we learned how to add model validations, which are extremely useful in ensuring valid data for our applications. An example of model validation would be a dating site requiring a valid photo and age, which I’m sure people never lie about.

WEEK 5 (TODAY)

Here’s some sample code that I wrote in class last week

 get “lines”, :controller => “lines”, :action => “index”, :as => :train_lines

  post “lines”, :controller => “lines”, :action => “create”, :as => :train_lines

  get “lines/new”, :controller => “lines”, :action => “new”, :as => :new_train_line

  get “lines/:id/edit”, :controller => “lines”, :action => “edit”, :as => :edit_train_line

  get “lines/:id”, :controller => “lines”, :action => “show”, :as => :train_line

  put “lines/:id”, :controller => “lines”, :action => “update”, :as => :train_line

  delete “lines/:id”, :controller => “lines”, :action => “destroy”, :as => :train_line

You don’t need to know what anything above means, the most important thing to note here is that we spent the past month grinding and memorizing it and today our professor presented us a SINGLE line of code that eliminated the need to type all this out………..ARGH!……..

Wait there’s more……..

Next, he gave us another SINGLE line of code that generates an ENTIRE APPLICATION, I repeat, an ENTIRE APPLICATION that we just spent weeks learning how to build! I filled up an entire spiral notebook with lecture notes, when all I really needed was this ONE LINE of code!

What did I do with the 100 pages of notes?

ajdsfhousdfafsdgjio!!!

I’ll get over it… I guess they just wanted us to build a strong knowledge base before they teach us shortcuts.

On a different note - Last week I promised I would talk about my experiences here in Chicago other than coding so here goes…

As much as I’m sure that you’re all really interested in my adventures at the local bars and my experience in the Chicago nightlife scene, I’ll save that for a dedicated blog post titled “21 shots later”. 

One thing I’ve been doing religiously has been cooking my own food. Cooking and baking are things I’ve always left up to my Mom and Bubba, but they aren’t in Chicago with me. Considering my dwindling bank account, I cannot afford to eat out 3 meals a day in Chicago.  So, I have been left little choice but to bring out my inner Emeril. At first I was a little apprehensive, but I kept telling myself, “If I can code, I can cook”.

So far, I’ve had nothing but what seems to be success, and I realize that there are plenty of tasty dishes that can be made on a budget, in a short amount of time. I am constantly creating new dishes, and my cooking has led me to work on a web application that provides simple recipes for busy or inexperienced people. (more details to come in future blog posts)

I attend class on Mondays, Wednesdays and Fridays at an awesome building in downtown Chicago. Words don’t do it justice, so I’ll show you guys some pictures. The Merchandise Mart was once regarded as the largest building in the world and even had it’s own zip code until 2008. The actual space I work out of is called 1871, and here is the glimpse of the building in all its magnificence.

1871 workspace by day: 

1871 by night: 

Code Academy Week 3

Some of you are probably wondering, “After 2 weeks of web development class, what is Ed actually capable of?”… The inclusion of several pieces of technical jargon in my previous blog posts did a great job exaggerating my abilities…

Well this past week I finally had my ‘aha’ moment!

It’s clear to me that I probably won’t be co-starring with Angelina Jolie in the remake of Hackers, but the concept of creating my own web application seems more within reach than ever. Code Academy lectures with in class examples of coding models are beginning to seem less like French, and more like English.

All the material I’ve been learning for the past 2 weeks came together this week when we created a data-base-backed Ice Cream application that allows users to add new flavors, delete flavors, and edit the price/name, basically just a bunch of CRUD. Ben and Jerry’s here I come!

*My favorite in case you were wondering :-)

Now when I say CRUD it’s not the slang word that we hear high schoolers use everyday… 

CRUD stands for:

C reate new records

R ead existing records

U pdate existing records

D elete existing records.

Pretty much everything you need for a data-based application. Now that I’ve been introduced all of the parts needed to build a basic website, I’m expecting classes to pick up major speed over the next several weeks. I couldn’t be more stoked!

I know everyone is probably tired of me blogging about coding, so I promise to have some more interesting posts about the “fun” things I’ve done since my move to Chicago next time. My lack of entertaining content is probably a good testament to how hard I’ve been studying… so at least be proud of me for that!

I’m ending this weeks post with two words:

GO LAKERS!!!

Code Academy Week 2

Class Recap:

The picture above does a spot-on job describing my life this past week. On the first day of class, my professor told me that my Code Academy experience would feel like I am an airline pilot, taking flight for the very first time. Two weeks in, it feels more like I’m piloting a space rocket, not a Boeing 787. As crazy as it is, I’m loving every moment of it!

Using various Ruby concepts such as arrayshashes, and classes, last Wednesday my classmates and I were able to create a simple ecommerce shopping cart application that allowed us to add products and calculate the total price of goods. Building the shopping cart felt super easy, since my teacher was monitoring our progress. I was proud to have built something tangible…. I felt like a professional hacker- birds were chirping, champagne was flowing, life was good.

After class, I headed to a nearby computer lab to continue practicing coding and I was quickly turned on my butt when…

After class students usually migrate over to a work space across the hall to continue practicing coding. In front of the whole class Neal (co-founder of Code Academy) asked me to  recreate the shopping cart application from SCRATCH with my laptop connected to the projector screen so everyone could watch. My first thought was “@#%#*… Gee thanks for VOLUNTEERING me Neal!”

Long story short the experience was quite embarrassing as I struggled to reproduce anything we had just learned in class. I only made it through with Neal guiding me with hints every step of the way. To Neal’s credit this was by far my greatest learning moment at Code Academy. Being put in a high-pressure situation to think through the coding processes was challenging, but it helped engrav Rails knowledge in my mind.

The next class we quickly dove into develop of a real-life web application using Rails, the moment I’d been waiting for! Although the application I built was nothing more than a page with some simple text, it felt liberating to finally be able to translate lines of code into a live webpage on my browser. Finally understanding the model-view-controller (MVC) pattern really made me appreciate the beauty of Ruby on Rails:

Click here to learn more about MVC

Resources:

One of the great things about Code Academy is the plethora of resources the program provides to help prepare me for my coding/entrepreneurial journey after I finish Code Academy. This past week we were lucky enough to have a corporate lawyer come in as a guest speaker. Let’s just say I took full advantage of the opportunity to ask probing technology-law questions in what would have otherwise been a $500/hour attorney-client session

My biggest take away from the talk: Seek help from a lawyer as soon as the risk increases, (such as adding a new member to your team, or if you’re in the process of raising funding).

Another great resource provided to us is the Mentor Program, where we are matched with hacking veterans who will personally answer our annoying questions. I was lucky to have gotten Eric Marden as my mentor. He does a wonderful job keeping me grounded and helping me to map out a realistic game plan to complete my own functional web application by the time I finish the program. 

Weekly Goal:

By the end of this week I hope to have a solid foundation in my knowledge of Ruby so I can focus more on building and less on coding.

Edward Chiu
E:
edward@flirpy.com

T: @edwardchiu38