My name is Mason Ellwood, and I’m currently working on Flatiron School’s Online Full Stack Web Development Program. Each week, I’ll be writing about my experience, what I’m learning, and tips on learning to code.
Last week I was reading on wired that the next big blue collar job was going to be coding. I did not really know what to think of this. At first glance, programming lost its luster of being an untapped needed career, making me (a programmer) replaceable. This has always been the case but the recent boom of programmers is scary when entering a profession, competing against some of the smartest people in the industry.
On Wednesday I went to meet up with my weekly trivia team, and a new guy came who was a “full stack” developer. He used that term loosely because of the “what the heck does that entail” title that holds. But he kind of reaffirmed my fear of the article and agreed. Sure he said but this is no different than any other career now. It seems like everyone is fighting to stay ahead of the curve and automate as many processes as they can. Because technology has become such a cornerstone for many companies, automating and maintenance surly would follow. But because of this the need for “maintenance” increases especially within the dev community.
He agreed with the article, but development turning into the lusterless career path is not true. The need for developers is greater now that it has ever been. Being apart of the growing community of developers is a great place to be right now. And the need for “you” in a company setting is only going to become more prevalent.
So picking up where we left off. Every method in Ruby must return a value. When we iterate or enumerate over a collection with #each, its return value is always the original constant. With this in mind, if we want to display the changed array values, dependent on what your method does, you may need to add an empty array ( new_array = [ ] ) to shovel ( << ) those values into.
There are many forms of #each, that can enact different outcomes. A few of the others are:
- #select => When you invoke #select on a collection, the return value will be a new array containing all the elements of the collection that causes the block to pass a return value as true.
- #detect/#find => #detect and #find can be used interchangeably. This will return only return the first element that makes the block true.
- #reject => #reject will return an array with the elements that return a false value
These listed above are all apart of the family of search enumerators whose purpose is to help you refine a collection to only matching elements.
A few that I use most often, I have found, is #each, #collect or #map (which are interchangeable), and each_with_index. A little more about enumerators can be found, and a quick reference that I have found very useful, is located here (http://ruby-doc.org/core-2.2.0/Enumerator.html). You will use these all the time, and I know how important this concept is. Locating and changing information based within your set of data is a key to programming. Essentially programming is the pushing and pulling of data and data manipulation. Being able to quickly and effectively iterate through data will increase your chances of landing a job, and becoming an officiant “blue collar worker” – as Wired so eloquently stated.
Leave a Reply