09 2 / 2011

Subclasses & the Source Code

Last week I hit a bug I knew I could fix - but I couldn’t. After a day of banging my head against the wall, I came to one conclusion. I needed to reread ‘Learning Python’ to get a better handle on the language.

One of my talents I just recognized is the ability to find patterns. I can see the repetition in Django docs for views or forms, and basically riff off that to hack something together. Its the same with guitar. I can’t write or read music, but I can pick up songs and play those over and over again. The problem is that I didn’t really understand the what & why with Python & Django. I knew what to do, but I didn’t know why or what was going on.

I had to face reality and go back to the basics. I was lacking key pieces of information that weren’t allowing me to solve the problem. Turning back to ‘Learning Python,’ connected many of the dots with OOP- subclasses & overloading methods to be specific. Understanding these pieces led me to understand Django on a whole new level.

A few of you have told me, “Read the Django code” when I send a question your way. For a n00b, this is a daunting proposition. The thought process to a beginner is, “I barely understand my code. What can I possibly get from reading the source code?” To the n00bs out there, the critical piece of information you need to understand is a subclass. Recognizing the methods and attributes of the superclass are what you can access through a subclass is a key connection I hadn’t completely made.

When someone tells you to “Read the code,” it means look to see what are the methods and attributes you inherit from the superclass.

I think making this simple connection has allowed me to turn the page with my coding. Instead of just copying patterns, I am comprehending what is actually going on, and what makes Django such a powerful framework. 

To the n00bs out there, “Understand subclasses, then read the source code.”

05 1 / 2011

WDYT? New Coding Blog

In preparation for the interview yesterday, I met up with @Sasha who threw me a curve ball, “You should write for a tech magazine.” Come again!?

A few weeks ago, we had a conversation around this question  I posted on Hacker News -

Ask HN: Is anyone else tired of reading the same articles?

 My points are :

  • I’m tired of reading vague news stories about Facebook/Twitter/Groupon etc.
  • The same “hot” topics get regurgitated- ex. A/B testing, Design, “I failed,” etc.
  • The same sources are considered Gospel - AVC, PG, Techcrunch, Scoble…

To say I’m frustrated with the online, coding discourse is an understatement. I think it could be so much more. Once a tech story/company has hit the mainstream press (Techcrunch included), the details get diluted so the majority of readers can understand it. Ex. Twitter goes down. Tumblr goes down.

Why did the site go down?

I’m relatively new to this whole coding thing, but I am still very curious as to what is going on behind the scenes. Who are the “bad-ass” programmers/engineers in the trenches? Corporate blog posts do not go into these details because of their audience - generic users.

Is anyone else interested in a blog that would interview the best coders out there?

I am thinking along the lines:

  • Learn their tricks/hacks/lessons learned along the way
  • In depth stories of how a site works & technologies used
  • When something breaks, why did it break? Technically, what is going on?
  • What made your site successful over a competitor? Why did you do it that way?

This would not be a startup, VC, design, or entrepreneur blog - but a serious look at the technologists behind the scenes. Maybe some companies wouldn’t want this information out there- but I think many would.

I know some killer engineers that have 0 online presence. They have experience/insights that would blow your mind. The thing is - the  best engineers do not care about HN karma, Twitter followers, or RSS subscribers.  If they are on these sites like HN or Reddit, they use them soley to broadcast their new projects. It is weird how we look at karma/followers as some type of sign of quality. In many cases, it is totally incorrect.

 To introduce a new voice in this discussion, I’m kicking around the idea of starting this blog. Is it needed? Would you read it?

What do you think?

Tags:

Permalink 1 note

03 1 / 2011

UPDATED Code Review: Hirelite Puzzle in JS

On Hackernews this morning, there was a post for Hirelite. As they state it, “Hirelite hosts web-based and in-person speed interviewing events that connect companies and startups with job seekers and co-founders.” There is a hiring event on 1/11 so I figured, why not try it out? 

For the event on the 11th, they pose a question to you, “to make sure you are a real programmer:”

In any language, print the integers from 1 to 200, except for multiples of 4, print “rick”; for multiples of 7, print “roll”; and for multiples of 4 and 7, print “rickroll”. paste your code here.

Since my interview is tomorrow, and I thought this was a great way to prep. I just took a few minutes, and worked through the problem. Here is my solution:

What do you guys think? How could I make this code better?

“The critical distinction between a craftsman and an expert is what happens after a sufficient level of expertise has been achieved. The expert will do everything she can to remain wedded to a single context, narrowing the scope of her learning, her practice, and her projects. The craftsman has the courage and humility to set aside her expertise and pick up an unfamiliar technology or learn a new domain.” - Dave Hoover

UPDATE:

Thanks @pbjorklund @jonrohan @kennethlove @ompemi for the help!!

I rewrote the script:

What do you think now?

02 1 / 2011

2011 New Year’s Resolutions

Last year, I started writing down my New Year’s Resolutions. Here is that list which I wrote down a year ago today:

  1. Attend more tech events - meet more people (Accomplished)
  2. Drink more water (Ehh not really Accomplished)
  3. Appreciate what you have (Accomplished)
  4. Learn to program (Accomplished)

I’d always heard, “If you write down your goals, you have a higher chance of accomplishing them.” Based on these results, I’d say that is true.

Since it is that time of the year, here are my 2011 New Year’s Resolutions.

  1. Work out 5 times a week - lose 25lbs (get back to 190 lbs)
  2. Set weekly goals each Sunday- More disciplined!
  3. Refresh my math skillz
  4. Travel to a foreign country
  5. Am I great at:
  • HTML
  • CSS
  • JS
  • Node.js
  • A DB

The last question is a little vague, but basically I want to be able to honestly answer that question for each of those technologies. 2010 set me up to be able to learn much more, much faster. As long as I keep up this pace, I figure I should end the year in a solid position.

If you haven’t already written yours down, DO IT! It will help keep you on the right track. Look at my last year. I went 6 months with ‘Learn to program’ staring me in the face. However, in July it was time to finally get my butt in motion. 6 months later, here we are.

Don’t get discouraged if you don’t accomplish your goals in a few months. As long as you write them down and put them in a place you frequently see, you will be reminded of what you want to do. July may sneak up on you, but as long as you see that list, you can still make the change.

So hop to it!

Will you spend 2011 actively working towards your dreams?


You may be whatever you resolve to be. - Stonewall Jackson

25 12 / 2010

“I have no clue what he’s talking about.”

In the last week, I feel like I’ve taken my coding skills up about 10 notches.

*If anyone is coding today (on Christmas) and can help out, I’m a bit stuck on how to use the Simplegeo JS SDK for my Node.js project

I also think I finally figured out this whole process…

You have to constantly get into uncomfortable conversations where you say to yourself, “I have no clue what he’s talking about.” It is only in those instances where you grow, and pick up another bit of knowledge. Another piece to your puzzle.

That is what learning a skill is - gathering the pieces and building a puzzle. You don’t know what the pieces are, where to find them, or even where they fit. You have to push yourself to solve those 3 problems, because that puzzle will reveal a map, and that map is what will guide you in the future.

The map will dictate how you execute an idea- what tools and processes you utilize. It will never be complete, but the ‘expert’ is the one who has a more complete map.This may be an overly simplistic way to think about the learning process- but I think it is a perfect summary of my experience learning to code.

——

Always walk through life as if you have something new to learn and you will.  ~Vernon Howard

When the student is ready, the master appears.  ~Buddhist Proverb