Think Outside the Block


new.map{ |u| expert = u * experience}

each_with_index and each.with_index: one is better than the other.

Ruby is currently (and probably will continue to be) my favorite programming language. Mats did a beautiful thing for everyone in the community I now belong to. There are so many “higher” level methods and you really cannot know them all by memorization. But in ruby most of time if you just guess It will probably work. I wanted to reiterate over a few cool little things I encountered here at Flatiron. The first is the subtle but useful difference between each_with_index and each.with_index. First the one that I think is less cool (as you have less control) is some_array.each_with_index. Here you pass in a block and you extract each element of the array and it has a corresponding index. So some_array = ["Randy", "Kermit", "Ms Piggy", "Burt", "Ernie"] some_array.each_with_index{ |element,index| puts "Yo, Im #{element} at the #{index} position"} #=> "Yo, Im Randy at the 0 position" However each.with_index is totally cooler because you get to determine where the index starts. This is actually useful as arrays start at 0 but as humans we start at 1. So as I’m obviously about to show you (I’m sure you already guess it) each.with_index will be like such some_array.each.with_index(1){ |element, index| puts "Yo, Im #{element} at the #{index} position"} #=> “Yo Im Randy at the 1 position” Better? Better because Its more human readable.


Meta_Post

After One month of being part of a bootcamp coding program I can say It if fully worth the cost of admission. I first got interested in a career in coding after a date with a woman who “Self taught herself” (redundancy for effect and lols) and after 4 years got hired. Yes, 4 years of self directed, self motivated work and a few community college classes later she had that great dream coding job. I was hesitant to attempt to spend 4 years but a coworker who was one semester shy of a software engineering degree (and changed to medicine last minute) told me to “Just code, don’t worry about how long it takes”. With that I started JavaScrippting. A year later I didn’t know what to do. I just looked online and I thought React was the most logical step. I built a custom play SPA(single page app) where you could type in anything and have it spit out how Trump would say it back on codepen.io. But It was taking so long and I felt like I didn’t know exaclty how to get better. So I finally decided to go back to school. These days just knowing how to code is probably better than the Degree. Now 30+ days in I’m almost as good as a Ruby developer as a JS developer. The deadlines, direction to follow, and assignments really get you to progress and get better. I am so excited and when I code and I get something working I absolutely LOVE it. I am so energize when my code works. This is mostly just a testimonial but yep…It was a great choice to just dive in and join the online Software program!


Chain it till you break it

Coming from a amature javaScripter, Ruby is amazing. It can do things that almost make it too easy. I am constantly learning things that make me think “Why are’t other languages this easy and helpful!”. Doing a lab here at Flatiron an instructor helped me do somehing I have’t seen anywhere thus far. It blew my mind so much I decided to 1) Name this blog after it and 2) write the first entry about it.