heavyliftingindustries projects and productions

2Dec/090

Refactoring Is Your Friend

After I took about thirty seconds to look at what I'd written for my Ruby script in the last post I realized I had over complicated a few things. I refactored it a little bit because it was bothering me that I'd been a bit more verbose than I really needed to be.

text = <<EOF
video_catpure_%03d.m2t
   scene:
   shot:
   take:

   performance:
   focus:
   technical:
   notes:

EOF

output_file = File.open('shot_log.txt', 'w')
1.upto(160) { |y| output_file.puts text % y }
output_file.close

So, what does this really have to do with writing and filmmaking. Not a lot but enough. There's always another way to do things. A cleaner method. A more elegant way of solving a problem. Options. We tend to be fairly myopic with our stories. Once we've figured out the path, once we've found something we like, it's difficult to see anything else.

While I haven't changed the end result of the script above I did make it easier to modify and maintain. If I do decide to make major changes it's going to go a lot more smoothly than with the previous version.

Tagged as: Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


No trackbacks yet.