Now I'm commenting on both on interface class and implemented class.But sometimes, I feel it's unnecessary commenting both.So I want to hear from Pros which is a better way? commenting on both? or only on interface class?Example)/** * Google Analytics service interface */interface IGoogleAnalyticsService {     /**      * Track an event      *      * @param { string } category category-name      * @param { string } action action-name      * @param { string } label      * @param { number } value      */    trackEvent(category: string, action: string, label?: string, value?: number): void;}/** * Google Analytics service */class GoogleAnalyticsService implements IGoogleAnalyticsService {    /**     * Track an event     *     * @param { string } category category-name     * @param { string } action action-name     * @param { string } label     * @param { number } value     */    trackEvent(category: string, action: string, label: string = null, value: number = null) {        this.$window.ga.trackEvent(category, action, label, value);    }}
Comment on interface class and implemented class both? or interface class only?
coding style
It depends...I always comment both and the vast majority of the time the comments are identical.  PROs:When you dive into a concrete implementation that you didn't write it is nice to be able to get the context that the comments provide without running over to the interface. I am lazy and this saves me 2 seconds. CONs:Comment drift is real.  If your team isn't good about providing good meaningful comments and/or updating those comments then it can get out of hand very quickly.I have seen developers use comments to over explain concrete implementations.  Essentially the implementations start to become super functions over time.  Comments are then used instead of refactoring responsibilities.  The comments still provide value here but more as a warning sign.So it largely depends on the ability and discipline of the team.  If you actively refactor and comment well then I generally fall on the side of commenting everything.