• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Code reviews

"favour composition over inheritance" but It is better that people are told just not to do it, it usually ends up a mess and adds only trouble. I would say most modern frameworks have all but stopped using inheritance as a means of integration.
Being told not to do it is just plain daft, when nearly every class in the Java libraries inherits from something (if it is Java we're talking). Probably "if you're not sure, composite" is better advice.
 
How about 'use inheritance when it is appropriate and use composition when it is appropriate'?
 
How about 'use inheritance when it is appropriate and use composition when it is appropriate'?

but that means you have to think. We want a simple answer which doesn't require thinking that we can take the mickey out of...
 
but that means you have to think. We want a simple answer which doesn't require thinking that we can take the mickey out of...

Sorry, wrong forum.

I meant that you should always inherit from a bass class and also add the base class as a member or you are clearly a cretin who should not be allowed near a keyboard - and NO! I don't care if you language does not support inheritance.
 
As we're on the topic of tulipy code and maintenance, etc - here's a gem of a javadoc for a class I just came across:

/**
* Retrieves disputed payments. Inaccurately named, since it is both
* used by the ixxxxxxxx and the xxxxxxxxx!
*
* @author xxxxxxxx
*/


Why don't people fix mistakes when they see them?!
 
As we're on the topic of tulipy code and maintenance, etc - here's a gem of a javadoc for a class I just came across:

/**
* Retrieves disputed payments. Inaccurately named, since it is both
* used by the ixxxxxxxx and the xxxxxxxxx!
*
* @author xxxxxxxx
*/


Why don't people fix mistakes when they see them?!

I would fix more but beating people to death is illegal
 
Last edited: 14:02

Advertisers

Back
Top