
Ask HN: What would you do, if your colleague is writing ridiculously bad code? - pafo
We are in start up, where no one knew anyone before. We divided our work and couple of weeks &#x2F; months later when we were putting it together I saw his code. Methods which are hundres of lines long, classes has 2k lines, comments like &quot;&#x2F;&#x2F; ret&quot; above return statement, &quot;&#x2F;&#x2F; init&quot; above variable definition, etc. When I said something ( I tried to be polite ), the response was &quot;there is a difference between academic code and real world code&quot;, or &quot;ok, do it yourself&quot;. I even generated code statistics and describe it - cyclomatic complexity with 41 and NPath complexity with more than 1.8 milion is not good. But nothing changed...
======
anoncoward111
This is usually where the politics begin. The code is objectively bad, but
depending on your relationship with the owners of the startup, they may or may
not tolerate your opinion.

Later, when the code starts causing things to break, you may be totally or
partially blamed. I would have a private discussion with the person you trust
most at the company about how to institute a formal code review process where
things are as objective and risk-free as possible

~~~
Freak_NL
You may run into a wall there though, depending on the goals of the
founders/bosses. If their goal is to deliver a minimum viable product in as
little time as possible, it may well be that any plea for code standards and
well-written code will be ignored in favour of your colleague's cowboy coding.

This is a good time to find about where the company stands on this point,
because nothing is more soul draining than working on someone else's
unmaintainable code mess.

If it is just you versus him (i.e., no colleagues who share your view), then
you are in for a tough challenge.

