I'd like you to offer some examples of code that successfully documents its own
raison d'être - in a way that a comment couldn't do better - instead of repeating this 'crutch of poor developers' rhetoric.
I mean, I can write self documenting code without any comments, and it's perfectly understandable.
before_create :auto_increment
def auto_increment
self.count + 1
end
That code fails to tell the programmer
why it's in the application logic and not defined in the database schema. What should I do instead, so I can code without crutches?
def auto_increment_natural_key
self.count + 1
end
That's not a great deal better, it's still just saying what it does, not why it's there in the first place.
def auto_increment_natural_key_because_another_app_relies_on_it
self.count + 1
end
Is that it?
I mean, I can write self documenting code without any comments, and it's perfectly understandable.
That code fails to tell the programmer why it's in the application logic and not defined in the database schema. What should I do instead, so I can code without crutches? That's not a great deal better, it's still just saying what it does, not why it's there in the first place. Is that it?