Command-A, Delete

Last weekend I got fairly excited about my guitar tab writing app. It was going to become a big traffic source for Redundant and I was going to build street cred as the guy who made tabbing fast and easy.

But then something happened, my app got complicated. Before I knew it I had three nested loops needed just to print tabs to the screen. It required method after method just to check if chords were in the library, and if they weren’t were they integers. What was the user trying to enter exactly?

Yes, things got complicated to the point that I was procrastinating just “thinking” of making this into a Sinatra App. Creating embedded ruby from all my poorly named variables and giant loop methods was the opposite of how I originally envisioned this project. I was avoiding my once exciting project.

I have been told from the beginning of Dev Bootcamp to adopt the mantra <buddhist drone>”I am not my code”</buddhist drone>.  I’ve understood this advice should be taken for a few reasons:

Primarily, it was to enable ourselves to received feedback/critiques on our code without feeling we were being personally attacked. What you’ve programmed does represent your knowledge base and effort, but at the end of the day you have to realize that it can always be improved upon.

Secondly, there may come a time when your code has become ugly, unmanageable and confusing to the point where it needs to be put out of it’s misery. If you are too attached to your code then you risk wasting mucho time in trying to give hope to hopeless code. Sometimes you gotta know when to let go.

So that’s what I’m doing with the guitar tab project. Letting it go. I realized that building the views, database, and controller for the code would probably be rage inducing and I feared having to deal with it. Furthermore, I feared having to manage the code as I attempted to improve the project. Ultimately, I had coded myself into a corner and the best way out was to just walk away.

The idea is still very much alive in my mind but I think I’ll approach it again when I get more comfortable with Rails and can take a little more time on it. Until then, this will become yet another abandoned repository on github (https://github.com/TravisL12/guitartab_builder).

Let’s Talk Guitar for a Second

Over the weekend I was looking up some guitar tabs to learn to play a song and I was struck with an idea. “I should build a guitar tablature app in Ruby”. It’s amazing how a 2 second idea turns into a dedicated weekend of coding.

I built my guitar tablature app (https://github.com/TravisL12/guitartab_builder.git) to allow myself to write tabs very quickly because writing them manually into a text file is super lame. This means I wanted the interface to allow me to very quickly type in the fret number and which string it’s on and get it printed to screen (and eventually text file or the web). So the interface may be a little cryptic but I’ll work on that. Though this will not change my goal of being able to produce a tab very quickly.

Above is a brief output of the program. All you have to do is type in a guitar chord and bam! it is printed to screen. So now what about if I want to type out something that aren’t chords? Well then you just enter in the frets to play followed by the strings to strum. The following is a simple 12-bar blues progression that should look familiar:

And there you have it! I still have plenty to work out on this (like double-digit frets!) but I’m happy with the progress over a few hours this weekend. Ultimately when I get more comfortable with the DOM and perhaps Sinatra I’ll get a sub-domain rolling with this tab in it so people can start producing their own tabs. That’ll be a trip.

Dev Bootcamp: Week 2 OOP Dependencies

Having completed week 2 I have redirected my weekend reading to some of the books I got prior to heading into Bootcamp. One highly recommended book is Practical Object Oriented Design in Ruby (POODR) by Sandi Metz that I picked up (I have several other books that were also recommended to me but only one book at a time!). I can’t help but share that the acronym for this book could be pronounced by some as ‘poo doctor’ ;)

Week 2 at DBC was mainly focused on Object Orient Programming (OOP) and there were many exercises to explore how to simulate a system using multiple classes. Prior to this week of work I had used classes in some of my apps but, I’ll be honest, I was just going through the motions. I didn’t know why I was using classes, I just was because it felt like that’s what programmers do.

So now I’m back thumbing through POODR and it’s first three chapters are speaking much more clear to me than before. First off, a class should generally be designed with a single responsibility in mind. This means that if you were to be designing a class to describe a car you may have a class to describe the car’s interior features (AC, Radio, Cruise Control), a class to describe the car’s motion (Acceleration, Velocity, Braking), and a class to describe how the car looks (Color, Shape, Doors).

At times, some of these classes need to interact with one another and this is where dependencies creep into the picture. A dependency is when one class specifically knows about another object and therefore if one class changes it may force it’s dependent class to change too. Such an example of a dependency is from Chapter 3 where the Gear class is dependent on the Wheel class at line 11:

Such a dependency may seem minimal but at the same time little effort is required to eliminate the dependency altogether. In a technique referred to as dependency injection the instantiation of the Wheel can be moved to the instantiation of the Gear class itself at line 16:

At this point the Gear class is not at the mercy of the Wheel class if for whatever reason the Wheel class were to be renamed or increase it’s number of parameters in the future. Also now the ‘diameter’ method can be used along with any other classes that require the same calculation.

It’s a simple example but it inspired me enough to jump on here and talk about it.

DBC Week 1: What it’s all about

I’ve read a few other DBC blogs that seem to go on and on about what the program is offering and the struggles that the author is going through. Instead, I thought I’d try to decipher a deeper question: “What am I looking to get out of this?”.

First of all, DBC is as intense as advertised. They hand you an immense amount of work each day/week and expect you to finish it. They aren’t messing around. This isn’t your first semester at community college, this is a life changing mecca that revolves around solving problems logically. If you are interested in programming then the job you are applying for is: problem solver. We solve problems using the most powerful tool available to man and this is the school to teach you it.

So what am I looking to get out of this? I’m looking to get pushed, pushed to the achieve the potential that they expect out of me. Otherwise why would they have admitted me? I trust Dev Bootcamp to push me every week, and I’m sure in the weeks to come I’ll curse this, but over my 32 years I’ve learned that nothing bad ever comes out of hard work. Whether it’s learning a hard lesson or realizing an unknown potential, hard work produces immense results. That’s what it’s all about.

DBC Day 1: Welcome to Pairing

It’s hard to imagine what changing careers is really going to be like until you finally take the first step. With anything new there are simply some things you cannot understand simply by being told about them.

After a morning of ice-breakers and team building exercises we finally sat down at our terminals and started coding. You sit at a computer, with a screen, mouse, and keyboard as does your pairing partner with his own screen, mouse, and keyboard. The only catch is that each terminal controls one computer. You move the mouse, they can move it back. You type something, they can delete it. You have an epiphany for your block of code, they have an epiphany for a recursion approach. This is going to take some time to get used to.

My pairing partner and I today were of similar skill level so we both understood what each other were talking about most of the time. He liked working with recursion more than I previously had, seeing his examples was a good thing.

It’s hard to give a total verdict on pairing with only one day under my belt, but for my future self I will give my initial impressions: pairing is hard and quite awkward. It didn’t make me angry or mad at all, but it was just awkward. You put on your best behavior and relinquish the keyboard or ask politely for it. It’s tough to wait your turn to type when you come up with a possible solution for a TypeArguement error only to have a brain fade when your partner finally gives up the keyboard.

This’ll take some practice.

Redesigning Redundant

Visual updates to the site will probably be an ongoing experiment but I have had the same boring theme for Redundant Robot for way too long. I’m no graphic designer, but I know the previous blue theme wasn’t very easy on the eyes. The one thing I will not change is the link at the top of the page to the Sheepshaver tutorial page.

Reddit AMA for Dev Bootcamp and Refactoring

One of the main instructors/founders of Dev Bootcamp just finished up his Reddit AMA. It’s interesting to see how people react to the idea of DBC in the sense that people are skeptical yet interested. I’ll admit I was very much the same way (still sort of am!).

I can say that I have spent many hours reading over Ruby development materials and solving as many problems as I can to sharpen my skills (reverse polish notation calculator, finding the mode of an array, list prime numbers up to 2 million!).

The thing that makes me particularly hopeful about digging deeper into programming is the refactoring side of it. I can solve problems, given enough time, but what really keeps bugging me is not knowing if I solved it the most efficient, and in the most readable form. I recently dealt with www.projecteuler.net Problem #10 that states:

The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million.

Originally, I came up with a solution that took approximately 3 hours to solve based on a nested loop that searched through 2 million values to determine what was a valid prime. Later on a friend provided some insight into the problem by showing off the lookup abilities of a hash object in Ruby. He was able to solve the problem in less than 10 seconds! This is a particular example of how refactoring leads to better and better code, there’s always more than one way to solve a problem.

Now, it’s official. Bootcamp here I come!

 

DBC_here_I_come

I know I already posted that I’m going to the Dev Bootcamp, but prior to quitting your job and making final preparations you have to pass a final “assessment” that they send out 4 weeks before your start date. This assessment ranged from the simple “define a local variable” to the more difficult (and timed!) exercise of writing your own method to output a shopping list, as well as writing a Class to determine the thermostat settings of a house.

Fortunately, I got the green light from them yesterday afternoon (after 3 days of double guessing everything I wrote). The assessment had been emailed to us on Friday evening and was due at midnight that Sunday. Needless to say I got right to work and made the best of it.

So now that that is all done and done I will be a Pocket Gopher starting April 22nd. You see DBC doesn’t define it’s cohorts by a number or start date, but rather a native animal from California. It’s grown on me :)

Heading to DevBootCamp in less than a month!

This site does not pull a lot of traffic (maybe 100 hits a day). Most people are passing through to get to my SheepShaver tutorial which is so awesome that it is still in demand! I really do like getting emails or comments from people all over the world who either need help, have suggestions, or are just mentioning that Redundant was able to help them out. It really is neat.

Up until just this morning I had ventured into re-designing RedundantRobot from the ground up, not sure if anyone noticed but that venture stalled. hard.

My self-teaching web development dreams have not been dashed but rather revised. Back in December I was accepted into the April cohort of the www.devbootcamp.com right here in San Francisco! It is a very exciting prospect although a little scary since it will require my dedicated time and effort for over 2 months. This means quitting my job and telling my beautiful new wife that she’ll be seeing little of me.

In a nutshell the Dev Bootcamp (DBC) is a 2 month course that drills you in the Ruby language as well as the Agile development method for building Ruby on Rails applications.

Prior to DBC beginning they have sent out a decent amount of prep work that has opened my eyes to the world of programming on the web. I will hope to post some of these lessons, so far, that I have learned. It’s generally helpful to try and explain new things you’ve learned to help solidify such lessons to memory. Again, I’m new to this so if anyone passing through has any suggestions I am all ears!

You know you’re stepping outside your comfort zone when your first impression is to say “No” or “I can’t do that!”. I’m learning to embrace taking such steps.