
Ask HN: Feeling miserable at work - grover_hartmann
Rails programmer with ~10 years of experience here, recently I&#x27;ve been hired as a PHP programmer and I&#x27;m dealing with a very complex and undocumented codebase that I wish I never seen before.<p>You might ask &quot;why did you took the job in the first place?&quot;, well that&#x27;s either because I can&#x27;t find work in my area and most of it is PHP&#x2F;Python work and I can&#x27;t move either, the Rails related work that is remote requires that I move and remote work tends to be &quot;US remote&quot;.<p>The PHP code I&#x27;m working with is extremely complex&#x2F;messy and most of the code is undocumented, I have to do lots of debugging just for changing the simplest things and I&#x27;m also not very familiar with this language.<p>Most of the code is a mess of spaghetti code, think of HTML, JS and PHP all glued up with no proper structure.<p>The git repository is also one of the biggest repositories I have worked with (247 MB), 45,000 files and 1 million lines of code for the whole project.<p>I was already able to complete some tasks but I can&#x27;t help but feel miserable with this project.<p>Recently my manager started asking me questions like &quot;How&#x27;s it going? Will you finish this task today?&quot; and I explained to him I&#x27;m having difficulties with the code and that I&#x27;m not very comfortable working with it but he&#x27;s insisting that I stay firm at it and get familiar with the code. Please advice.
======
tboyd47
Sorry man. Sometimes you just have to deal with shit code. We've all been
there.

Are the people at the job nice? Do you have freedom to work as you please? Do
you have the time to take the code in a better direction? I'm just trying to
help you find a bright side.

I'd say there are two possible paths here. Either the job is overwhelming to
you, or it's not overwhelming but just extremely unpleasant. If it's
overwhelming, I'd say to explain that to your manager and request an immediate
short-term re-assignment. If it's just unpleasant, then follow your manager's
advice. You might be holding your nose for a while, but you will adapt to it
and it will get easier.

~~~
grover_hartmann
> Are the people at the job nice?

Yes, they seem patient/polite and I can tell they want me to stay, but I don't
know them personally and this work is remote.

> Do you have freedom to work as you please?

Yes and no.

> Do you have the time to take the code in a better direction?

This is something that I'm currently annoyed with, when I was implementing a
feature and working with a coworker, we had to re-use code from another
function and instead of just making some changes to the function, he asked me
to duplicate the function (~650 LoC).

I suggested to just make some changes to the existing function and re-use that
one, but my coworker didn't want to go that route and suggested I just
duplicate the function and so I did, I'm pissed that I can't make my own
choices and instead I have to follow his orders.

My boss acknowledged that the project is in a bad state and sometimes I feel
they are testing my patience, he mentioned they plan to rewrite the project in
another language so I can tell they have common sense, but I get the feeling
this other programmer I'm currently working with is happy with the state of
the project and is holding things back.

~~~
tboyd47
650 LoC seems like a big chunk of code to copy and paste, but I don't know the
project or the team. You can't expect to join a team and start turning
everything upside-down. Even if you are honestly just trying to help, if
that's how it's perceived, you will face resistance on any team.

It sounds like at least your boss agrees with the general direction you want
to go in. That's really the only thing that matters in the long term. You need
to be humble and willing to work with people, but at the end of the day, you
are only answerable to your direct supervisor.

~~~
grover_hartmann
That's good advice, I appreciate it, thanks.

I finally started understanding some of the code today, and things are
starting to get better on that front.

I agree with you, I'll stay humble and play my cards well, being employed is
more important right now than taking possible risks and losing my job.

~~~
cerberusss
When you're a couple of months in, you will probably no longer have to take
orders from an idiot that wants you to copy and paste code.

I've been in this situation. The existing developer was stuck in his ways,
used a very old-fashioned way of dealing with the language in question and
told me to do things that go against every good practice. It was frustrating.

I just agreed, then slowly started asking token advice (for example naming,
coding style, things that don't matter to me). Then simultaneously and without
asking, I started setting up a git repo, a basic architecture, build server,
linter et cetera.

Hang in there, and build their confidence in you. Then slowly you can start
doing things your way.

