Saturday, August 27, 2016

What I've been up to these days. (Technically Speaking)


Before I answer that question, I must tell you how I got into Computer Engineering in the first place.
Let's go back, way back, late nineties back, I was a young NCO in an infantry battalion in the U.S. Marines, I had these grand plans, I had all my life mapped out. My life goal then was to be the first Venezuelan born USMC General. For real. I had a few things that stood in the way, one, I was not a. U.S. citizen yet, and another minor thing, I didn't have a bachelor's degree, yet. So the plan was for me to get into the MECEP program, anyway, that's a whole other story, but for now I must tell you that back then I was planning on studying law. Yep, I wanted to have a law degree. This was before I totally understood what it meant to go to law school and pass a BAR and all of that. In any case, in the marines we were allowed to take college courses for free (yes, for free) as long as it didn't interfere with your mission, you could do it. You needed permission from the CO, but you could do it. So, I did, I took College Algebra, Intro to Sociology, Intro to Anthropology and Criminal Justice at Park College on board the USS Austin. I bet you didn't know that Navy ships had college courses, yes, we do, or did back when I was in. So in the Criminal Justice course I totally and completely lost my desire to study law. Our Justice system seemed, well, unfair. I just thought that I would be the world's lousiest lawyer. And frankly, I didn't want to go to school for that long.  I just wanted to get a degree so I could be on my way to OCS and become a Second Lieutenant in the Marine Corps, so school was more of a means to an end. Once I figured that I didn't want to be a lawyer I had to figure out what I was going to do. I took the aptitude exam and got Cop, FBI agent or CIA whatever, I thought the FBI was cool, but I knew in my heart that's not what I really want, that's when I picked up a career guide and saw that engineering was a well paid profession. Could I be an engineer? I thought, I remember my father told me that he started in Mechanical Engineering before dropping out and then going on to study accounting. I remembered how much I liked math, (I actually used to think that I was pretty damn good at math actually) and I also remembered how much I enjoyed programming my first computer, I used to have an old thing running Windows 3. I learned to write BASIC programs in 6th grade. This was the year 2000 and I was completely unaware of all the things going on in Silicon Valley at the time. But I had heard a lot of about Y2K and the .com bust. So I thought it would be cool to be a Computer Engineer, not Computer Scientist because I wanted the title "Engineer" it sounded so, well, professional, serious, rigorous. 

So back to my point, back in the day I thought that Computer Engineering was about building websites, I had effing clue what was coming. I learned about how processors worked, all the way down to the metal, literally. I learned about Circuits and about Discrete Mathematics and some programming in C, and some other neat stuff like Operating Systems and Networking. But I didn't learn anything about the web. I took a course on Network Security, and Cryptography, but I ended up doing an internship at a chip design team, and then I ended up doing embedded firmware after I graduated.

So finally, two years ago, I am in a team doing web services, that's what I've been up to. Yeah, I know it took a long time to get to this, so if you are still with me, thanks for reading (hi mom!)

So yeah, I am now finally doing something that I've been wanting to do for a while. I am doing Ruby on Rails for the most part. Although my team does a bit of everything, really.

In order to get better I've been reading "The Well-Grounded Rubyist" by Black Manning, hands down the best Ruby book I've read.

Another thing I've been working on is how to become a real-life hard-core algorist. For that I am slowly working my way through "The Algorithm Design Manual" by Steven Skiena.

I am still in Chapter 1.

The first chapter talks about the mindset of the algorist (a person skilled in the design of algorithms)
things like finding counter examples, proving correctness of an algorithm and proving things using mathematical induction.

Yeah, about that,

I've been stuck with the concept, yeah, back in school I did all the homework and passed the test back when I took Discrete Mathematics and Stochastic Systems. But, I feel like I just memorized how to work a family of contrived problems and I didn't really, like truly, deeply learned what proving by induction is all about. On the surface it still feels like magic. I mean, Induction seems kind of simple:

Suppose you want to prove that some property about any integer is true,  say, "n times (n+3) is always an even number" you first prove it for a base number 1, then you prove it that if it's true for then it is true for that base number plus 1 then it is true for all the numbers.

What I am still wrestling with is, how in the world do you know it is proven? How do you know you haven't made a mistake? The set of all natural integers is so freaking large, how do you know there isn't a counter case somewhere.

Obviously I still have some work to do. It may seem like this concept is so far removed from the practical world of actually building programs that do things that people find useful and valuable, but indeed it is very much related, here's why:

Induction is Recursion and Software is Recursion.

Yes, that's right, Recursion is just about doing the same step incrementally until you reach the base case. Most problems and algorithms in Software can be modeled as recursive objects.

Permutations? Recursive objects.
Sets and Subsets? Recursion
Graphs? Recursion
Trees? Are you kidding? Recursion
Strings? Delete one element from a string, what do you get? A smaller String. Strings are recursive objects.

So if you understand Induction, you understand recursion, if you understand recursion you know how to model most algorithms.