How Much Cohesion Is Enough?

Which one is better: books.del(42) or books.book(42).del()? I do both and I rarely can tell which one is better. The first option is shorter, while the second one is more object-oriented. The first option is more difficult to extend, while the second one is more verbose and requires more lines of code, which means a higher chance of making mistakes. Which one do you prefer?

[image error]Irr��versible (2002) by Gaspar No��

Either one will work, of course, but the question is which design is more object-oriented? It seems to depend on the size of the...

 •  0 comments  •  flag
Share on Twitter
Published on November 18, 2019 16:00
No comments have been added yet.