- See more at: http://blogtimenow.com/blogging/automatically-redirect-blogger-blog-another-blog-website/#sthash.YsVbCxL0.dpuf Journey to Becoming a Web Developer: November 2013

Wednesday, November 20, 2013

Designing classes with single responsibility

The single responsibility principle is using classes in our application that each have only one responsibility. Classes that have more than one responsibility can become too convoluted and can break more easily. The type of programs we want to make involves creating code that is reusable. Classes that have more than one responsibility are difficult to reuse, so having classes that do one thing is very important. One question that I had while reading this was how would I know if the class I built only has one responsibility. The chapter gave some helpful tips on how to determine this. One was making the methods into a question. If the methods seems to be doing different unrelated things then we don't want that. Another was to describe the class in one sentence. If the sentence has "and" or "or" in it then the class most likely has more than one responsibility. Overall our class methods should all be related and work to towards one common goal.

Tuesday, November 19, 2013

Iteration Viz


Iteration reminds me of mince meat grinder. A mince meat grinder takes in meat does something inside of it that minces the meat and produce the outcome. It will do this over and over. In iteration the iterator will go through an array take each take element and produce some sort of out come. 





Saturday, November 16, 2013

Iteration in JavaScript vs. Ruby

During class we used this javascript iteration example:








to demonstrate how iteration works. We were then asked to do the same iteration example in Ruby.

This is mine:








In my opinion the JavaScript example was a lot clearer. After seeing it I understood better how iteration works because each step was shown. In the Ruby example all of the steps are inside of the .times method, so it's harder to understand the concept when all of the steps are hidden. I like that the words state, condition, and increment were used to explain iteration in JavaScript. In the example i = 0 is the current state of i, i < 101 is the condition that has to be met, and i++ is the increment meaning what we want to increment i by in this case we want to increment i by 1. When facing an iteration problem that I don't understand I can refer to those words to get me on track. I was studying Ruby for a little bit before this program and thought I fully understood iteration, but after this lecture realized I didn't know it that well at all. So this was very helpful for me.   JavaScript is clearer to me when it comes to iteration, but to learn Ruby and JavaScript simultaneously maybe a bit difficult for me at this point because I'm still trying to understand the concepts of programming, but if there are concepts other than iteration in JavaScript that can help me understand Ruby better then I'm all for it.

Thursday, November 14, 2013

Fizzbuzz

I'm having some git issues, so I'm just going to take a screen shot of my code and of the solution that differs.




In my solution I used next because when I tried it not using next it kept printing 0, so I used the code on line 1 and it omitted it. The code on line 4 says that if i has no reminder when divided by 3 and 5 it should print "fizzbuzz". I wrote the code on the bottom at first but because the other two conditions were already met it didn't work. Once I changed the order it worked.








The solution above I got from gist. This solution differs from mine. This solution uses a .each iterator and it puts the whole code in one block. Also this solution using 15 instead of 3 and 5.

Tuesday, November 12, 2013

Working with the command line

We all use the command line to create projects with, but I never really understood it. In todays lecture Blake went over the command line and some of it commands. The command line is used to give our computer commands, so that it can do work for us. Learning the command line well can make our lives easier when programming. Here I will outline some command line commands I find helpful:

pwd

pwd prints out the working directory we are currently in

mkdir

makes a directory(folders). This can also create directories inside of other directories

cd, cd . , cd ..

will change the directory you are currently in. cd .. will put you one directory above where you were. cd . will keep you in the same directory

rmdir

will remove a directory. Very important command when one makes a mistake.

touch

touch creates a new file

tab completion

guesses which command you want to run





Monday, November 11, 2013

Optimism

The article on optimism was very insightful. I was already beginning to include some of what he was saying into my own thinking. I know that programming can be very frustrating and having negative thoughts that can hinder one's success. I can see how taking criticism personally and seeing failure as something we can't overcome can cause stress and depression. I have experienced this in the past. I also feel that comparing ourselves to others can also cause some of these negative feelings. Negativity though just bring on more negative thoughts and experiences, so during this program I plan to see the positive even when things may look a little bleak.

Sunday, November 10, 2013

First day of classes

So tomorrow is the first day class at the Flatiron School. I'm really excited and also nervous. I just hope that I can keep up with the class and be a productive group member when the time for group work arrives. I know that my introversion can hold me back at times. I'm going to make an effort to not let that stand in my way. Over the weekend Ruby became a little clearer to me for some reason. I'm really happy that I'm finally beginning to see how everything comes together. Ashley and Blake seem like wonderful teachers so I'm looking forward to the next 5 months. I think great things are in store.

Monday, November 4, 2013

Rails and Ruby Assessment

Hello all.  Today I continued working on my Ruby assessment. It is absolutely nowhere near perfect, but I'm happy with my progress. I also started Code School's Rails for Zombies. Code School tutorials bore me a little. I prefer Treehouse, but I did finish it. I am now moving on to Michael Hartl's tutorial. I started this tutorial months ago, but never finished it. It will be good to look over it again. It has a lot of useful information in it and for me it was pretty easy to understand.  Tomorrow I will do more of Michael Hartl's tut and most likely I'll be done with my ruby assessment.