One Way To Pair Program

Tonight a couple people were wanting to know the best way to pair program together. They had both done the beginning parts of the Tic-Tac-Toe with AI project (the one I’m getting ready to start) and wanted to work on the AI part together. The exact question was:

Hey @*** and I are doing parallel pairing :slightly_smiling_face: what is the best way to go about this, to work on the same repo on separate branches or just copy on paste. She is on IDE, I’m on local. Any help muchly appreciated!

The always awesome and helpful instructor Cernan Bernardo quickly gave a how-to that I knew others could use. I’m just going to abbreviate what he said and turn it into a numbered list.

  1. Grab each other’s SSH URL for your respective GitHub repos.
  2. In your respective terminals (local or IDE) you would each run the command git remote add upstream *copy_ssh_url_here*.
  3. After running those commands when you run git remote -v you will see two remotes…one for your origin which is your respective GitHub repo and one for upstream which is your partner’s repo.

Now the setup is done, here is the work flow to be done before either starts working on the app:

  1. Run git pull upstream master…this will pull down any code your partner has added to the app and pushed up to their GitHub.
  2. Work on your part of the app.
  3. Run git push or git push origin master…this will push your new code to YOUR repo.

With that work flow you will each have your code in sync. Just remember to pull before you push.

So there you have it. Questions feel free to ask and I’ll ask Cernan 😉

Day 20

Sorry I didn’t get a blog in yesterday. I was struggling with setting up a dual boot of Ubuntu on my Windows 10 laptop. I ran into the problem of not having a large enough partition created and hit a snag. That said everything was installing fine once I got going. I had hoped to just run a persistent USB key and be able to take my dev environment wherever I want but I couldn’t figure that out. Needless to say, I didn’t feel like writing. In addition, all I did was watch a few lectures last night so there was little to report on. I decided to setup the dual boot because after my intake conversation with Tracy I was convinced that I should take the time and get my environment setup. It took some time as I had less than 10GB free but by being creative, and using WinDirStat combined with Revo Uninstaller, I changed that to ~25GB. I decided to make a 15GB partition for Ubuntu 16.04.2 LTS but ended up running out of space. I freed up another 5GB today and add ed that to my Linux partition. Overall it was probably about an 8-hour process. I have yet to code in it but I’m writing this post in Atom on Ubuntu and I’ve cloned down my static site from GitHub using the terminal and I plan to push it as well. One of the biggest changes is that everything just works, in the sudo apt-get install kind of way. It’s nice. Also, Windows doesn’t want to go past a 1920×1080 resolution and Ubuntu will go 3200×1800 no problem. My eyes are still adjusting but I know I’ll be fine. Ubuntu was being a b*tch last night trying to install packages and stuff (programs hanging, etc…) but today it has worked great. I’m not sure if having some disk space has helped the OS out but my frustrations have disappeared today.

Today I started my Music Library CLI Project for Object Oriented Ruby! This thing was a beast with 71 tests that I needed to get passing. Luckily I could piecemeal it together all based on code I already had written. There was a good amount that had to be written from scratch or completely changed to make the tests pass. However, I had a very strong base of knowledge to work with. I rarely had to Google or hit up Ruby Docs for answers today/tonight. I only hit one MAJOR snag. I couldn’t get a test to pass but everything looked right. I ran the CLI in my terminal and the output was perfect. After 90 minutes of trying different things, I finally reached out to what is called a Learn Expert for help. 30 minutes later she was remoted in on my computer and ended up commenting out the test because her and a colleague had both agreed my code worked for the requirements even if it didn’t pass the tests. After that I was done in <25 minutes. It took me 7:57 to finish the project from start to finish and I probably could’ve shaved over an hour off of that. I haven’t refactored at all but the project is here if you’d like to see it.

Today was the kind of coding day I’d like to have every Saturday and Sunday. Maybe 1 more productive hour in there though. Tomorrow I’ll start a CLI Tic-Tac-Toe with AI project. I’m interested to see how AI is going to be tested and required. Mostly because I read this post on Medium about building an unbeatable Tic-Tac-Toe game not too long ago. I thought it would be fun to implement so I’ll see if it’s possible, maybe on the refactor.

Not much new to post about. Just been doing a lot of lecture watching and coding projects currently. Oh, I did learn about the unless method today from a Learn Expert when a piece of my code wouldn’t pass. I’m realizing sometimes nobody can explain why we need to use unless or if or while to make something work but that’s part of it. Some things are just at such a high level of knowing the language that the majority of people won’t know why.

Time spent today: 9:52
Time spent total: 92:48
Lessons completed today: 2 (and 2 yesterday)
Lessons completed total: 283

Day 18

Today saw a lot of new stuff. I feel like a ton of stuff was introduced and not gone over very deeply but deep enough for me to understand and implement it. In 11 lessons and labs I was exposed to super and how to use it, mass assignments, creating and implementing custom errors, gems, bundler, and basic scraping with Nokogiri. I can tell I was exposed to many things in preparation for the first projects, which can’t get here fast enough! At least I say that now, we’ll see how I feel when I’m at a complete stand still and stuck on one of them lol.

Today I got stuck for a little while utilizing super. I had a lab with a parent class with a method that simply puts "I can't remember what it was exactly." and in the child class I was suppose to use super to have that phrase repeated 10 times. So my initial attempt, inside the method was: super.10.times as I figured I could just call this method but I got NoMethodError: undefined method `super' for #<Enumerator: 10:times>. Hmmm. I did some searching and even called super.class in pry but couldn’t get anymore info. BTW, super.class literally gave me nothing but a new line in pry to look at, or was that actually something??? So I posed the quesiton in the Slack channel for those who are enrolled in the bootcamp. After a side chain of responses with back and forth I got what I needed for my understanding

super yields the implementation from the method it’s overriding and returns the last return value or it just returns the last return value.
Yianna (thanks!)

This is what I needed. Since it’s returning the last value and super was just a simple puts method the return value was nil. No wonder I couldn’t make method calls on it. I also got some way more in depth info that I haven’t had a chance to digest yet. I didn’t want to get stuck on it when I knew just typing out super ten times would pass the lab. In fact, that’s how Flatiron’s solution was coded. This lab was more about understanding how super works than how to call methods on it.

Other than that it was just A LOT of information as I stated at the beginning. Also a chuckle when I found out that ~> is affectionately called a “twiddle-wakka” for whatever reason. I can figure out the twiddle part but the wakka is stumping me right now. If you know please comment and inform me.

I have a few video reviews and then I start projects!!!

Time spent today: 3:16
Time spent total: 79:20
Lessons completed today: 11
Lessons completed total: 279

Day 17

Tonight was good. I like having a dedicated 3-hour block at night instead of 1 hour in the morning and 2 hours at night. I feel like I can get into a better flow and get more done. I did a study group tonight on a banking lab that I had worked on recently. Took away from it to utilize self on pretty much all instance variable references after they have been initialized (created). This is because when we reference the instance variables directly we’re cutting out using the macros that attr_accessor attr_reader attr_writer provide. It is true though that writing code that uses @variable instead of self.variable will still pass the tests I’m working with. I know this because I’ve been doing it haha.

I got through some module lessons and labs once the study group was over. Something to always remember is:

If you have a module whose methods you would like to be used in another class as instance methods, then you must include the module.
If you want a module’s methods to be used in another class as class methods, you must extend the module.

Modules are sweet and I’m happy I’m going to start using them. Things are getting simpler while they’re getting more complex at the same time. There are so many things that have already been figured out in the world of development and slowly they’re being introduced.

I also learned tonight that there is a term for the workflow that most people follow when they write code. The workflow being, you have tests that are failing, you write whatever code is needed to pass your tests, you break that ugly code and write cleaner code to pass your tests again.

This is called the red, green, refactor pattern. First tests fail, then you write bad code to get them to pass, then you refactor that bad code into good code.

I guess it makes sense that these things have been defined. I’m not inventing web development. Just learning it.

Time spent today: 2:37
Time spent total: 76:04
Lessons completed today: 4
Lessons completed total: 268

Day 16

I completely missed my 6am wake up this morning. I realized I didn’t reset my alarm from Sunday night. Since I was up until 1am Sunday night I changed my alarm so I could get more sleep. However, thinking about it now having finished tonight at 11pm instead of 10pm I think I’ll keep it this way. No matter what I know after 8pm I can be productive. My wife is home and the kids are supposed to be in bed. Whereas in the morning if the baby isn’t happy or one of the toddlers decides that 7am is a good time to wake up I’m stuck and just lose that coding time. I also think this will be more effective as the labs and projects get more in-depth. A longer time will allow me to get in and tackle a problem that only an hour might not.

Not much to report today except I’m done with Object Relationship and will be starting Object Architecture tomorrow. I have noticed that things are getting repeated to let them sink in and produce some muscle memory. Even if that muscle is the brain. So there will be a video lecture that will be something being built and being explained as it’s built (or be a Q&A while it was happening), then a lesson showing step by step how the same thing is built, then a lab where you do what was just taught verbatim, and do it one more time non-verbatim but the exact same thing.

I’m 17 lessons/labs away from my first projects! That gets me so invigorated to just crush these next few labs and to start building. I can’t wait to have some stuff to show off and add to my portfolio.

Time spent today: 2:26
Time spent total: 73:26
Lessons completed today: 4
Lessons completed total: 264

Day 15

Day 15 and I’m still here. If you didn’t see it I wrote a rather long blog post today as one of my requirements for Flatiron. Since that took up over an hour and I had a 1:10.00+ video as a lesson I didn’t get much done. However, I DO have notes from the past couple of days that I never took the time to share.

So on Saturday morning I did a study group with some people and learned a lot. We went through one of the more challenging Procedural Ruby labs. One thing that I had never thought to do was put my pry in the rspec test file. So I could look at what was going on when everything had already been passed in. I had been putting the pry in my code and then needing to call the methods above it before I could work on the current problem. I’m still not 100% on utilizing pry but I’m getting there. It’s definitely easier and more useful than IRB.

Another nifty thing I learned from the study group, which I’m still not completely comfortable with but makes sense, is calling methods on end. For example, we did this:

def all_holidays_with_bbq(holiday_hash)
  holiday_hash.map do |season, holidays|
    holidays.map do |holiday_name, supplies
      supplies.include?("BBQ") ? holiday_name : nil
    end
  end.flatten.compact
end

The way this works is the .flatten.compact is being called on the return value of holiday_hash.map. It’s still settling in my mind and I haven’t used it since but I can see where this is useful.

Mike who I pair programmed with last night informed me to get a solid understanding of self so I’ve been taking details notes on things I think are of value. I have:

We can define methods in which we tell objects to operate on themselves. We do so using the self keyword, inside the body of an instance method, to refer to the very same object the method is being called on.

I like that definition and it’s not too abstract for me to understand what it’s saying.

Lastly, in one of the lectures, Avi stated to try not to use the return method. He said if you have to use return you’re probably doing something wrong and utilizing return can cause problems. This is because every method has a return. We should be able to get what we need utilizing higher level methods that will return to us what we’re looking for. This makes a lot of sense to me. If I have to use the return method then I’m probably missing something in the code I’m returning. While this isn’t a hard and fast rule it’s something I’m going to try and stick to.

If you’re keeping up, I didn’t look into ||= &. or .tap today.

I’m 55% through Object Oriented Ruby. I just realized this because I took a glance at my Dashboard which I haven’t really been doing lately. It’s moving along but I know it’ll take a while once I get to the end. I have some projects to look forward to!
Object Oriented Ruby Projects

Time spent today: 3:17
Time spent total: 71:00
Lessons completed today: 2
Lessons completed total: 260

Why Software Development?

So as part of my bootcamp experience Flatiron School requires me to write blog posts. This is a feature that I don’t think all bootcamps have but is smart. If I can write about coding then I show a deeper understanding about why I am a job ready developer. We all know that our online presence is part of our “resume” now as more and more hiring managers are looking at social profiles when making job decisions (even if it’s a legal slippery slope…).

So I have assigned topic of, “Why did you decide to learn software development?”

There are many reasons I decided to learn software development. Initially, it was because it is the “cool” thing to do these days. Demand is > Supply when it comes to people in the tech industry and overall everything we do now is being run by a computer. The Internet of Things (IoT) needs to be programmed. I truly believe that we are moving to a knowledge economy and very soon (on the grand timeline) most repetitive jobs will be replaced by robots, including driving. See a great post on automation here. However, people will need to program these things.

Things like bootcamps are popping up like crazy as people are making the jump to be developers. The potential pay and benefits are attractive too. We’ve all seen images of massive tech companies and their offices where you can take a break from your bean bag workstation and get a massage from the in-house masseuse while listening to a private live Billy Joel concert streamed to your company provided Bluetooth Beats headphones. Okay, maybe not that extravagant but you get the idea. Or the person who travels the world making 6 figures and all they need is a laptop and internet. Having that remote work freedom at some point is also attractive. Who wouldn’t want this life?

Another driving force is that I was in hospitality. An industry that is NOT family friendly. 55+ hour weeks are required for salary managers in most instances and nights, weekends, holidays are the busy time. I kept with it by saying I would eventually be in a high enough job title where I would be doing more strategic planning and thus work a more typical 9-5 schedule. I still believe that to be true. Once a person gets to District Manager or F&B Director you check in on early morning and closing operations occasionally but you could care less how the money is counted at close, just that it’s counted correctly. If it isn’t counted correctly there’s always a manager below you to push that to anyways. Something I rarely speak about but through my 10 years in the restaurant business I was laid off 4 times. I was paid severance a couple times and a couple times just collected unemployment but the lack of job stability paired with seeing people 2 years into a tech career making 2x what I was making cemented my interest.

So I dabbled while still working my restaurant job. I learned from freeCodeCamp the most among many other places. Knowing that I could work on a project for hours without taking a break, then stop for the day, then pick it up two days later, then stop, then get stuck the next day and make zero progress, then two days later finish it off, and LOVING that process cemented in me this is something I wanted to do.

I also realized that on the intellectual front I would always be challenged and have something to learn when it came to software development. I’ll never know it all and that is a bonus.

So how could I make this career transition with a mortgage and 3 kids? In person bootcamps were out of the question. There are two in Nashville (that I know of) and I know people who have graduated from each. First, Nashville Software School is an awesome program. However, it takes 6 months and we didn’t have 6 months of me not working to spare. The other is The Iron Yard and while they have a solid reputation the approximately $1000/week tuition was not going to work. In addition, I knew I couldn’t be out of pocket completely for 12 weeks, my family life would fall apart. So I came across the Flatiron School Online Web Developer Program. Work at your own pace when you have time, job guarantee, a solid curriculum, and high praise from people in the industry I spoke with. The work at your own pace is what sold me the most. I could code before the kids got up and after they went to bed and all weekend long when my wife was home. I could still take care of my kids all day M-F and we wouldn’t have to pay for a nanny. I could potentially finish in 12-15 weeks (they say the curriculum takes ~800 hours) just like a more traditional bootcamp but spend $6000 instead of $10k+. Boom, now to get in. I applied, did some coding, and got accepted (acceptance rate is ~8% so it’s competitive).

So ultimately I decided on software development for a few reasons:

  • It genuinely interests me outside of doing it as a career.
  • The pay ain’t bad.
  • More “normal” schedule so I’ll be home for dinner, off on weekends and holidays.
  • The possibility of working remotely.