4 ms·
Ask HN: What would you do, if your colleague is writing ridiculously bad code?
We are in start up, where no one knew anyone before. We divided our work and couple of weeks / 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 "// ret" above return statement, "// init" above variable definition, etc. When I said something ( I tried to be polite ), the response was "there is a difference between academic code and real world code", or "ok, do it yourself". 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 8y agoThis 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 8y agoYou 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.