Kitty Haircuts, Reading Code, and Structure 3
In keeping with my 2 post a week goal, here is a post. It may not be the post to end all posts, but it's a post nonetheless.
Today we took one of our cats to get a haircut. She's a long haired cat who often gets mats in her fur. This is the end result:

She is a bit groggy in this picture, but that's because of the stuff they used to sedate her. I was looking it up on the Internet, and apparently it's like PCP. So, I'm guessing it was probably really surreal for her to be walking around.
Aside from that, we also spent a lot of time with family today.
In the land of technology, I've been doing a lot of reading of code these days. I'm actually quite enjoying the process and it seems that the more I'm reading, the more I'm digesting, and the more my mind is understanding what's being done, as well as thinking of other ways something could be done. That growth is quite exciting.
I definitely miss coding in Ruby. There is a certain ease that comes with coding in the language. Yes, perl is a great language, and one that I'm growing to enjoy. I also want to dabble a bit in Python and expand my knowledge base even further.
I've also put together a list of things that I want to focus on. It's a mix of my 'weak points' as well as some things I'm just plain interested in. I'll be hammering away at things one at a time. (If I can... my attention span certainly wants to jump around quite a bit!)
I can't believe that I've been programming full-time for 8 1/2 months. It's still a passion and something I really enjoy doing.
In any case, I'm going to sign off now. I am also thinking that a 'regular' posting schedule might be a good idea. I definitely benefit from structure.
Transitioning Back to Perl
This week I've gotten back into writing, er maintaining, code that is written in perl. I've worked exclusively on Ruby and Rails projects for the last several months, never touching anything written in perl. I have to say - I never realized just how much Rails does for you and just how logical some of those conventions are.
I am excited about getting back into another language. I feel like I'm going to be learning perl all over again, though. This time with a bit of a different lens on my view. Ruby is a very elegant language in a lot of ways. Because I dabbled in Ruby on and off for a while before getting into it seriously, I feel as though it was really easy for me to get things done.
With Perl, I feel as though I'm walking on eggshells. Perhaps that's normal. Afterall, I don't know if I've even really touched anything in perl since last year. So, I've decided that I'm going to go through some of the exercises in my Learning Perl book, and get my feet wet again.
Being that I'm uncomfortable with the change, it tells me that it's probably a good one.
I should be committed
Early in my professional coding career (which at this point, is just over 8 months), I was told to commit early and commit often.
Originally I thought that this was just so that important work wouldn't be lost, should a computer crash - temporarily or long term. Eight months later, and I have a confession to make - I don't commit nearly as often as I should, and when I do, there's usually a long string of A's or M's and a bulky commit message.
In addition to my embarrassing confession, I also have a nice realization - committing isn't only for security's sake. I've found it to be a very nice precaution in helping to make sure that a certain change doesn't break shit. Nothing like wading through diffs and commit logs to figure out what the hell and when the hell you broke your app.
It also seems invaluable when it comes to making sure that if you had one iteration that was close to working, you can get it back relatively easily.
Of course, all this would be true for me if I made a more consistent habit out of committing.
When it comes to committing, I'm making a vow right here, right now, to become more committed. Yes, I'm committing to committing.
One of the things I used to say about being a 'baby programmer' was that I didn't have bad habits and could be molded quite well. And here I've been, getting into some bad habits. No more, I say. No more! Boo on you, Bad Habits. Boo on you.
And speaking of version control, I've been playing around with git this evening. I've also been messing around with mercurial.
Upcoming Post Topics
This last week or two has left me with plenty to blog about. I've been knee-deep in the bowels of code with ruby-debug as my trusty sidekick. The interesting thing, well, one of the interesting things, anyway, is that the more I end up debugging, the more it seems I learn. Which, is fucking annoying since debugging is a huge pain in the ass and nowhere near as fun as actually writing code is.
But, I've heard it said time and time again, that you learn things by reading other people's code... and well, when you're debugging other people's code, you're doing more than just reading it - you're getting inside of it and their brain, and figuring out how both their brain, and their code works.
Another upcoming post, should I ever find the time to write it, is about some of my philisophical notions about program, and how those thoughts are changing.
This 31 year old 'baby programmer' has formed some opinions about things and it's time to expound on some of the new and scary ideas that are forming in my brain.
In any case, Bells Oberon is back for the season. What does that mean? Winter is over. We may get some snow showers mixed with rain, and you can never count out an April snowstorm, but all I know is this - Bells Oberon. Is. Back.
Update...
9:54pm...
I just realized as I was tagging this post that my tags are: programming, opinions, and beer. That just struck me as wildly amusing. And no, I'm not intoxicated. :)
Diving Into Merb and Datamapper
This evening I did an update of the gems on my system, which included Merb and Datamapper. I'm really looking forward to exploring this technology.
In any case, it's late and morning comes around way too early. Even though I don't still keep 'geek-hours', my mind and body are naturally at their best after 10pm. Unfortunately, life doesn't always conform to one's natural hours. Therefore, I must take my happy ass to bed.
Look forward to some more posts this week.
I'm still here...
Really. I haven't gone away. I promise.
So, here's a quick rundown on things:
Ruby on Rails
Lately I've been doing the majority of my programming in Ruby and Rails. Things are becoming second nature for me and slowly but surely I'm getting self-confidence when it comes to "am I doing this right?" That's a great feeling to have.
I was discussing it with someone lately who was telling me that all I really need is the self-confidence. That's great to hear from an observer.
Linux
I've been trying to get a Linux install up and running on my P3-500 toybox. Unfortunately the CD-Rom drive is fubarred, so I've been taking the CD drive out of my main PC and putting it into the other system in order to get things working on it. I installed OpenSuse and immediately felt dirty. I need this as a Windows replacement box, so I wanted something relatively 'user-friendly'. I'm downloading Mint right now and we'll see how that works out.
Life in General
While spring is officially here, when I look out my window and see several feet of snow still on the ground, and when I walk outside into 7 degree weather first thing in the morning, I can't help but wonder if spring will ever really get here. I'm looking forward to the Summer - except for the bees, wasps, hornets, and other immensely frightening creatures. I can't wait to be back in shorts and t-shirts and flip flops. I love my Tevas.
Anyway, I hope to update more in the next couple of days or over the weekend. I'm posting this from Safari in Windows and every few moments I get the notification that a script is slow. So, enough is enough. It's harshing my mellow.
I like Ruby-Debug
I just wanted to say. I like ruby-debug. It made today a lot easier.
So, my salute for the day goes to you, ruby-debug. You make me happy.
Growth is Good (sometimes)
Growth feels good. Sometimes. Not always.
When one's ass grows, it doesn't feel good. Personal growth is sometimes painful. But growth when it comes to learning, knowledge, and understanding, though like personal growth can be painful, it can also feel really damn good.
Today my entire day was spent refactoring, testing, and working with Capistrano. I also had a nice discussion about has_and_belongs_to_many and has_many through... I didn't have one moment where I was drowning in confusion, or where I wanted to hang up the computer and invest in a hot dog cart as a new line of business. No, I don't have those hot dog cart days very often, but every once in a while, they come up.
In any case, today was lovely. Yes, lovely, I feel like I'm getting a lot more comfortable with developing, reading code and understanding what I'm reading... It's a great feeling. To wax poetic, it feels like I've been walking around with blinders on, and slowly but surely, they are falling away. I'm beginning to see more things.
And now, I raise my glass of Diet Cherry Coca-Cola and make a toast - to growth - the painful and the comfortable. Because if I'm learning, I'm growing, and if I'm growing, I'm happy (as long as it's not my ass that's doing the growing).
Damn
I've made it through a day of not smoking. I'm walking around in a perpetually pissed off place. I keep telling myself I only have to make it until Friday for this 'stint'. Good times. I didn't have any coffee today, either. Just green tea. No coffee. Ack.
In other areas, I've been going through my book on Conceptual Database Design. Someone whose technical knowledge and opinion I hold high regard for, recommended a couple of books to me. I've been reading one of them and I've found that mind-mapping while reading a book such as this, is a great way to reinforce the material.
I don't always retain what I read as much as I'd like and when I do, it's normally because I take notes while reading. Last night I tried mind-mapping for the first time and it really helped me.
So, why am I interested in database design? Everything that I program, whether writing or maintenance programming, deals with databases. I feel like in order for me to really be effective at designing a web-based application, I need to have a solid grasp of database design. It's not enough for me just to have a shallow understanding of how things could possibly work together. I need to know theory. I like theory.
In any case, I was going through an introduction to the Entity Relationship Model, and where the book was discussing what determines a one-to-many, one-to-one, many-to-many relationship, the light bulb came on and it really made a lot of sense. The language in the book is very 'meaty' so it's not something I can just read through on a whim. It requires some concentration.
I'm just excited about the prospect of securing a better foundation with these concepts.
note: I've gone through and edited this post 3 times. My sentence structure and grammar is crap. I'm tired and nicotine-deprived. I shall put the keyboard down before I drive myself even more insane.
I Did Had a Stoopid Day
My logic hurts.
Do you ever have one of those days where you end up feeling as though your capacity to learn anything is completely fucked? I had one of those days today. Okay, not the entire day, but a couple of hours.
It started out as a productive day - I was strolling through commit logs and code. I even narrowed down the culprit on an issue that I have been fighting with for days weeks. I sat with a huge grin on my face, a product of figuring baffling stuff out. It was lovely.
And then it happened. As I looked through jQuery code, javascript, and Ruby, my brain started to melt. My eyes glazed over and all of a sudden, I felt as though I had the IQ of a guitar pick (or a wooden ruler, I haven't quite decided yet).
I went through a few jQuery tutorials, thinking that it was my own 'fear of the unknown' that kept me from grasping that which I needed to wrap my skull around. After a couple of hours spent back and forth between reading docs, reading code, and drooling uncontrollably, I finally felt the lightbulb turn back on. Yay, lightbulb!
Of course, by that time, the day was over. So, I stuck around a few extra minutes, quickly wrote all of my thoughts down as to make sure they didn't leave or that my stoopidety didn't return. Tomorrow I'll get back into the grind and try again.
See, I'm one of those people who have always had an incredibly easy time learning things, especially when it's of a technological nature. I picked up a great deal of Linux commands watching over a friend's shoulder eight (8) years ago. When I can't learn something really damn fast, I get really impatient. So, hopefully tomorrow I can approach this with a fresh mind and a new surplus of patience.
A Baby-Programmer's Opinions on Coding - Part I 2
A strange thing is happening to me. Really.
As I've been coding regularly now for several months, I'm starting to notice something: I'm getting opinions. That's right, I'm a baby-programmer with opinions.
So far I have an opinion on one aspect of coding. Well, I have more, but I'm only going to put one out there. And that is...
Please, please, please - put comments in your code. Please. If someone is going to read your code later on, which may happen, please put comments in there. While I agree that good code should document itself, there is no reason not to put comments in there. Should a baby-programmer like myself come along at some point and need to work on the code you've written, it would be very helpful to find some comments. Granted, I know the satisfaction that comes from hours upon frustrating hours of going through uncommented code, only to finally connect the dots and see wtf is going on in there. BUT, c'mon... Is it that hard to hit the # key and write a few words?
I've read through Rails' ActiveRecord documentation. TONS OF FRIGGIN' COMMENTS. I LOVE it. Seriously. I enjoyed reading the code and its accompanying documentation. It inspired me. It gave me ideas on how to do things differently. I experimented in irb/Rails Console with new things and ya know what happened? I learned. And it was good.
So, please, for this baby-programmer and any others who may follow me - put some commentation in thy code. Really.
Happy New Year - 2008!
Happy New Year.
I have to admit it. I'm thrilled that the holiday season is over. While I adore spending time with family and friends, eating wonderful food, and engaging in great conversation, the amount of pressure and just plain business that comes along with the season can be overwhelming.
My Holiday Soap Box
This year I was particularly bothered by the blatant consumerism of advertising everywhere I turned. Everytime I watched television, I was informed that every kiss begins with Kay or that I should have gone to Jared in order to make the person that I love happy. C'mon. Really.
When I was a child, I enjoyed the receiving of gifts. What typical kid doesn't? But, for some reason, even though my family gatherings weren't large and plentiful, it wasn't all about gifts for me. Many of my holiday gatherings were spent with close friends of the family. We exchanged a gift or two, but the most memorable parts of the event, consisted of laughter, food, and hugs. That was the big deal. While I used to circle toys that I wanted in Toys 'R Us circulars, I loved the holidays because of being around the people.
I wonder if kids today (oh, God - Did I REALLY just say that?) have the same experiences, or if it's just really all about the toys, Santa, and getting the latest cool thing. When the time comes for me and my partner to have children, I certainly hope that we can instill the values regarding the holidays that we grew up with - that holiday values aren't synonymous with consumerism and having meaningful interactions with loved ones is often the biggest gift that can be both given and received. I hope that we'll create special traditions that they will pass down with their own families when the time comes.
Looking Forward - Hopes and Goals for 2008
So, enough of my soapbox. In my last post, I said I'd spare the soapbox, but it's something that has been bothering me for well over a month now. In any case, I'd like to talk about my hopes and goals for this brand spankin' New Year.
Professionally, I'd like to sharpen my programming skills. Just yesterday I was reviewing some code with my Manager who told me that I've 'leveled up'. The majority of my recent coding has been in Ruby. I was pretty stoked yesterday when I sat down in my editor, opened up a method declaration and just started writing. I'd like to have many more of those coding-with-ease moments this year. To help further that goal, I've registered over at http://rubylearning.org for the free Ruby course. Even though I pretty much use Ruby on a daily basis, I'd like to close some gaps in my knowledge. The course teaches Core and some Advanced Ruby. I'm hoping that this will make my knowledge base less bumpy.
Personally, I'd like to concentrate on having a more healthy year than I had last year. This encompasses several areas and several goals:
- Quitting Smoking - I was down to about 2 cigarettes a day, which grew to 4 cigarettes a day, which is now at around 1/2 a pack per day. With the amount of heart disease that runs in my family, along with the desire to have kiddos eventually, I really have no business whatsoever smoking. I'll be bold here - I'm setting my quit date for January 19. Now that I'm accountable to all 5 of you, hopefully I can stick with it. :) While I don't want to say, "I'm never having a cigarette again," I'd really only like to smoke every now and again, such as when going out with other smokers to a bar or something of that nature. Not on an everyday or even several times a week basis.
- Losing Weight - While I'm by no means a bovine, I am not in the same shape that I was just a few years ago. Also, while I don't expect to be the same 125lbs that I was at 21 years old, where I'm at now just isn't acceptable. I would like to at least be where I was at the age of 27 - 28. This will require a loss of about 30 - 35 lbs. If I can lose 2 pounds per week, I can be where I want between the end of March to Mid April. Ideally, I'd like to be less than that, which should be completely doable at a rate of 2 pounds per week by the end of June. Again, with heart disease and diabetes prevelant in my family, I have to be mindful. Which brings me to my next goal which is...
- Exercising More - I'll admit it. I'm a computer geek. I'm a nerd. While I'm not the most uncoordinated being I know, I'm also not the most athletic. My partner M can pick up any sport she's introduced to and if not excel, at least maintain an average skill. Me? Not so much. I don't love to exercise. I would rather spend an hour reading a book or tinkering with my computer than taking a walk outside. But, I am going to commit to at least 30 minutes of exercises at least 3 times a week, and this winter, snowshoe at least once or twice a month. I also have the ability to go cross-country skiing, which I tried last year and loved. So, once or twice a month on that one, too.
I do have some other goals, some of which will remain in my own private offline journal. I normally keep the 'personal/emotional' stuff off of this platform, but hell, there are some things I want to do and sometimes putting it out there for others to see is a good way to make sure you do it. After all, I'm a Leo and don't like to be embarassed. :)
My Wishes for 2008
- I wish for world peace. While that's not likely to happen anytime soon, it would be a nice thing. And, maybe if enough of us wish for world peace, one day it will happen.
- I wish for safety for our soldiers.
- I wish for health and happiness for all of my loved ones. Actually, I wish it for everyone, really.
- I wish for positive changes in the economy.
- I wish for positive growth when it comes to the things we can do regarding global warming.
Finally, may the New Year find you happy and healthy.
Here's to a great 2008! (excuse the rhyme. really.)
My adventures with acts_as_paranoid and Rails 2
Who's paranoid? Me? Never... Are you saying I'm paranoid? What makes you think I'm paranoid? Am I doing something to make you think I'm paranoid... Maybe you're paranoid... er...
Okay, so I'm not necessarily paranoid (or am I?) but, I have been dealing with an application that is. How is my application paranoid? It uses the Rails plugin, acts_as_paranoid. In dealing with this application, the need has come along to undelete some of the deleted data. The beauty of acts_as_paranoid is that when you utilize the plugin in a Rails application, your data isn't really deleted. In each table, you add a nice little column with the name of deleted_at, and when you delete something, rather than destroying the record, it puts a timestamp in that field on whatever row you deleted. It also follows the chain of relationships.
After reading up on the plugin and spending days wading around code, I learned that acts_as_paranoid also overrides the Find methods in ActiveRecord. The one feature that I really wish it did have, however, was a restore or undelete feature. Perhaps I'm utilizing it wrong - there's a great chance that is the case, however, given the number of has many relationships I have going on in my database, I'm really struggling with undeleting things.
In the meantime, I've been looking at other plugins such as acts_as_trashable, acts_as_restorable, and a plugin that deals with scope. Some of the other plugins serialize and move data to another table, but I'm not completely comfortable with the idea of moving data. What happens if something happens in the midst of that move? It just makes me a little uneasy. Call me a control freak. I won't be offended.
So, I've got to contemplate how I want to deal with the conundrum on my hands. I have the need to show all records, and be able to undelete records that are deleted.
If any of you who read this blog happen to have this type of experience with Ruby on Rails and the acts_as_paranoid plugin, I'd love your comments.
And with that, I am off... more coding, more fun.
What a Long Strange Trip it's Been
I was looking back and reading an older post that I wrote just a little over 9 months ago. In the post, I wax half poetic, half dramatic, about hitting the proverbial Wall of Dumbfoundedness.
To those who don't feel like reading the post, the story goes a little something like this:
I was starting on a Rails project after messing around with a few tutorials. I made a 20-some column table (normalization? who needs normalization?) to hold all of my 'stuff'. I wasn't sure how to populate the table. I wondered if I should have made more tables to hold my data.
So, moving on to today, which is 9 months and 2 weeks later, I can say to myself, "Of course you should have created more tables." Of course, sometimes there can be a use for a 20 column table (I'd imagine) but when you're dealing with data the way I intended on dealing with data, putting all of it into one table isn't the way to go. I would've had massive amounts of duplicate data. Which makes me wonder, "How many times can I use the word data in one paragraph?"
In any case, it's a good feeling to look back on yourself and see that you've grown. Today I was working with some Ruby code trying to figure something out. Something that would've taken me days to figure out a few weeks or a couple of months ago only took me a few hours to figure out. Again, it's just a great feeling.
Hopefully at some point I"ll be able to write more interesting posts regarding little things I find in Ruby, Rails, or Perl. All I can say to myself at this juncture is: "20 columns? 20 columns?"
What a long strange trip it's been. (ok, so nine months ain't all that long. Unless you're a pregnant woman, in which case, nine months is probably one hell of a long time.)
Unit Testing: Perl & Ruby on Rails
Going back to my last post – I finally settled on using Test::Unit. I already had my code written, but my test code ended up being twice, yes, twice as long as my actual code.
I got a lot of help with logic from reading parts of Intermediate Perl. After looking back over the last few months of the journey that has been learning perl, I’ve realized that some ‘grokking’ really comes with experience and doing. After coding for a couple of months, I can happily say that the book makes a lot more sense to me now than it did back in September.
Switching Gears
Currently, I’m focusing on Ruby on Rails. With that endeavor, I’m also looking at the concepts that go along with writing test code before and during the coding process. Whether it’s TDD (Test Driven Development) or not, I’m not quite sure, however, after my first experience with testing taking place after I had written the code, it’s definitely an adjustment to attempt writing tests before writing code. That and the syntax, while similar, is a bit different, so I need to get my head wrapped around that.
Luckily I’m quite familiar with pure Ruby and Rails. Perl was a completely new animal aside from editing a couple of pre-made scripts throughout the year.
So, at this point in time, I’m focused on the following:
- learning about writing unit tests before writing code.
- getting a greater understanding of the testing syntax in ruby.
- something not mentioned in the prior paragraph(s) – learning how much validation I need to put in my rails models.
Oh, and one more thing before I catch up on some reading – I watched a screencast put out by RailsEnvy. The screencast was a tutorial on Active Record/ActiveRecord. It helped immensely.
Object Oriented Perl - Another Way of Thinking
I’ve still been on the windy road of learning perl. In the last several weeks, I’ve gotten more comfortable with complex data structures and dereferencing.
The first several weeks of my perl endeavors were spent reading mass quantities of perl books and attempting to process all that I had read. I’ve noticed that as I go back to books for reference, there are several things that make me say, “Oh yeah, that’s right – I remember that.”
I suppose I was a little naive to think that I’d actually retain everything that I read.
Meanwhile, the latest turn on my road to learning perl has had me navigating that which is Object Oriented Perl. While my prior (short) endeavor in Java, and my more extensive endeavors in Ruby made me familiar and comfortable with the concepts that go along with Object Oriented programming, there is still a sense of disorientation when dealing with objects.
Sure, they make sense when it comes to run-of-the-mill things that I might encounter in the real world. It isn’t difficult at all to imagine a Class called Animal, with a Dog, a Cat, and even a Monkey. Sure, I can imagine that a Dog might have a method of bark, fetch, or swim. It’s easy to imagine a Cat having a method of meow, purr, or snuggle. I can even imagine the Monkey having a method of swing, smile, or eat. (Monkey->eat(banana) of course). I can even go as far as to understand that some of these actions might be common enough to implement a single method in Animal, as opposed to an individual one that does the same thing in each Animal’s Class.
But, when it comes to other things, like the things you’d really use programming for, that’s where the thinking changes.
A year ago, I took a Programming Logic & Design class at my local community college. While the class glossed over Object Oriented programming concepts, it mostly covered procedural programming.
Well, procedural and object oriented programming are different. I find that where I might write something procedurally to go from step A to step Z in many lines of code, when it comes to Object Orientation, my current impression is that one doesn’t want too much going on in any one method. It would also seem that one wouldn’t want to duplicate efforts.
If I have a House Class, with:
House::Basement
House::Garage
House::Bathroom
House::Bedroom
Each of these need to be cleaned. I wouldn’t implement a clean method throughout each room such as:
House::Basement->clean;
House::Garage->clean;
etc., etc., etc.
I’d want my clean method in the House class.
So, again, I can grok the concepts of Classes and Objects and Methods – I think at this point, it’s just a matter of changing my thinking from (excuse the awful concepts below):
my $bathroom;
if ($bathroom = 'messy') {
clean it
} else {
print "Woo! A clean bathroom!"
}
to:
my $bathroom = House::Room->new;
$bathroom->clean if $bathroom = 'messy';
Anyway, I feel like I’ve come a long way from where I was just a mere 2 months ago.
And with that, I’m off.emacs, color themes, and other various ramblings
One of the things I liked about vim when I was using it was the wealth of color-schemes that were available. I've been using emacs and I'm getting really used to it, and while there are some great color themes available, I'd like to have a wider variety.
I've looked to see if I could find something that would convert vim colors to emacs colors, thinking that there had to be someone out there who has thought about this before. My search on the web has come up nil. I can't find anything to do the trick. Perhaps at some point, I'll embark on that endeavor. I ran into a similar situation when I was experimenting with Komodo Edit - there aren't a wealth of color-schemes out there at this point in time.
Meanwhile, in programming project land, I've gotten my learning project database schema pretty much ironed out. I was speaking with my Perl mentor about the project and was given a different perspective in relation to objects and storing data. When we were discussing about storing certain things in a hash reference, I was actually right there understanding what he was talking about. So, I think I'm on the right track.
Back in MySQL database land, I have been studying the fine art of normalization. It's interesting to see how you can classify data into categories of sorts, and eliminate redudant redundancies. :) At this point, the method to my madness when it comes to designing databases, is built around making as many tables as necessary. If I have something and I'm not sure if it deserves its own table or should go into another existing table, I'll give it its own table anyway. That eliminates the hemming and the hawing (where the hell did I pull THAT term out of?). If I do that, I don't get stuck and when I've gotten everything into tables, I can take a step back and reconsider if I'm duplicating information or if I can consolidate. All in all, I'm getting it, and that getting it feeling is fanfrickintastic.
Another thing that feels fanfrickintastic is knowing that the Detroit Lions are 3-1 right now, 2nd in the division. That's right. We've got a winning record. Hell, even my Florida State Seminoles have a winning record right now.
Anyway, it's time for me to get some much needed downtime. I'm finally starting to feel better after being sick for two weeks. I still have a lingering cough, but all in all, I'm feeling worlds better.
Iterating over Arrays of Arrays and Hashes of Arrays
I'm back to that lovely state of annoyance that comes with trying to deal with data structures in perl.
Yes, that's right, I'm lost again. Actually, I feel like I'm in the middle of the forest, the path is clearly marked, but I poked myself in the eye with a branch and I can't see my way out.
I'm currently in a terminal where I have just hit enter on 'perldoc perldsc'.
For one, I think I forgot that you can't have a true array of arrays, and that it's really just an array of array references. While that doesn't solve my issue (yet), it does make me happy that the, "Oh Yeah, I remember that!" lightbulb went on.
What I'm trying to do is iterate over this array of array references.
I've tried iterating over a hash of arrays, and then I put my data into an array of arrays instead.
I keep getting faced with things telling me that I cannot use a string as an ARRAY ref while in strict mode.
I tell ya – these are major thorns in my side. Although, each time that I struggle with this, when I finally get it, it seems so damn easy and obvious that I wonder how I could've missed it.
Anyway, I'm back off to battle with this. Wish me luck!
(Oh, and if anyone has any additional resources in addition to Learning Perl and the Perl Docs, please point me in the right direction! I've been reading at perlmonks, too)
I've stepped into the land of emacs.
While I was originally going to post a relatively pensive post on how much it sucks that time goes faster the older you get, I decided to post on technological stuff instead, sparing my 5 readers the agony of reading a post filled with Gen-X angst. :) So, now onto my latest adventures in technology.
- Emacs – I've been dabbling with emacs as of late. I really like it. I was using vim, which is awesome in its own regard, but the key bindings of emacs just seem more natural to me. I'm sure I could pimp out vim to have emacs key bindings (I know I can, there's stuff to do that with), but I like emacs. So, we'll see. It's a process, I suppose, finding just the right editor. I love Komodo Edit, but sometimes I'm at the command line looking at stuff and it's just more convenient to go into emacs or vim. Anyway, I like it a lot. I have done some customization and we'll see how the next week or two goes with it.
- MySQL and Relational Databases – I've been reading up about schema design and MySQL. Let me just say, while my last post discussed my fascination with relationships and databases, that said fascination does not extend into reading about relational database theory. Really. I know there are whole books about it, but just point me in the direction of a good 10 page best practices "do this, don't do that" pamphlet and I'll be good. But, all in all, I'm getting a stronger understanding of how things fit together and how relationships work.
Perl and MySQL: Philosophy and Geekery
I spent much of this weekend thinking about programming and databases. While I find all of it very interesting, it didn't make for the most relaxing weekend.
I'm fascinated by database relationships. Okay, so maybe fascinated isn't exactly the right word. I just find the complexities of relationships very interesting. How you can have a simple structure or you can make things really damn complicated. (Much like human relationships, really).
If you get too deep or too granular, you can have a big ol' complicated mess. If you don't get deep or granular enough, you may not have the amount of substance that you really need for things to work the way they should.
As for programming, I think I'm really drawn to that because it is structured and it makes sense. Okay, so not all of it makes sense, especially at this point in time, however, it is purely logical and has a structure. Even in languages such as perl where there is more than one way to do things, there is structure. If you leave the confines of that structure, you're going to have issues.
Life can be like that, as well. If one doesn't have any structure or logic in their life, it is probable that one will have issues. Unfortunately, life, unlike languages such as perl, doesn't offer things like, "use warnings" and "use diagnostics" to let you know when you're making a huge mistake.
While I don't consider myself the most structured person in the world, I also don't consider myself the most chaotic. In certain areas of my life, I have a great deal of structure. In others, well, not so much.
That is where the beauty of balance steps in. To live in one extreme, where life is so structured that there is no room for the creative genius that is sparked from chaos, is stifling. However, to live in the other extreme where life is so full of chaos that there is no order and no semblance of rationale or logic, can be stifling, too. With a life of balance, there is just the right amount of order and just the right amount of chaos. My life isn't always what I'd call balanced. However, balance is something I strive for.
I find it interesting why some people are drawn to technology and the fields that they are in.
The above points aren't the only reasons I'm drawn to programming and technology. I like figuring things out and I love being creative. With programming, I can be creative and figure things out, all while using logic and analysis. The same goes with technology – I get to figure things out and new technology is just friggin' cool. What can I say?
So, my question to you:
What draws you to your field?
I'd love to hear your answers.