A moment of Reflection and a little Self Indulgence.

I do not consider myself a smart man, despite what everyone that has ever gotten to know me has told me. I would characterize myself as ‘reasonably competent‘ with a flare for the dramatic and occasionally a rare touch of genius (aka: madness). But definitely not smart.

I make to many mistakes. I have to many bad habits. I waste WAY TO MUCH time.

Having said that, I think today stands out as one of my moments of Madness. 😉

I think I have FINELY assimilated the concepts of reflection. As they exist in Ruby, that is.

Which is probably one of the easiest environments to do so.

15_0824aIt is a simple example, but exceptionally powerful. It is missing a few improvements, but the capture has already been immortalized in a tweet, so I figure I’ll immortalize it here as well.

It came about as I ruminated over the exploding collection of conditional variables I was being forced to pre-define for the Armor Actions section of my Armor script. I am not sure why I chose reflection, rather than simply pre-define a hand full of evaluated strings and walk away. It just sorta of felt right.

That and I think I needed a reason to practice it, as I work towards a more complete understanding of programming in general. I still have so many best practices to drill into my noggin…

Anyway. For what its worth.


Registered Users Can Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s