https://www.youtube.com/watch?v=TvYcuuTS5Hg

https://www.youtube.com/watch?v=TvYcuuTS5Hg
https://www.youtube.com/watch?v=TvYcuuTS5Hg

Comments

  1. Yeah, but it seems neater when you write it like that for me.

    ReplyDelete
  2. +Stefan Glienke I'm with you in general. But why do we repeat parameter lists of non overloaded methods in their implementations? That also violates the DRY principle. I'm asking myself this question from time to time: Wouldn't it be cleaner to omit parameter lists in non overloaded method implementations? If the answer is "no" then why don't we want to repeat the overload keyword?

    ReplyDelete
  3. Christopher Wosinski Which you can do. However due to the nature of a Delphi unit you would have to go to the interface part of the unit all the time to see the parameters. Seeing them when reading the method is kinda important while the fact if this method is overloaded is not in this context.

    And this redundancy is also one of the cases I mentioned in another comment to Nicks blog article - you need some kind of IDE support to sync those two places in a unit when you change a method signature.

    What I usually go with because it's the least pain is to write code as the IDE code completion does it. It adds parameter list but no method modifiers (overload, virtual, ...) to the implementation section.

    ReplyDelete

Post a Comment