Style Question

I’ve looked in the RubyStyleGuide on the Wiki, and I don’t
see this addressed. When initializing variables in classes,
is it more common to line up `=’ or just leave them alone?

I.e.,

class SomePerson
def initialize(name, age, birthdate)
@name = name
@age = age
@birthdate = birthdate
end
end

class SomePerson
def initialize(name, age, birthdate)
@name = name
@age = age
@birthdate = birthdate
end
end

I do alignment, too, but not for alignment’s sake. Basically like, all
shorts align here, all long align here…

eg.
@name = name
@age = age
@birthdate = birthdate

 @a_very_long_name_i_dont_know_why_i_hate_long_names = hehehe
 @a_very_long_name_i_dont_know_why_again 		   = argggh

btw, I like short names.

but I’m fond of comments, too -in fact, very strict on comments.
In production, I wont read code if it’s not properly commented/documented.
I hate calling the programmer and asking “what is the use of this
blahblah…”

I realize this isn’t of earthshattering importance, but it’s
something that’s been nagging at me for a while…

You sound like an artist. Relax :slight_smile:

Thanks,
Travis Whitton whitton@atlantic.net

kind regards -botp

···

Travis Whitton [mailto:whitton@atlantic.net] wrote: