|
|
|
Ask HN: How should I proceed at work?
|
|
4 points
by pietrrrek
1992 days ago
|
|
I started working (part time as a student) at this small [1] company back in April when the virus just hit which lead to a rocky introduction to the systems that are in place. The other developer is going into retirement in about two months and, thus far, the company has had trouble finding an appropriate replacement. The system is a large website built with AngularJS and SailsJS. The codebase is very large (at least in my unexperienced eyes) which would not be an issue had it been properly documented, most components do not have a single comment in them (except for code which has been commented out) and also lack any external documentation. To add on to the mess, the code style is also not very reader friendly (cryptic variable names, unnamed constants etc.). I see the fact that the above mentioned employee is going into retirement as an opportunity to "do things right" and start over by rewriting/porting the website, writing proper documentation along the way, and upgrading certain technologies (e.g. JS -> TS and SVN -> Git) but I feel that I'm in way over my head. I'm about to finish my Bachelors this summer and plan on starting on a Masters immediately. I feel competent enough in writing software but not in creating a feasible architecture for such a large project, so my question is; how should I proceed? I think that the changes that I've come up with would be a net positive for the company and would make the life of future developers at the company easier (that is if the implementation is good enough). Could you point me to any ressources that might be of help in my situation? [1] There are no more than 4 IT employees where only I and another one are developers |
|
In refactoring, you attack one piece of "code smell" at a time. You can improve one variable name at a time, for example, and test to make sure it works. You can refactor a function and not touch any of its dependencies and see if it still works.
The worst thing would be to start a big rewrite and then leave the company without anyone to fix the old thing or complete the new one. I totally agree with you that documenting the current monster is a must-do. As you write that doc, you'll see where the biggest code smells are. Things that make no sense in the doc or are hard to relate together in writing are probably poorly designed code.
On the subject of comments, I think they're overrated. Comments are only necessary when the code isn't self-documenting, which implies that it has a poor naming strategy or uses patterns that are difficult to recognize visually. It's better to fix the code (especially names of variables and functions) to make the code itself human readable than it is to write comments.
Hope that helps!