Monthly Archives: July 2014

Strings vs Symbols

When you make a hash, for the keys do you use a symbol or a string? I always use a string, because I was never 100% sure what the difference was and I felt more comfortable with a string.

BUT, apparently a symbol can be better because it will save time and memory. So, here I am writing the differences down, so I remember it. I am using this highly rated answer from Stackoverflow.

Continue reading

Leave a reply

Gem Dependency Nightmares

As part of the Spree open source project I have been working on, I have encountered a more than usual number of Gem dependency issues. I put this down to the fact that Spree is a big huge project, with multiple engines, each with their own gemfile.

However, today I discovered it could also be because I have not been managing my gems effectively! I wrote a blog post on our Spree project blog, about how I should be managing my gems in the future.

Far out this is a short blog post.

Leave a reply

The Best Explanation of Recursion I’ve Found

In my recent efforts to find a junior dev job (Oh, maybe that could have used a blog post of it’s own: NEWS: I’m looking for a junior dev position), I had to work on a coding challenge which (I think) required recursion. But the thing is – recursion hurts my brain. I re-did all my Udacity lessons and watched endless videos about it on YouTube, but finally – the following stack overflow post is the best explanation of recursion I have found.

Enjoy at  it’s original location here (go on and give the awesome author some stars), or you can read it below (and if I’m not supposed to copy/paste it here, let me know).
Continue reading

Leave a reply

Gemfile vs Gemfile.lock

A bit of a clarification and reminder from an answer on Stack Overflow, as to what the difference is between Gemfile and Gemfile.lock:

The Gemfile is where you specify which gems you want to use, and lets you specify which versions.

The Gemfile.lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.lock and install the exact same versions, rather than just using the Gemfile and installing the most recent versions. (Running different versions on different machines could lead to broken tests, etc.) You shouldn’t ever have to directly edit the lock file.

Check out Bundler’s Purpose and Rationale, specifically the Checking Your Code into Version Control section.


Leave a reply