having a separate method is better for testing. where attr_writer is just a metaprogramming class method to generate a method for you, not really any difference