Testable Code, in any language.

Last year I attended The Iron Yard, one of those Code School Bootcamps you’ve probably been reading about more and more frequently lately. And one of the things we were advised to do was to start blogging. The idea was that writing about what we learned would help reinforce exactly that, the fundamentals of web development. If someone read it and decided to hire you based on your writings in the “world’s easiest online-resume” you can have, awesome! Although I’ve yet to hear of that happening. And if Medium can send me a check for my marketing consultation, that would be great, but again, I don’t see that happening either. So the idea was there, and it was a good idea, to help reinforce the curriculum. But what happened? I’ll tell you what happened, the high learning curve is what happened. By the time I finished my daily assignment late in the night I was too worried about getting enough sleep to want to write. I finished my assignment and in the end that’s all I cared about. Quite honestly, I’m much better at writing code than an online article. So why are you reading this then? What could of propelled me to sign in to my unused medium account and start writing a “New story?” Well today was different, I had a weird gut feeling this afternoon to write something other than code.

“Are you sure Rafael? It could be the fact that you haven’t had anything to eat all day.”

It very well could be that reason, but it is not. It’s a far more simpler reason, so fundamentally basic that even caveman from days of old could sympathize with me. It was because I did something today that I never thought I would do. Did I think it was impossible for me? No, I just never actually thought about it before.

“So what did you do? Are you going to tell me or just keep me guessing?”

Of course I’m going to tell you, silly. Why else would I be writing on a public blog that publishes your stories for people the world over to read? Today I wrote my first program in Ruby. And although that doesn’t sound that amazing, it feels amazing to me and I wanted to share it with everyone. You see, up until this point all I’ve ever known is front-end javascript and I dabbled a little with the backend. A few months ago I wrote my own web scraper. It took someone’s twitter handle and saved their public info in a firebase database. Is there a practical use for that? Heck NO!!!! I could just as easily go to twitter, search for that person and follow them. But it was fun to build.

So why am I so excited about this? Well Tuesday night when I decided to start learning Ruby, I knew nothing about Ruby other than “There’s a Gem for that.” That used to be some inside joke between all the backend students going through school. Honestly, I still haven’t fully experienced what they meant by it, but I can guess it’s a play on iOS’s “There’s an app for that” line. So what was this sweet program I built? It takes a phone number and checks to see if it’s a valid number or not and cleans it up while it’s at it. “How do you know it works?” That’s the great part, there is a test file along with it and I got it to pass all the tests. I did that. And sure, there may be someone out there who can say they learned enough Ruby to write their first program in less than three days like me, but that’s not what this was about. This was to let someone who is walking in the same shoes I was walking in last February when I wrote a post about testing your code. You will have hard times ahead of you, very hard and frustrating times. There is also a lot of coffee, reading, and annoying those (yes Saul, I’m talking to you) who have been at this for far longer than you. So be a sponge and absorb all the knowledge you can. Look up the deFacto books for whatever programming language you are learning, and read them. Last but not least, Never stop writing code! It may sound silly now, just keep it in mind.