RailsBridgeBoston - Other Side of the Moon

Published on:
Tags:

At RailsBridgeBoston, I had the privilege of mentoring over 80 women interested in learning about programming. They all had different backgrounds, and eager to learn. It was very rewarding to explain and help others get started in programming.

It was cool to learn about the Ruby method ‘squeeze’ while I was teaching. It deletes all duplicates that are adjacent to each other. It really gave me a reality check of how much I have learned in the past 3 months at Launch Academy, but at the same time that there were still many things I didn’t know and wanted to learn.

As a mentor, one advice I gave all students was to stick it out. When I first started learning, it was so easy to give up when faced with a seemingly impossible problem. I say fight through! The art of programming isn’t to always have the answer, but to struggle through it. I know it may not seem true now, but it does get easier!

I highly recommend any women interested in technology to check out RailsBridge. It is free and a great introduction to programming, and all the mentors there are volunteering to share their knowledge with others.

PairStudying Launches to Help Programming Beginners Learn in Groups

Published on:
Tags:

I’m currently learning ruby on rails at Launch Academy, a programming bootcamp. During the past 3 weeks I have been working on my breakable toy pair studying.


The idea came, prior to joining Launch Academy, when I was studying alone following Michael Hartl’s tutorial. The rails tutorial was amazing, it gave me so many great insights and a good view of what Rails is and what it can do. However, I struggled hard!!! My code would break and I couldn’t do anything about it :( I either had to start over or ignore the problem and keep going on. This happened frequently and I was not happy. The problem was that if I had someone to look over my code, they probably would have spotted my error or at least help me fix it. I found that one of the more common reasons my program would break was due to spelling errors.


With pair studying I hope to knit together an online community to help each other learn. I admit there are kinks that I have yet to be fixed. It is far from finished, but I wanted to share it with the community so that I may get feedback and learn from you and hopefully it may benefit your studying. There are many other features and UI designs I want to add.


Also, I will be graduating Launch Academy next week. Woot! I learned so much from my helpful mentors and I want to give back. I’m looking for 4 individuals who want to go through Rails Tutorial with me. We will be covering 1 to 2 chapter each week, haven’t fully decided the pace yet. The course will cost $25 that will be donated to Railsbridge, check them out if you haven’t heard about them! I’m not charging to make money, nor do I think I’m that good to be charging money. You’re paying as a way of making a commitment. I’m hoping to get serious students who really want to learn and will follow through by putting the time and effort needed to become a developer.


The process will entail students going through each chapter on their own. When they get stuck on a problem, they can share the problem on the site or possibly reach me through skype, haven’t fully decided on either. Students will be learning by helping and teaching each other solve problems. I will be there to answer questions, but really hope that the interaction amongst students will be enough to solve problems. I plan to be heavily involved in the beginning of the phase and become less and less present as a gradually releasing them into the wild (launch academy has proven to be successful). I will be spending around 2 hours each week helping with questions and just talking about the process. If you’re interested feel free to tweet me or visit my site and contact me through the form, and if you’re on reddit just pm me. Also I’m requiring my students to post at least 1 to TodayILearned on my site. Throughout my experience at Launch Academy we have daily standups. In short, it is to share what you have done, learned, or stuck on. I want everyone to share what they have learned so that others can benefit from your learning.


I’m only hitting the surface with programming and I’m very excited to have made this! Makes me proud. Thanks for reading. Feel free to share or leave me comments and I’ll answer them promply.

Work Hard and Dream Big :) John

The Ideal Programming Environment

Published on:
Tags:

I was motivated to write this blog because two things. First was Kyle Daigle, from Github, and second ShipIt Saturday event at LaunchAcadmey.

Kyle was a guest speaker at Launch this week. His talk was not technical but everything else you think of in terms of ideal job situation, work, environment, culture, and ultimately what you want. To figure out what was important to me I began to think of all the companies that I admire, or want to be part of.

My 3 requirements are

  1. 90 - 100% Pair Programming

  2. Time for Open Source contribution or to learn, anything programming related

  3. Agile Practices + TDD

Throughout my experience at Launch, I learned that 2 set of eyes are better than one, at mostly everything. It was much easier to catch spelling errors, make design decisions, determine user requirements, and trouble shooting. The only thing that I prefer doing solo is if we both don’t have a clue and need to just learn by trying. I wouldn’t mind banging on the keyboard for 15 or 20 minutes and coming back with a solution. However, overall I find it that most errors have been encountered either by myself or my partner and it is much easier to learn by teaching my partner.

My second requirement is because I want it to have the spirit of the Ruby community. One thing I have learned in the past 3 months is how willing ruby on rails programmers are to helping others out. I want to give back as much as I can, and I want my company to want to give back to the community for making me great and awesome. Also, it’s a great way to market the company. thoughtbot is a great example, factorygirl, shoulda, etc.

Lastly, I’m a heavy believer of the minimum viable product populared by the lean startup movement. I think it is important to be able to bring a functional product as quickly as possible to market for feedback and repeat the cycle. I think agile practices is very close to this idea. Instead of guessing what the customer wants, by showing the customer piece by piece. This way as a developer I get immediate feedback of whether the product was what the customer had in mind, or figure out exactly what the customer had in mind, and go back to the keyboard. I included Test Driven Development, because I don’t believe that one can practice agile without the other. As programmers we can’t change or add code with confidence if we don’t know what this change is going to do to our program. This will ultimately slow down production and lead to mediocre code. Not very agile.

My next motivator for finding the right environment was Ship It saturday. The event was that you work on anything you’d like and be able to ship it to production(heroku) by the end of the day. Working under that time constraint was no joke. Being under that pressure to get something out was quite intense. Espeically calling everyone out that they needed to be done in order to upload their app to my site called ShipIt Saturday. The first half of the way wasn’t too intense. I was managing my time well following the red, green, refactor. The last 3 hours was quite brutal. I was stuck with the idea that it would be easier to implement a voting gem that was inactive for over a year. I ended up trying to figure out how it worked for 2 hours and talked to some people there and went on to write my own voting system. It was pretty much the most intense hour I had, in my programming career. I was sweating, anxious at the thought I was going to disappoint those who were going to display their app on my site. However, trying to keep a level head, I focused on my breathing and began to work. My final implementation of my voting system wasn’t 100% tested, but I tested the core functionality of it. Got the app up on heroku for live deployment. Yeah, I wouldn’t want to repeat that experience again. Although, I tested the core functionality that people are able to vote. I didn’t test to check that the position changed based on the amount of votes an project had.

If I had more time, I would have covered 100% and would have caught that projects position weren’t changing. I think high stress and deadlines environments produce may produce products, but not so maintainable code. I want to work at place where quality of the code matters more so than meeting deadlines. Of course there are exceptions and circumstances where dealines are important. But hopefully the company is working with customers who understand quality over speed.

*Thought: It takes time to be a great developer. If you realize that you’re not going to be great in the next day, week, or month. The ride will be much enjoyable.

John

Benefits of Test Driven Development

Published on:
Tags:

The past week I have taken a deep dive in the big boys tool club, TDD with capybara and rspec. This post isn’t to discuss about tools for TDD, but the WHY companies and individuals should write test for their code.

I want to start of with the negatives of TDD.

  1. Testing takes time, and maybe the deadlines approaching. We hear it all the time. We don’t have time to test, because we need to hit the deadline. It will slow us down… WRONG. It will take you far more time and brain power to debug or make changes to your code with no tests. More on the later
  2. Testing isn’t perfect, and sometimes we can waste of lot of time writing tests.
  3. We can probably double our code output if we didn’t have to write any test

Thats all I could think of for reasons not to write test. If I must say, those are some terrible reasons not to write tests.


Why you should test

  1. Testing helps us confidently modify our existing code. Why? Because as soon as we break something, our test SHOULD fail too
  2. It’s faster! Some of you are probably thinking, “you just said testing takes time and you would double your code output if you didn’t write test. LIES.” Well it’s true that we may be able to spin out code faster, but in the long run, we would most likely lose. If we had to debug our app that has no test, but is twice as large. How long do you think it would take to debug such an application. On top of that the headaches, the tears, and depression is simply not worth it
  3. It pushes us for better design. By this I mean that writing tests helps us see options when it comes to implementation. While we think and decide what we want to test, and how we want to test it. This additional time we’re spending on our application design helps us to pick better options. I’m not saying it’ll be the perfect design and you won’t have to touch it. But I believe it will be far better off, than if you went straight into implementation
  4. We spend less time implementing new features to our existing code base. This going back to point number 1, of being confident of modifying our code because of the test.
  5. We can’t afford not to test. Not writing test is expensive. It would cost the business more, in the long run because of the time we have to put in to debug. This slows production, and ultimately costs us more.
  6. It’s a chepaer alternative

I think testing is important for all these reasons. I can’t imagine a company who don’t test their application. That shows me they don’t care what the code looks like as long as it ‘works.’ What rubbish and shotty job.

I would love to work at a company that respects their clients and their employees time to implement testing in all levels (acceptance and unit testing).

Want to talk? Shoot me a tweet @jmoon90

John

Practical Object Oriented Design for Ruby

Published on:
Tags:

In the past week at Launch Academy we dived into object oriented programming. Here is a definition by tutorialspoint.

Ruby is pure object-oriented language and everything appears to Ruby as an object. Every value in Ruby is an object, even the most primitive things: strings, numbers and even true and false. Even a class itself is an object that is an instance of the Class class.

My definition is classes are there to help organize and structure the program so that it may be easily consumed by others. Todays post is about POODR that adds on top of my definition. It is a way to organize and structure program so that it may be easily consumed AND changed as new features are added.

I love that! As programmers, not only should we be thinking to making a working app, but also an app that has low replacement cost in the future. The idea is to write code that is SOLID (Single responsibility, Open-closed, Liskov substitution, Interface segregation, and Dependancy Inversion). I’m currently focusing on the single responsibility section of the SOLID. I find it difficult as a programming beginner to write classes that are loosely coupled as I want them to be. I started with classes that were family and knew everything about each other. However, with some easy to implement tricks and tips from the book I am learning to write more loosely coupled programs.

For instance, I wrote a program about a company with many employees, who wanted to know if their employee owed taxes or was due a refund. My first instinct was to create a company class and an employee class. I was having difficulty of instantiating a single employee. The problem was that I was iterating and saving the employees into a single hash, then passing the hash to the employee class. This caused 2 problems. First all my employees were a single instance. Second, because they are a single instance when I passed in the instance to the Employee class, the employee class was not reading in 1 employee at a time, but the whole slob.

class Company

def load_data(file)

employees = [] CSV.foreach(file, :headers => true) do |row|

employee = row.to_hash

employees << employee

end

employees

end

end

Employee.new(employees)

For an experienced developer the solution was right in front of them. The fix was quite simple. I just needed to change where I was instantiating the object. The previous code changed to the following.

class Company

self.load_data(file)

employees = [] CSV.foreach(file, :headers => true) do |row|

employee = Employee.new(row.to_hash)

employees << employee

end

employees

end

This instantiates each employee separately as I pull data from the CSV file. Now when I pass my employee to the Employee class, it will be of 1 instance of an employee. The benefit is that I won’t have to do an iterator in my employee class but instead I can iterate inside my company class.

Another trick I found very useful was passing in hashes as arguments instead of a multiple variables. The benefits are that you don’t have to worry about in what order you pass in the arguments. If you don’t pass in a value for a specific instance, you can simply give it a default value.

class Employee

def initialize(arguments)

@employee = arguments[‘employee’] || ‘missing name’ @tax_owed = arguments[‘tax_owed’] || ‘0’ @tax_paid = arguments[‘tax_paid’] || ‘0’

end

end

Hope you learned something from that. If you have any cool tricks feel free to share in the comments.


Happy coding!

John

Loops and Iteration in Ruby

Published on:
Tags:

Going through 2 weeks of bootcamp I can’t iterate enough how important iterations and loops are. It is one skill I believe has helped me problem solve above average. On that note, I would like to teach looping through arrays like I am talking to my former non-techie self.

What is iterations? It is the idea of running a same action to each object of the group.

num_array = [1, 2, 3, 4, 5]

num_array.each |num| puts num * 2 end

The result is a follows

2

4

6

8

10

returns nil

Lets break that down. What happened? I have a array called num_array that contains the numbers 1, 2, 3, 4, and 5. I ran the each method to the array.

I chose to use the each method because I think it is one of the most commonly used iterators and one that as a developer should know. The each method is basically pulling out each individual number 1 at a time and displaying the result of the number multiplied by 2.

The results are not stored because I used puts. The returned value is nil in this case.

Notable iteration methods

map, each, each_with_index, inject, and select

This of course is not the full list of iteration methods, but one’s that I find myself using frequently. If you have any questions feel free to contact me @johnmoon6. Follow me on Github – jmoon90.

If you want to read more about iterations I recommend you check Alan Skorkin’s out.

Breakable Toy - StudyTogether

Published on:
Tags:

StudyTogether is a website where those who want to study with other people can come and join or create a study group. I tried learning Ruby and Ruby on Rails alone. I tried tutorials. I tried books. It was difficult, and I didn’t gain much from it. The problem with self-studying and online studying is that there are endless sources of information, but no one to talk with.

My breakable toy will create study buddies. Other people who are going through the same studying material will be able to talk out problems, teach each other, and learn from the group members mistake. I am going to create a space for users to collaborate on their learning. Something like Khan academy.

Through my experience at Launch Academy, this idea is becoming more and more relevant. I noticed how my learning curb has spiked and is acclerating as I am surrounding with people who are passionate and wanting to learn Ruby on Rails. I will try to incorporate aspects of what I believe to work well in learning in a group environment.

Code On.

Ask Google Through Your Terminal

Published on:
Tags:

During my first week at Launch Acadmey I built a simple ruby script so that I don’t have to leave my keyboard to ask a question through google. I call it NoMouse.

The idea came when Johnny, one of my mentors at LaunchAcademy, taught me that everything we do in our GUI can be done through the terminal. This was a very interesting and cool concept as a beginner. I wanted to test this theory out. I wanted to see if I can open up my browser from the terminal and open a specific page.

Here is how I tackled the theory. I needed to first figure out how to open a browser or website through my terminal.

open “http://www.google.com

This was possible. Now I need to know if I can run a script and open a browser. In my terminal I ran ruby browser.rb and it would run the following script.

system(“open”, “http://www.google.com”)

This opened up possibilities for me. I was becoming greedy! Not only could I open a browser I wanted to see if I can feed a question to the script for it to search.

I needed to figure out what goes after “.com/” for google to search. I went to google and typed in a search. How to play basketball.

https://www.google.com/#q=how+to+play+basketball

The important part of the link is everything following the “.com/” Google uses “#q=” and a “+” symbol for every space. Simply add the “#q=” to the system and then create a variable to substitute spaces for “+” symbols.

text = gets.chomp text.gsub!(“ ”,“+”) system(“open”, “http://www.google.com/#q=text”)

Ideally, this would turn all the white spaces to a ‘+“ and we start with the ’/#q=.‘ It is exact to the google search. This did not work. The # kept changing into ’%23’ when opens the google browser. When I type “How do I play basketball?” =>

http://www.google.com/%23q=%7BURI.escape(@question)%7D It also leads to an error page. The browser is encoding # => %23. I had such a hard time figuring out how to either solve or get around this problme. I figured that there was no way of me to control google from changing # into %23. I needed another solution.

Breaking what I have done is found another way google searches. The escape method defined in the ruby doc, “Escapes the string, replacing all unsafe characters with code.” Basically when i input a question with all the ‘unsafe’ symbols, and spaces with safe code Here is my final code.

http://www.google.com/search?q=#{URI.escape(@question)}

Lastly, if you have any recommendations for me to improve this script or a vision of where you think this could go. Please feel free to share with me at my twitter handle. – @johnmoon6

Visit the repo

The idea is that I run the nomouse.rb script and it will prompt a message, ‘What is your question?’ then the user will input a question they have. This triggers your default browser to open and google search the question.

Vim and Everything Else

Published on:
Tags:

Using Vim is one of the most amazingly frustrating, confusing, rewarding, and geeking out feeling ever. If you asked me how to copy something in Vim you were out of luck, because I couldn’t even navigate folders and files in vim.

This journey of teaching myself Vim with the help of Eric from LA has been a very rewarding. I still have to use Sublime rarely when I want to copy big chunkcs of code on a chat or my gist page, but give me another week and I am confident I’ll figure it out.

Having used Sublime for quite some time now, here are some a list of things that each editor does better.

Vim

  1. Move around super fast. I installed relative numbers so that I can go to the exact line I want to change.
  2. No mouse. It’s self explainatory.
  3. You feel awesome slowly mastering and the in’s and out’s of the editor.
  4. I don’t know when the learning curve ceiling ends. I learn something new to improve my day to day coding every days.

Sublime

  1. Super easy to use. Basically no learning curve.
  2. Command-p is a little bit better than Vim’s. E.G. Searching for file apple_to_go.rb. In sublime you can type apple to go and it will search for you. In vim you have to pretty much type it exactly how it is. If you put a space between words it won’t suggest any results.
  3. Copy and paste is terribly easy.

Quick tips to learning Vim

  1. Read vimtutor in your terminal
  2. Watch how people move around files. Through videos, mentor, or friend.
  3. Learn how to move around. I find this the most important part in Vim. You want to jump lines, words, paragraphs, and screens comfortably and efficiently, less key strokes the better.
  4. Keep going at it. It gets easier and becomes fun getting things right!

Overall I think it is important to improve and increase the tools in your development toolbox and Vim is definitely a big improvement for me. I see myself working towards understand vim in a deeper level in the upcoming weeks. I am excited to see what more I can do with this new found tool.

10 Week Programming Bootcamp With Launch Academy

Published on:
Tags:

    November 11 is the first day of class. This is a high intensity program to teach and push the group to become junior software developers, roughly 1 year epxerience in the Ruby on Rails (RoR) world.

    The reason I chose to attend such a program is because it aligns with my goal of building a successful business from scratch. I want to experience the full spectrum of starting and running a business… even to it’s fall. I’ll have to take everything in, for my next business. I was hesitant to drop 10 grand and leave my full time job to this fairytale of a dream and join Launch Academy, where I couldn’t find much information about the process, hire rates, and simply information about the quality of the program compared to Dev Bootcamp and App Academy.

    My fear quickly dissipated when I heard Ben Orenstein talk about these popular bootcamps. He said he noticed trends of these popular bootcamps emerging and though it was great. He mentioned that it really wasn’t the quality of these bootcamps that makes you a great developer, but your own desire to learn and be great. I’m paraphrasing, but that was the gist.

    I’m exicted to start on Monday and become a great programmer. I want to be the best of the class and I’ll work hard to make a mark. Cheer for me :D