Contribution

Definitions

By definition To Contribute means to give something, or to take a part of to do something. When it comes to works, I believe that to contribute means to give away something related to work, without getting ordered to do so. It could probably means that someone in your team ask you to do something and you help, or to come up with something even if no one ask you to.

To contribute, is not about when you’re ordered to do something, or do something that’s part of your duty. In this sense it’s more like fulfilling your duty instead. You’ve got paid to work.

So why people contribute to their work ?

I believe that people contribute because they get something back in return, but not in a sense of getting paid or benefits. People help out each others because they value their relationships, and that what they get they tighten their relationships.

When it come to contribution that made with no one requested, I believe that they value their company. They want the company to sustain, so they can make a stable income. But that’s only a part of it. Sometime people contribute to their work because they find obstacle in their day-to-day job. He wants to get the issue fix, but without showing how could it fixed and the outcome people around him wouldn’t recognize how exactly the issue is a problem. Ultimately the results of contribution returns to those who contributes. It makes jobs easier for them.

Also you have to come up with a concrete thing, contributing ideas does not go very far. If you have ideas about tools, try making working prototypes and show people.

Larger picture

When someone is trying to contribute something, especially when he’s not asked to do so, it’s important to look at what it is aimed for. It might be much larger problem than the contribution targets to. You might see that there are problems in the process, tools, workflows, etc. that cause burden to your team, then come up with a solution. Take the contribution as a starter point, and start tackling the problem bit-by-bit until it get resolved. Also make sure to give credits to the contributors.

Contribute or not contribute

I strongly believe that contributing to works is important, and it’s valuable to myself. There are some benefit apart from solving the problem. Of cause your problem will get ease because of thing you do (however sometime you have to push to get it shared among people for the best benefit). You learn something outside of your day-to-day job, and that can be something that changes your career path.

However contribution can be very hard sometime. People does not recognize what you try to push as a contribution. In fact, they might see it as a burden. Many people just enjoy the way they are, they can leave with a problem (and a lot of complaints), they don’t want it to get fixed as they might loose their job. etc. The worse comments I’ve got so far is “You should keep it with yourself” while the contribution should be applied to the work I’m doing.

If you want to contribute something, be prepared for the worst outcome too.

Anyway I’d like to encourage people to contribute, especially to work. Well it’s your own benefit too, isn’t it ?

Legacy Coder

I have wrote about Legacy Code a few years back. Today I have quite a similar story.

Earlier this year, there’s a large project involving one of our new product. We are going to fix the common issue that we found throughout the code base. It has been decided that this will be billed under one project.

The fix we are introducing is to have a common class contains shared static functions.

My responsibility is to replace the old, problematic code with the new standardized one we have above in certain business area I’ve been assigned. However, I find that we the issue is simply caused by using incorrect classes. These classes are from 3rd-party library which also contains other class that we could use to solve the problem. This library is a very well-known, and later become the basic design of the new standard library.

Later I talked with the guy who is responsible of the product. I don’t think that we are in the right direction. I believe that using well-known and well-tested class library is much better than rolling our owns. In fact, in some business area of the product, the proper class is used. Some of us knows the design of this class library quite well.

The response I’ve got is “It’s not everyone that’s as good as you”.

It makes me realized that not every people love to learn new things. They knew the platform and the ecosystem 5 years ago, they don’t know how they are today. These people get stuck in the past and becomes ‘Legacy Coders’.

My team mate that I talked with is a very skillful person. She knows a lot, and she learns a lot for all these years. It must be hard for her as well to come up with something just barely adequate, to make sure that everyone in the team are comfortable to work with product (otherwise she will be overwhelmed with work load as no one can help her.). That decision also affects be as a guy who have to support the product once it goes to production.

I’ve talked with a few people. What I found is they are not comfortable with continuous learning. They have burdens. They have spouse, children to take care of, they have drama to watch every night. They will not learn anything unless it’s officially trained during the working hours. It’s frustrating.

What I concerns more is these people teach newbies the same method they use. These newbies will have to learn the old way that was working okay, but most of the time sub-optimal. I’d like to see new people eager to learn and contribute what they have to the existing team players. Currently it looks like a lot of new graduate leaves all good thing they have learned in college behind and start all-over with just-okay stuffs the current people teach them.

That said, many graduates are not so great either. They already forgot things they learned once they leave the exam room … I found that most people value those people who follow. I also find that many those with good grades are usually good with following people, but not in coming up with their own idea.

Anyway, this is probably a good problem worth resolving. I need to try a little bit harder :-).

Optimize … hold your horse!!

This story is from a meeting. There’s an issue with transaction creation code which the transaction contains multiple trade entries. Each trade entry need a matching electronic transfer instruction. My team mate found that the instruction that match the first trade is applied to every trade entries.

The code in question is something like this, in simplified Java.

BankTransferInstruction instruction = null;
for(TradeEntry entry : transaction.getEntries()) {
  if(instruction == null) {
    instruction = findBankTransferInstruction(entry);
  }
  entry.setBankTransferInstruction(instruction);
}

Did you see the problem? Take some time if you didn’t.

Actually this kind of problem is quite easy to solve. Something like :-

for (TradeEntry entry : transaction.getEntries()) {
  BankTransferInstruction instruction = findBankTransferInstruction(transaction);
  entry.setBankTransferInstruction(instruction);
}

As you can see, the problematic code looks for the instruction only once (when the variable is not null), and we resolve it by make it look for an appropriate instruction for every trade entry.

So in the meeting, someone say ‘why don’t we optimize it a little further ?’.

BankTransferInstruction instruction = null;
for(TradeEntry entry : transaction.getEntries()) {
  if(instruction == null ||
     (instruction != null && !instruction.isApplicable(entry)) {
    instruction = findBankTransferInstruction(transaction);
  }
  entry.setBankTransferInstruction(instruction);
}

We add one more condition so if the current instruction is applicable for the current entry, then it’s applied right away. This is probably faster than the previous one.

But, do we really need it ?

Before jumping right in with optimization, the most important thing to do is to evaluate whether or not there’s a performance problem. If it is then yes we’d need it. However keep in mind that optimization can sometime bring complexities (like the code above), and complexities hurts everyone in the long run. It means you have more possible points of failure, it means more unit test is needed, more maintenance is needed, more time need to be spent on this problem. It translate in to cost both directly and indirectly.

If you do optimization prematurely, it’ll become against you shortly after.

So before applying optimization, we should profile the code to see if the new code is actually the bottleneck, and how bad it performs. It’s not to late to apply optimization after we see the problem.