Less code is not necessarily more readable (and it's often less maintainable). I much prefer
draw(Rectangle rect, Point point)over
draw(rect, point)Notwithstanding the fact that the former enables automatic refactoring and easy browsing while hardly anything can be deduced from the latter.
a comment by Cedric Beust on his Continuous Tax
Read the examples carefully for a moment. Do you notice anything amusing? I'll give you a hint. How much more maintainable would the first example be with only one simple change?
draw(Rectangle rectangle, Point point)
There. That's much much better better. It almost doesn't need a comment.
Actually... (Score:1)
Re: (Score:2)
Re: (Score:1)
You must be a Perl hacker. The compiler can't enforce and your IDE can't infer anything about
rectangleorpoint. What if someone accidentally passed in aBouncyBall? It's like the end of Watchmen all over again.Re: (Score:1)
Re: (Score:1)
Re: (Score:1)
Smalltalk had an IDE? It's impossible to write an IDE for a dynamic language! Now Eclipse, that's an IDE.
(Before anyone responds, ask yourself "Hey, why did he mention Eclipse and Smalltalk together?")