Can I speak out when I see my boss' code weakness?

W

www

Hi,

I have just found this job recently. I really like my job and appreciate
my boss gave me the job offer, including a great salary. My main job is
to add some feature to an existing Java program, which is developed by
my boss in the past several years.

But I have spend too much time studying this program. So occasionally I
have found some defects in the program. I am excited for my findings
because I feel I am good. On the other hand, I am extremely hesitated to
tell my boss. He is an extremely nice guy. He is being promoted
recently. I am afraid I "break" something.

Also, I have installed profiler in Eclipse. By using profiler, I have
find some code not very efficient and could be tuned to make the
performance better.

Do you give me some advice? Thank you very much.
 
P

Patricia Shanahan

www said:
Hi,

I have just found this job recently. I really like my job and appreciate
my boss gave me the job offer, including a great salary. My main job is
to add some feature to an existing Java program, which is developed by
my boss in the past several years.

But I have spend too much time studying this program. So occasionally I
have found some defects in the program. I am excited for my findings
because I feel I am good. On the other hand, I am extremely hesitated to
tell my boss. He is an extremely nice guy. He is being promoted
recently. I am afraid I "break" something.

This is really a question about your boss' character. Remember, however,
that hiring decisions are one of the most important and difficult
aspects of a senior programmer's job. There is nothing more reassuring
and comforting than indications of competence on the part of a recent hire.

How sure are you that these really are bugs? Do you have test cases?

In any case, it may be best to present the issues as questions of the
form "Could you explain how this works? It seems to me that it would
fail in these conditions" or "I think this test should get result X, but
it actually gets Y because of code Z".
Also, I have installed profiler in Eclipse. By using profiler, I have
find some code not very efficient and could be tuned to make the
performance better.

First understand the performance objectives. The question is not "Can
this code be made faster?", but "Do the benefits of tuning this code
exceed the costs and risks of doing so?". If the code in question is
fast enough for its practical use, the answer is no.

Your boss may have deliberately chosen simplicity or code reuse over
performance in some cases.

Again, it can be handled as a question: "I've noticed some possible
performance improvements. Are you interested in tuning the program at
this point?".

Patricia
 
C

Christopher Benson-Manica

www said:
But I have spend too much time studying this program. So occasionally I
have found some defects in the program. I am excited for my findings
because I feel I am good. On the other hand, I am extremely hesitated to
tell my boss. He is an extremely nice guy. He is being promoted
recently. I am afraid I "break" something.

It depends on what you mean by "defects". If you mean that the code
could unceremoniously crash or something else dire may happen, you are
responsible for fixing the problems or otherwise arranging for them to
be fixed; that's presumably why you were hired. You definitely want
to approach your boss with caution, perhaps by saying that you noticed
some things about the code that you want to discuss with him. In the
end, if your boss is worth working for, he will be pleased with your
efforts to improve the code base.
Also, I have installed profiler in Eclipse. By using profiler, I have
find some code not very efficient and could be tuned to make the
performance better.

It depends on how important performance is to your application; again,
you might gingerly broach the issue with your boss.
Do you give me some advice? Thank you very much.

If you're right about these problems you've found, and bringing them
to the attention of your superiors causes problems, you may have
picked a bad job. Hopefully not.
 
M

Mike Schilling

Patricia Shanahan said:
First understand the performance objectives. The question is not "Can
this code be made faster?", but "Do the benefits of tuning this code
exceed the costs and risks of doing so?". If the code in question is
fast enough for its practical use, the answer is no.

Your boss may have deliberately chosen simplicity or code reuse over
performance in some cases.

Again, it can be handled as a question: "I've noticed some possible
performance improvements. Are you interested in tuning the program at
this point?".

And if his answer is "Performance isn't a problem, what we need are the new
features I assigned to you", you need to accept that he probably knows what
he's talking about.
 
C

Christopher Benson-Manica

Mike Schilling said:
And if his answer is "Performance isn't a problem, what we need are the new
features I assigned to you", you need to accept that he probably knows what
he's talking about.

With the caveat "as long as it isn't too big of a problem". If there
is a bottleneck that causes the program to come up in 60 seconds
instead of 20, that deserves to be fixed if only on the basis that it
saves the programmer's time. On the other hand, of course anything on
the order of a few seconds or less is pretty much negligible for most
applications.
 
D

Daniel Pitts

www said:
Hi,

I have just found this job recently. I really like my job and appreciate
my boss gave me the job offer, including a great salary. My main job is
to add some feature to an existing Java program, which is developed by
my boss in the past several years.

But I have spend too much time studying this program. So occasionally I
have found some defects in the program. I am excited for my findings
because I feel I am good.
Its okay to feel good for finding problems. Just make sure they are
real problems and not just percieved problems. If you want to make
sure you're doing things right, write unit tests that fail on the
current code (to prove the bug), and pass on the improved code (to
prove you fixed the bug). I would make sure that the broken code is
actually executed in any of the use-cases. If its not, ignore it (or
delete it as dead code).

If you feel strongly enough about something that you think it should be
changed, change it. Don't point the finger at anybody; it is about the
code, not the author.
Also, I have installed profiler in Eclipse. By using profiler, I have
find some code not very efficient and could be tuned to make the
performance better.

Okay, but do the parts that aren't very efficient effect overall user
experience? If you spend an hour of time to shave off 1 second of
startup time, it would never even out in cost. On the other hand, if
you take 2 hours to improve the time it takes to execute long-running
process, say by %50, it may be worth your time. You have to use
judgement on how much time to spend versus the value gained from that
time.

Keep in mind that weakening the design to improve perfomance could
actually cost you more time later when you need to change something.
Always go for clear design first, then profile and optimize only if
speed has caused a problem.

So, thats my advice.
Hope it helps,
Daniel.
 
M

Mike Schilling

Christopher Benson-Manica said:
With the caveat "as long as it isn't too big of a problem".

If he says what I suggested, and it is a big problem, bail out now: your
boss is a moron.
 
R

RedGrittyBrick

Lew said:
Alfred said:
www said:
Hi,

[some useless]

Where is your Java problem?

This is clj.programmer, not clj.programming. He explained his problem
pretty clearly. It was on topic.

Someone should update the Mini-FAQ that gets posted here periodically.

comp.lang.java.{help,programmer} - what they're for
(mini-FAQ 2006-03-31)

comp.lang.java.programmer Programming in the Java language.
An unmoderated group for discussion of Java as a
programming language.

I've been posting my programming problems here by mistake ;-)
 
L

Lew

Alfred said:
www wrote:
Hi,

[some useless]

Where is your Java problem?
This is clj.programmer, not clj.programming. He explained his problem
pretty clearly. It was on topic.
Someone should update the Mini-FAQ that gets posted here periodically.

comp.lang.java.{help,programmer} - what they're for
(mini-FAQ 2006-03-31)

comp.lang.java.programmer Programming in the Java language.
An unmoderated group for discussion of Java as a
programming language.

I've been posting my programming problems here by mistake ;-)

It is a Java programming problem. He was asking for advice on how to handle a
body of Java code in an environment where his livelihood is at stake, and he
honored the group with his trust to provide advice on such an important Java
programming issue.

At the very least, it's a programming meta-problem. I still aver that it's on
topic for this group, and certainly antipodal to "some useless". In fact, it
is the very usefulness of the OP's question that engages my support.

Are we to be so petty that we exclude problems that are far more significant
to our success as Java programmers than, say, whether Java should support
first-class functionals?

"some useless", indeed. Harrumph.

- Lew
 
K

kingpin+nntp

Mike said:
And if his answer is "Performance isn't a problem, what we need are the new
features I assigned to you", you need to accept that he probably knows what
he's talking about.

That assumes that the boss isn't an idiot. There are countless people,
especially in management roles, who fail to truly understand what's
appropriate for a project, and they often make assumptions such as
"performance isn't a problem" without realizing that users might
actually be wasting time each day waiting for some poorly written code
to jump through [as an example] 3 sets of loops when only 1 or 2 that
do the job in 1/10 the time are actually needed.
 
R

RedGrittyBrick

Lew said:
It is a Java programming problem. He was asking for advice on how to
handle a body of Java code in an environment where his livelihood is at
stake, and he honored the group with his trust to provide advice on such
an important Java programming issue.

Which was (paraphrased) "should I tell my boss about some bottlenecks
and defects I found in his code?"

Would the answers have been any different if you substitute any of
C#/C++/VB/Perl for Java?
At the very least, it's a programming meta-problem.

I suspect the answers would be similar if the OP was asking about a book
editing job, a toaster design job or any other job where someone was
asked to pick up their bosses work and found fault with it.
I still aver that
it's on topic for this group, and certainly antipodal to "some useless".

I hope you're not mistaking me for the person who wrote that?

Anyway, so long as someone is enjoying this employment meta-problem,
I'll step out of your way :) Peace.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top