bloc referral

If you are interested in learning to code with a mentor, try bloc and get $100 off.

Monday, July 28, 2014

Ember Talk tonight

I am giving a talk on Ember @FrontEndOrlando. I spent about 3 months interested in Ember, but never took the plunge into trying it out. After finally getting a job in Rails I have taken my extra learning time at home to learn things such as Front-End development and Objective-C.

Giving a talk has also been on my list for awhile and I am killing two birds with one stone by presenting on Ember. I learned a lot in the last few weeks and looking forward to starting a project using Ember soon.

Link to my presentation(draft).






Saturday, July 26, 2014

My Twitter Gem learning experience

I spent a lot of time working with the Twitter API in the last few weeks. Mainly because the code I originally wrote had a ton of errors for the metrics and verification.

I had previous experience working with the Twitter omni-auth for Chuych, but I actually could not get it working the way I wanted. I ended up scratching that functionality out of the app and moving on.

I now have a better understand on how to read the documentation for REST api for Twitter now, and looking forward to putting the Twitter features back in the my app.

Here are some cool things I did to work through some of problems.

1. Read the readme until it makes sense.

Since I now spend 8+ hours at computer researching Rails, I am able to take deep dives into documentation and look at code. The best advice I can give to anybody about learning or working code is, All code is written by humans. There is not not enough magic or witchcraft out there preventing you from figuring out something. Some problems might take a lot of time but its possible to figure things out.

Towards the end of my second week my boss mentioned in passing that he wanted me update the app to include the functionality to send photos along with your tweets. I did not know how to do that at first, but 2 weeks later and we just released that feature on Wednesday.

During my first look into the app, I actually found rather easy implementing the front-end functionality by following the Instagram functionality, but when it came to the back-end I was completely confused. I had a coworker pair with in researching possible solutions for implementation, and it turns out there is a Twitter-Gem. The unfortunate part was we were not using it.

A previous employee actual now is deprecated, and still use the Ouath1. Sending photos with Tweets requires Oauth2, basically everything needed to be updated just to send a Photo Tweet.


2. Really look at the gem code.

The best thing about the Twitter Gem is that it lays out the methods needed for easy setup, for example to setup the call to Twitter and credentials, it can be done in one block as opposed to our 100 line module.







The twitter_interface file we have does all the same and mirrors all things from the gem except for updating itself ;) , which I why I recommend to search for Gem. One of the best advice I got from a thoughtbot learnprime video was if you find yourself writing a lot of code to do something and talk to other components such as API's, you might want to check if there is a gem out there for you.

Programming doesn't have to be difficult if you do not want it to be.

After the gem was install I had to make the decision of pursuing updating the rest of the app to use the gem or just implement photos. Being an a newb I opted just for the photo functionality and put in a tech debt ticket to change the status updates portion later.

I actually spent an entire Hackday Friday on updating the Twitter functionality and failed miserably. There were too many components intertwined with the legacy code, it made it impossible to get done in only one day. I had to abandoned the branch, but will revisit at a later date.

To implement sending tweets now all that is needed to be done is one method. No need to create lines and lines of code to do this.





3. Just try things out.

Don't be afraid to try things out. I through in  the update_with_media  in the app and was surprised to find it worked on the first try. You can try out things in the rails console, which is something I do a lot to figure out how the app works.

I did say sending photos worked on the first try, but I did have to spend time writing test and adding in the collecting metrics for the tweets, which is something my company needed, but a simple personal app, you can probably implement tweeting rather quickly, try it out.

I spent some time looking the code for the gem, which I found to be a great exercise in seeing how the gem is made (searching through the lib file). For a service such as Twitter, the code is not entirely complex. Methods are clearly labeled stating what they do and even provides a great readme.

I challenge you to take a look at the code on gihub. This exercise has personal inspired me to have enough confidence to learn from different docs of different gems. I was able to easily update some Stripe info on our app without knowing entirely too much about it or ever using.

There is also a great Code School video and a Codecademy lesson this.

Thursday, July 24, 2014

No need for CoffeeScript now

This morning our post scrum it was announced that we will no longer be writing production code in CoffeeScript. I mapped a plan in learning multiple new skills in JS and Ruby, which including working through a free book. I now have no need to learn it now if I want to stay focused on learning skills need to advance in a career in web development.

I have not written much production code using CoffeeScript or Front-End code for that matter, so I will not find it hard to completely stop learning this language. I am at a time where all my learning aside from iOS stuff will be closely related to the work I do (though a new Tweet from my CEO says otherwise). My main goal is to advanced my skills in Ruby and Vanilla JS. I still plan on skimming through that book eventually, but with no emphasis on writing the code.

Once I have a stronger understanding of JS I will really look into looking a CoffeeScript then. I feel as if CoffeeScript was made for the Rails devs with limited JS knowledge, but a desire to write it. From what I did write, I found easy to pick up; CoffeeScript has a lot of similarities to Ruby and it's simplicity, but also has a lot whitespace restrictions, similar to HAML.

What are your opinions on CoffeeScript vs. Javascript?

Wednesday, July 23, 2014

Data limit reached

Did you you know that a string can only hold 255 characters?

My job in the few days was figuring out some of the simpler errors within the application. It was an been an amazing practice since it help me in better understanding the project as a whole and what it does.

When I was first given this challenge on my second at work I quickly Googled for the answer and surprised on how easy it was to find it on Stack Overflow. SQLite3 is pretty lenient with its data, so I am not sure if I would of seen this error before, but I have also never dealt with live data in a production situation.

I discovered that some Facebook profile urls were causing the Sidekiq to throw an error. For whatever reason some were coming in over the 255 character limit for a string. The quick fix was to switch the column in the database over to a text field without a limit.








I felt pretty proud when I discovered the fix for this on my own and that I remembered how to do this. from my practicing prior to the job.

If you are creating a new table or reviewing an old, think about the data to be received and if there is a possibility for the data to exceed the limit of a string, 255 characters.




One month in again

I like giving perspectives on how I am doing once I reach certain milestones. I originally planned on recording a video and completing an AMA on reddit, but did not get a large response. I am not sure if its because I kind of removed from the Aspiring Developer scene and no w moving into the obscurity of devs who made the jump in a job.

My hope is to continue to help others and answer questions for anyone looking for one. When I started this in Oct of 2013, I had no idea where to go or what to start learning. I would of loved someone to take the time and answer my questions or give me advice on what to learn.

I am serious when I say, email me or DM me for anything. I can't do pair programming at the moment, but I can jump a quick chat also, just ask.

How Do I feel?

Now that I am on month into the new job, I am very happy with what I have learned. My personal study at home has decreased quite a bit since I am now focusing on my family on the weekends, but I getting tons of time to research the new concepts I am faced with at work.

I spent quite some time working with the Twitter API and learning the in's and out's. I had the challenge of implementing the ability. this past Friday my company held a Hack Day where all engineers are aloud to work on any work related passion project of their choice. I was short on ideas and confidence to complete a task in one day. I originally sought on refactoring something after all the reading I have been doing on it from Katrina Owen, but found that to be a path towards a never ending rabbit hole.

I ended choosing to take on the task of updating the our to use the most update Twitter Gem and functionality. I ended up not completing this task within one working day due to too many interlocking dependencies to old functionality. I did however learn a lot about the gem and another called state_machine. My skill on researching documentation has definitely increased and making it easier to learn (checkout this article for more info on learning through docs).

In reality I am doing great and keeping up with pace of where I need to be. I however, would like to speed up my learning, which I plan to do in the next few months.

What am I learning working on?

I mentioned my learning is decreasing at home, which is true, but I am definitely more focused and spending less time goofing around (Twitter/Netflix) while studying. I have taken on the task to learn Objective-C/Swift, Javascript, and on continue learning Intermediate Ruby.

My plan has been to complete Objective-C and Swift on the weekends, since it requires the most concentration. I did a bit of learning the basics of C and loving to point out the different parts similar to Ruby. It is definitely easier have a basic understanding of Ruby and programming. I would of definitely been lost trying to learn Objective-C first, with all its boiler plate code. My goal is not to become a professional in iOS but to hope to gain a new ability in creating fun apps to share with friends on my phone. That goal will hopefully be realized before the end of the year.

Javascript has been another language where I appreciate knowing Ruby first. Understanding what variables and functions are generally has helped me progressed through the basics easily. I have learned JS in the past but never followed through any tutorials or books due to my focus on Ruby. I have been going through treehouse videos to understanding more of the basics and eyeing a few books to expand my know.

My work does use CoffeeScript and I plan on reading through this free book this weekend. I also have a talk I am preparing on Ember for FrontEndOrlando.

My goal is to be able to write production level JS/CoffeScript by the end of September.

Ruby is always going to carry a special place in my learning, as it will be my main lang for awhile. I was burnt out on spinning my circles with learning programming due to the learning the basics of Ruby (class, method, variables definitions) over and over. I am excited to finally get into some intermediate to Advance books. I have completed POODR but have plans to go through that again.

I am currently working through Confident Ruby for a work book club as well as WGR. I am disappointed in myself for not going through WGR until now, since there are so many explanations that would have help me along the way. I really enjoy layout and looking forward to becoming Well Grounded while hosting the upcoming RubyNewbie book club. My goal for Ruby is to write expert level code before the end of the year.

I have discovered a great pace while reading both of these books. I reading through each section 2-3 times, in order to pick up the concepts I missed on the first pass.

---
I definitely have a lot on my plate but looking forward to continuing my learning and getting back into some personal projects as well. As always thanks for reading.


Friday, July 18, 2014

save_and_open_page method

When I interviewed for this job, I have to admit I said I had Capybara experience but I honestly really didn't. The most experience I had was from install it on my app and not knowing how to use it. I also had failing integration test on my Hartl app but commented them out. Thanks to this job I was able to understand how to use Capybara and even write actual integration test. 

One thing I learned that has been tremendously helpful is using the save_and_open_page method, you literally place that code above the last line of your test and Capybara will save and open that instance of the page, no internet required. Now you will be able to check out the page and find out why a test is failing, by seeing what info is not displaying.

Check out the following blogpost for more info: Ever heard of the sava_and_open_page method?



I find it very similar to how I have learned how to debug Javascript, using the alert("foo") or console.log("foo"), but thats another blog post. If you are unfamiliar with integration testing checkout thoughbot's blogpost on it.

I realize some of these post will not be useful to some readers of my blog. I recommend keeping these tips in the back your mind, because they will eventually become very useful. I am personally using them as my notes to go back to, just as the Ruby Rogues explained. I hope to google the save_and_open_page method one day or any other tipI wrote about and find it in the top ranking on google. So save this, bookmark it, and thanks for reading.


*Please note this method will not work without the gem "launchy"

Thursday, July 17, 2014

I discovered rails dbconsole

Did you know you can access the to drop and add columns in the db? Well I didnt.

I remember distinctively being in an interview for a job that I didn't get and getting asked if I knew how to access the database to make changes locally. It was my first interview for a rails job and I am pretty sure I didn't answer all the questions to the best of my ability, my response was that I knew to access the Rails console (rails c) to adjust and create records in the data. Yesterday it was brought to my attention that you can access the actual db with  `rails dbconsole`.

Let me outline the issue I had

I created a column on the activities table called reference id. This was planned to hold a stripe reference_id so I can do stuff that is not necessary to explain in this post, just know I needed to save an id that was not already being saved. My issue is that I originally set this column to an integer rather than a string. I was in the need to rollback to the previous migration, which I am well aware of how to do that rake:db:rollback, but I discovered that rather than typing the command repetitively you can write how many steps to go back, like so rails:dbrollback STEP=2 this will take you back 2 migrations.

Knowing how to rollback did not solve my problem. I actually had to adjust my local db, which Postgres. The db "psql" is saved locally on my computer and even though used I rollback I never wrote a down command and caused the column to stick locally, since it was never taught how to delete. I highly recommend using the change method. See below for an example of the using the Down and Change.








The above example would have been great and I would not have had a problem, but with out a down method I basically wrote a bug in migration file and it messed up everything and I could't just change the method cause it was broken.

My resolution was to open up the rails dbconsole which was to actually run the following commands.

ALTER TABLE activities
DROP COLUMN reference_id;

What I did was access the activities table and deleted that specific column. Now with my mistake physically removed from the table I was able to rewrite the migration as a change method and make the column a string as I originally intended.






It is one thing to just blow up the db with a rake db:drop:all and start over, but I have found it takes half a day to recreate my sample data in order to properly test the app, so I try to never do that.

This seems simple, but little things as this are the little tip I continue to learn in my new dev position and I will keep posting them as I learn. If you need more info on this checkout this Stack Overflow





Wednesday, July 16, 2014

Odin Ruby is done but Ruby Newbies is not: Next step is Well Grounding Ruby

Someone mentioned to me in one of the earlier meetings of Ruby Newbies, "I am not sure how newbie I am." It is true the connection to newbie is someone with absolutely no experience with Ruby, but my idea is slightly different.

I have spend the last 4 weeks working on Ruby and learning stuff everyday. There are too many concepts that I have yet to experience, I also am not extremely comfortable with the basics of working in things such as Procs and Lambdas, or even know all the cool syntactical tricks of Ruby. I just finished off a basic C course on Treehouse and a greater appreciation for Ruby. I hope to continue with my learning and work with anyone willing.

My plan now that we have completed the Odin ruby curriculum section is to work through some more Books as well as well live code on problems with the group.  I still have a long way to go on this journey and looking for anyone who wants to join, no matter what the level.

I began reading Confident Ruby by Avdi Grimm and enjoy every page so far. I am finding alot of parallels to the POODR book and even found that Sandi consulted Advi to review the drafts of the book. I am not that far in to share the concepts yet but looking forward to sharing on this in future post.

My plan with the Ruby Newbies is to work through the Well Grounded Rubyist, the book has come highly recommended to me but I never got more than a third of the way through it. My hope is to spend 3-5 weeks on it. My initial though was to go through the first 6 to get out of the beginner explanations and right into the meat of it, but it looks like I might tackle the first 4 chapters and give a talk on it. More details to come.

For those in the Orlando area, specifically orange county. You need to sign up for the free account for Treehouse and Lynda.com. I spent a lot of time during my Lynda.com 7 day free trial and looking forward to view some more advanced concepts and new languages now that I have a little programming under my belt. I am just about finished with my the treehouse section on C and moving onto to Objective-C next.

Use this link Here. Link to the WGR book review event, please RSVP, I am hoping to get at least 5.

https://plus.google.com/u/0/b/102551882338253835993/events/cet64uian23s9snilriqs4kqifg?authkey=CIH6o6vovK37owE

Sunday, July 13, 2014

learn.thoughtbot.com, I tried it out.

I tried thoughtbot's learnprime, online training material months ago. I never signed up for the paid version but viewed the sample portions of the videos, but always had it on the back burner for things to do. I recently got a marketing email form Ben Orenstein stating I could start the learnprime program at 50% off.

The course is at steep price in my mind, $49 at the mid-tier. I chose to go ahead an try out the program for a month. thoughtbot is a well respected organization and I have always been pleased with their blogpost and podcast. I also have enjoyed the teaching Ben, mainly from viewed conferences talks on Youtube.

I was surprised to find out that the course did not meet my expectations initially. I actually did not even complete workshop before casting judgment, which was unfair. I only ran through the first portion of the iOS workshop and viewed the first half of the Intermediate Rails.

I admit I initially did not give the courses a chance and only skimmed through, but after just about finishing the Intermediate Rails videos. I find that they are worth the amount I paid (which was 50% off). The Rails tutorial was out of date using Rails 3.12.2 and I had issues getting it up and running with the recommend version. I finally just bundled the latest of everything, including Rails 4.1 and did not have a problem.

I eventually completed viewing all videos in the Intermediate Rails group and plan to rewrite the app a little each day. I also started the TDD app/workshop which I will probably complete this week, since it is smaller. Thanks to VLC and the ability to download the video, I have been watching all the videos 2x speed.

My final conclusion after viewing the videos is the content phenomenal and worth the money paid, I however would not recommend it to beginner or anyone just dabbling. I believe the content is great for someone with quite a bit of Rails personal experience in multiple apps/tutorials. I actually review some things I learned at work from others devs including, Single Table Inheritance and Object Oriented Design. I even saw areas of improvement I could bring into my work app, by limiting the dependencies within the controllers.

What I liked about the content is they take time to explain the best practices of Rails and concepts from Sandi Metz's POODR. I couldn't find it better timing since I have been binging on her past Rails talks, now that I have finished her book. I highly recommend her teaching and recommend watching the follow talk at Rails Conf 2013. It is basically a tease of whats in her book.

The TDD workshop is definitely a must for anyone looking to be hired as a Rails dev. Not every company practices TDD, but it is the best walkthrough of Unit and Integration testing I have seen. Even if you write your test last, the way test lines up right with the recommendations of chapter 9 in the POODR book. This workshop is $15 on it's own and definitely worth money.

 This brings to my observation, the cost of learnprime is high but they offer some high level content, which I never took into consideration. The weekly iteration is awesome videos delivered every week, and some info hot topics in the industry to stay cutting edge. Again this is all info for established devs and ones close to becoming established.

I am still on the fence to keep my membership for the iterations alone, as I feel I can finish both workshops before the end of the month. I am definitely appreciative for the content they have provided in the course; but I have no plans in completing any others but very interested in viewing all the iterations.


Saturday, July 12, 2014

My thoughts after Completing my first Ember tutorial


I spent some time with this Vic Ramon's tutorial and learning how to create a basic app with Ember. For those who don't know, Ember is a Front End Javascript framework which is built similar to how Rails is built.

Comparing it to Rails. 

Ember is labeled as an MVC framework, where there is a Model View and Controller to work through each layer while completing the app. It is very possible, just as in Rails, to complete the entire app in one page and 100's of lines of codes, but each file (Model, View, and Controller) holds each part of the functionality. Just like Rails, the Model holds the info, the Controller makes the Model move, and the View is where you see it. There is also a Router just like Rails, and having familiarity to all this made since.

Its hard to compare the two exactly or whether you should learn one over the other, since are both to different things. I liked that the tutorial I completed is used Ember as the Front End of a Rails app. This basically removes the need to put all Front End functionality into the asset pipeline.

I found it very cool how I quickly understood the concept of Ember while going through the tutorial. I always avoided learning a Javascript framework due to my extreme focus on Ruby/Rails and lack Javascript knowledge, but similar to Rails you do not need to know a ton of Javascript to learn Ember, Angular, or any other framework for that matter. The tutorial also gives you some links as you read through and complete the process.

I can tell you that the going through this tutorial was easier than going through any other Rails tutorial, but that is because I had the Rails understanding. Knowing programming in general, plus have a little bit of experience made this extremely easy to get through once I got going.
















My impressions

Im very impressed with the Ember community, similar to how the Ruby community impressed me with their openness to newbs. The community is also very small and even the core members seem accessible for questions. I am looking forward to checking out another tutorial, most likely a pure Ember app without Rails, like this one.

What I did like about the Vic tutorial is the ability to switch from Coffescript and Javascript. Rob is probably not going to like this recommendation, but if you are know Rails already and now learning JS, learn Coffeescript. The syntax of Ember reminds of Coffeescript and it makes sense why Vic, recommends it over vanilla JS, however I do know there is a large job market for people who know pure JS, so to each their own. I have never taken a Javascript based course to learn the basic syntax and barely 20% of the way through the Codecademy (I need to finish that), but I am surprised how much of the syntax I understand.

During the tutorial I finally learned how to properly debug JS in the Chrome console (here is a good tutorial on it). I had a couple typos preventing me from moving on with the tutorial, but in total it took me about 6 hours my second time. The first time I went through the Ember tutorial I had a lot of issues with Coffeescript syntax errors and switched over to pure JS, but by then I had a better understanding Ember and was able to fly through it. I plan to finish the Coffeescript version tomorrow and recommend if you do try this tutorial to try both, its good exposure.

If you know Rails and looking to get into a FrontEnd framework, then definitely try out this tutorial.


Friday, July 11, 2014

Tell Don't Ask concept

So I finally attended the Orlando Ruby User's Group for the first time since October and blown away from how much I learned from two topics I was already familiar with. One was on creating an MVP and the other was on authentication with the devise gem.

The first was given by Code School's Carlos Souza and he gave us a sneak peak into a video series coming out shortly called, Feature Focus. The repo is available on Github for the Base Camp clone if you are looking to read some code, which is a great way to see what an MVP is. There are no slide available but the course will go over the details of building the Base Camp app.

Something I am looking forward is the interview with DHH and his critque on the code and his recommendations for Carlos. For example there was a method offered called "Tell Don't Ask." The idea is basically to stop writing if statements and begging the language for info, but getting what you need.

For example this is from the Code Schoolrepo. The | | is literally checking the if the result is this or that, this an alternative to writing out an entire if/else statement.

Translation to if/else:

def find_by_target

  if result = User.name
     then this
  elsif result = Product.title
    then that
  else
    nil

end



Let me know if this makes sense or can be better clarified, this a subject I will be doing some research on, for sure posting on more. Really happy I discover this. I am sure there are also better examples of this, please share those too.

Thursday, July 10, 2014

subl shortcut to pull up Sublime text from the command line

I always forget how to do this so I am writing a quick blog post on how to set up your Sublime short for "subl ."

The subl command is nifty tool I originally learned from the One Month Rails videos (the originals), but when you go through the updated Rails course they do not share how to do that. Its also something you only do once and never have to worry about again, unless you are me and on their 3rd computer since starting their progamming journey.

1. Macbook from college. 2008 White Macbook 13''
2. 2012 Macbook Pro 13'' I bought used off ebay (thanks Kosh Kemps recommendation from his book.) because my first mac had too many quirks and a battery issue.
3. Brand new work computer. 2013? Macbook Pro 15''

All 3 computer I used within 9 months of each other and I install Ruby on each. I also install this shortcut and had to search through stackoverflows to find it again, which wasn't easy this last time, so here it is. Just in case I get another computer, I will know where to go.

For Sublime Text 3 just enter the below in the cli and voila.

`sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl`

Here is the stackoverflow is more detail is needed or you are using Sublime Text 2.

There are other cool commands I might share in the future for Sublime, but for now here is a video on multiple select, which I relearned to do yesterday for something.



Monday, July 7, 2014

Ember and VIM tutorial

Staying true to my goals I have started the Ember tutorial. I am only half and can't really report on it at the moment, but I do have to say its nice to go through a tutorial on a framework and understand everything that is going on. Ember is a MVC framework, which operates very similar to Rails and with my background in that framework has made it super easy to breeze through this tutorial.

On another note, I typed `vimtutor` in my terminal and got a pretty cool initiation to VIM. I didn't even know it was there but as many recommend, I think you should give it a try. There will be a day when you will have to interact with VIM, just make sure you know that `j` will move the cursor down.


Thursday, July 3, 2014

!!Bryan - I am taking another look at my goals for 2014

I actually used the double bang (!!example) in actual production code at work. But first, I was taught what it actually does. There are some hang ups with using it, but just keep it use in the back of your mind in case its ever needed. Basically forces a Boolean.

Orlando.js

8 months later after I attended my first meetup, which happened to be at Envy/Code School,  I attended my second meetup there tonight. I told myself I would make it out there again but never did. For one reason its over 2 hours to drive from Tampa with Orlando 9rush hour/disney) traffic, but luckily I now live in Orlando and 2 miles from the Envy office.

I attended the second ever Orlando.js meetup, which make me surprised that there was not one before, since there are 3 Javascript in Tampa alone. Tonights meeting was in detail on OOP in JS. It kind of got me excited to learn more vanilla JS and check out some books, but for the moment I am focusing on getting through these Objective-C and Ember tutorials, but its tempting to jump into more with all these meetups.

There is without exaggeration a meetup happening every week that is programming related and I plan on being at most. I might as well take advantage of the opportunity while I am so close to them.

Goals for 2014

As mentioned before in a post, I wrote some goals out for the year and I had the opportunity to check them out again. I have every intention to complete all by the end of the year, but realize I am behind. However, I did complete the goal of getting a job.

In short I still need to create a tutorial, which I might change to give a talk (since there are so many meetups). I also need to deploy and publish a functional app, which will be Chuych eventually, and finally based on the mention by Daniel during the Ruby Newbie chat; I will be trying to hit a goal of 75 stack overflow questions answered by the end of this year(not necessarily correctly). I needed to start this yesterday.

Well if you have a question for me put it in s/o, I guess...


Working in a Ruby Dojo helps my TDD: I also learned how to view a PR locally for work.

Viewing a PR locally

Some tools you will learn and never have to use. I want to share a quick link on how to view a pull request locally. I found the following gist on how to view a pull request locally. There might be a better way to do this, but I found this to be pretty easy to do.

Starting off you have to make sure you are in the develop/master branch of the project locally(after you have cloned the repo) and run `git fetch.` Fetching will not only pull in the latest commits on the branch but all other branches in the project.

From the command line you will be able to access all pull request using `git checkout pr/<pr #>` and voila, you have access to that pr. Technically you are able to pull the branch the pull request came from also, but I find this easier, since you are looking view those specific changes.

My most recent use for this tool was to review a pull request done by a contractor, there were multiple changes to implement a feature, but it also had multiple errors. I found it nice and east to merge the pull request into my branch and check it out locally. There were multiple conflicts, but it helped me understand what they did as I fixed the changes. If you do not work in a team, I highly recommend joining up with the Odin group and picking up some small task they need done; it a great way to practice some of these concepts.

I am now going to attempt to write test to check their's and my functionality implemented, I do realize I should of wrote test after the merge to check if any of the code actually worked. I came to this realization duding last night's Ruby Dojo, where I was able to practice and view TDD in action. I hope begin writing test first today and help steer myself into writing better Ruby code.

At work TDD is not a requirement, as long as test are written they are cool with it. I also just finished the last chapter of POODR and highly recommend the book for that chapter alone. Its all about testing and testing for the right reasons. I spent 7 minutes in the Dojo testing if an argument returned that argument, which sounds confusing now, because it was and unnecessary. When testing, it should be in small increments and towards the goal of actually solving the problem, not just for the sake of testing (I will walk through this concept in a longer post tomorrow...promise).

Once again, thanks for reading and if you are in the Orlando area, check out the Dojo. Also if you want to read some inspiring post on awesome Ruby concepts check out Ramon's blog. Right now he is going through the book Refactoring Ruby, which has convinced me to put it on my list of books to read.

*If you wan to try the coding exercise yourself, check it out here and let me know how you do. Limit yourself to less than 30minutes and use TDD.


Wednesday, July 2, 2014

Stop torturing yourself and look it up already.

I spend everyday at work in README's and scrolling documentation.

I was surprised to find out that the Computer Science degree today sets graduates up to learn the Philosophies of Programming and walks them through Algorithmic Learning. But despite the 4 years of hard work it does not make them any closer to actually building real projects.

I went through Bloc which is an awesome program, only a fraction of what a CS degree cost, and learn the fundamentals of Ruby in 2 weeks. I was in no place to start building any large scale applications, but I had a mentor to push me through the tough parts and also got recommendations of code samples to follow.

At work I am in the very same situation, I can build a small MVP in Rails on my own but in no position to produce the amazing code needed to create an application on my own in a timely manner.

I enjoy the fact that I am surrounded by individuals from very different backgrounds, some with degrees and some without. I enjoy that I am able research programming concepts while at work and discover new tools to make my job easier, which brings me to my main point.

While learning, I found myself doing one of two things when learning or going through code exercises. I seemed to always push myself so hard to learn that I would not look anything up or even think to look at the code of others. If it wasn't my code, I felt as if it was cheating; I know now that it indeed is not cheating, but actually part of the learning process.

My initial thought process was definitely silly now that I look back and now I compare a programmer to an athlete, lets take a Tennis player. There is no doubt that Roger Federer has watch other tennis players and even absorb a bit of their style.

To think that I could be a decent programmer without ever reading the code of others and I believe its not too far off from what others are thinking. I am still working to change that thought process with myself, but thought to write on it as encouragement to myself and others.

My recommendation is to compare code to others and do not be afraid to read the code of others, even if it is for a "code challenge" or an interview. one thing I found while completing the Conways Game of Life for an interview with another company, is that they do not mind if you viewed someone else's code to complete a problem, as long as you can explain what is going on in the code.

Understanding and learning from code is not cheating, but be sure to reference to where you learned so they can get credit and maybe one day people will be sharing your code to learn from.

Now go read some code!



Tuesday, July 1, 2014

Rails Panel and Better Errors

I was told of another pretty nice tool to help in working with the legacy code at work. I find that trying to figure out where I am at in the app while debugging errors to be difficult. The main reason is due to the templates being named very similarly from page to page.







Chrome comes with an element inspector which works similar to rails panel to debug front end issues and discover the actual names of items in the asset pipeline. I am still very much a novice when it comes to working with assets and templates, and find it very helpful to be able to see the page interaction and found it very useful to write integration tests.

Another great tool is the Better Errors (you can debug in the browser!) that is used at work and both are explained in this short Railscast.
I am extremely blessed to be able to learn and use these new tools everyday and looking forward to sharing new tools as I learn them.

`git checkout --`
Another quick tips I wanted to add was the use of `git checkout`.  Most people might know that `git checkout . ` can be used to clear all changes to your code to your last git commit. I have found it very useful to practice writing code without any fear of breaking something, I can also revert back to the original state of the code if I mess things bad, but sometime I find I inadvertently make changes to files that I do not commit.

For example I sometime change the spacing of a file of play in a file while doing testing that does not need to be merged to the project. Instead of reverting to the original state of the code using the `period`. This week I started using `git checkout -- <filename>`, which only reverts that file.

I am sure I saw/used this tool before or maybe used it in a Code School video, but I have yet to use it till now and felt like I could share. so if you find yourself going through the Hartl tutorial and stuck on error, rather than starting completely over, just `checkout` the files.

Thanks for reading