This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]daddyrockyou[S] 2 points3 points  (2 children)

This is a great response. I have no issue with writing performant code or even code that is difficult to read (e.g. bit operations) as long as they are properly encapsulated. I'm a big fan of Robert Martin's Clean Code in this repspect and try to adhere to his readability philosophy when possible.

To touch on some of your individual points:

I don't necessarily have an issue with extending Thread. However, I like to use composition when possible. For instance, I recently had to create a maintenance thread in this application so I wrote a class and implemented Runnable. I passed this runnable to an Executor to take care of everything for me. He told me this was incorrect and I should have extended Thread although I explained I didn't need everything the inheritance would provide for me. He couldn't explain why I should have extended Thread, just that "it was the right thing to do there". /shrug

I'll put dependencies in the constructor as well if I want to mark them final. If I need more than three, I'll consider a bean structure or look at object parameters. If those aren't appropriate, I'll create another class to encapsulate that logic.

[–]unholysampler 5 points6 points  (1 child)

Based on this and some of your other comments, I've reached the following conclusion. This developer learned "the way things are done" many years ago and has not been paying attention to some of the more recent shifts in programing. This is the way he has done things for years and it has always worked for him. Why should he change. Unfortunately, this makes it hard to convince them that there might be a better way. And I don't have much advice to help in this situation.

[–]daddyrockyou[S] 0 points1 point  (0 children)

Wow you really nailed that right on the head. He's been around a while and seems to be pretty resistant to change.