Sunday, January 12, 2014

Garbage Collection

I used to believe there was no difference between a software developer and a computer scientist, and when I read things online that said differently I chalked it up to people wanting to stroke there ego and just wanting to have a cooler sounding title.

I was wrong, recently I have been seeing the error of my ways more and more. I love the fact that I can make things using Ruby on Rails, and that Rails has all this magic that I don't understand. I also like the low barrier of knowledge required to start to make things, but I am also realizing that I don't know ANY computer science.

Take garbage collection in Ruby, sounds fairly boring till you read more about memory management and memory allocation and find that Ruby uses a mark and sweep method for garbage collection and that is one of the reasons Ruby can be slower in doing some things.

I am finding previously "boring" subjects are actually more interesting when you start to understand them and what they do little bit better. I guess the biggest difference between a programmer and a computer scientist is a programmer can use a language and a framework, to solve a problem. The computer scientist looks at the problem and decides which language or framework to use if any, while weighing out many factors and possible solutions that the average developer who just knows a certain framework or language would even consider.


The lesson I am slowing starting to understand is that I have about 300 years worth of learning to actually become a computer scientist and that is daunting as well as exciting. No longer do I just want to learn a specific language or framework.

By the way it's simple to see garbage collection at work in Ruby. Just type 'irb' and press enter into your terminal. Once irb is running, type ' GC.stat' to see garbage collection information. You can also run: 'GC.start' which will return nil, and then run ' GC.stat ' again and see the difference like this screenshot shows:




Yes, this could be boring, but I am actually finding it kind of cool to learn more and more things of what goes on under the hood. Keep coding peeps!

-Josh