But I thought Code was only for geniuses?
By: John Hill
Tags: Starting Over, Flatiron School, Ruby

I was at a job; let’s not get it wrong it was a good job but at the end of the it was just that a job to make ends meet and nothing more. I had no pleasure in it and really every day let’s be honest i dreaded going to work everyday and I wanted a change. I wanted to go into IT work and I wanted to go into coding; but isn’t it only for the geniuses?

No more excuses

Just like that we started an easy piece of code. Yeah it doesn’t look like much but this code right here every time you call it will put out to the console “No more excuses, lets go!”. Did that take a genius to figure out? Just like that we know how to put something out.

Now I can add

Now yes this still isn’t much but its a start. Here you create a variable easy and put a simple math problem to it 1+1. What do you think it puts and whats up with return? If you guessed it puts 1+1 you are wrong it actually is gonna do the math for you a puts 2. Why did we put the return though? I put it there to give simple_addition a return value. Why because puts doesn’t have a return value and for this example I wanted to put the answer out and have a return value.

Ok, maybe its not only for geniuses but your average person can’t do it can they?

Well, define you average person. I personally have never went to college, yeah I joined the military but as I view it your average person could be in the military. I have spent the past 5 years working in a warehouse. So how am I able to do this if it’s only for geniuses and extremely smart people? I am your average person. I can do it because I put in the work and honestly as long as you start with the building blocks and the right language it can evolve from there. You just have to be willing to put in the work and be willing to learn.

Just pick

Hold up language, I thought we were talking about coding? That’s true we are and there are many different languages out there. They are just that though, languages. There are multiple languages and each one has their nuisances. Some are easy to learn and some are slightly harder to learn. As long as you start from the begin though everything you start to learn builds on itself. The one I have used in the pictures here are Ruby but there are many out there. I will continue today talking about Ruby though.

As you can see this is why I’m picking Ruby to start with. They tell you that Ruby wants to be simplistic, productive, and easy to read and write. Whoa, what about the code to the right it looks a-lot more complicate than the one’s I have shown you before right? Is it really though if we break it down? First things first, we start out defining Greeter as a class. So what do you think the next line is doing? Exactly what it looks like it is initializing the class Greeter. How? By taking in a name and setting it as an instance variable and capitalizing it. Honestly if you look at that other then maybe not knowing what @name means that’s exactly how it reads.

Reading this what do you think is happening next? Obviously it put’s out “Hello” but whats up with that #{@name}. Remember that instance variable we saved earlier #{} allows you to call it. If you didn’t have that there and just had puts “Hello @name” it would do just that and put out “Hello @name”. the #{} allows you to pass in the variable you saved earlier.

“Hello World!”

So now where do you think we went from there we set g =(equal to) Greeter(the class we defined) .new(here we are creating a new instance of greeter) (“world)- now we have set what we called name earlier as world in this instance. Now what about g.salute. We know g is equal to our instance of world now if we look at the salute method from earlier we know its going to puts out “Hello world!” why because in g we defined @name as world. Similarly if we would set y = Greeter.new(“you”). Then call y.salute it would put out “Hello you!”.

As you can see you don’t need to be a genius to be able to code. You do need to have to be interested and want to know how to code. You do need to put in the work and try. But whether you are a genius, extremely smart or just your average joe you can learn to code. If you’re like me then you will love it and be willing to put in the work. So what are you waiting for?