At my previous job, I was in a relatively easy ASP.NET developer role that had me turning over a large number of small database systems for internal use within the company. I churned out the required code, and all the while I had almost complete creative control. After releasing a system, I'd even come back to it when I was in a low period of work and refactor the code and generally improve the system for the users and/or other developers.
I've now moved on, and tried to shift my career more towards what I am interested in. In doing so, I managed to find myself a great job (lots of learning, complex algorithms, etc).
The problem is, I seem to have picked up some bad habits in my former job that seem to have leaked into my new job. My first task at my new job is updating a Bash script that performs a build and deploy of some code, and basically the guy I was doing the work for essentially refused to review my code because the file diff was massive.
The problem was that while going through the code, I'd basically refactored half of the code into functions, standardized all the output, added a "debug mode" and basically given the script a hell of a spit-shine. But in doing this, I'd gone way off reservation and done too much. My colleague agreed that the code was good, but there was no way that I could commit the code without confusing other developers, and causing merge conflicts.
Now I'm worried that my freedom at my last job, coupled with my inexperience as a programmer has gotten me into the habit of changing code on autopilot.
Are there any sure fire techniques for keeping yourself on a tight leash when maintaining code? Any tips for judging when you've done too much refactoring? Where do you draw the line between "if it ain't broke don't fix it", and allowing the code to rot?
I've been working on this particular script for three days, and while I have been doing so, I've had the code change every day when pulling from source control! It's not big changes by any means, but changes nonetheless that require merging.
The combined length of the Bash scripts (if they were to be concatenated) is approximately 4000-5000 lines. The part I'm working on (one file) is 2000.
You have to consider that I am definitely at the bottom of the food chain here. Doing "code walkthroughs", while I have done them in the past, is not an option here because I can't tell other developers how to do their job with only 2 weeks experience under my belt. I'm looking more to establish a rapport with my colleagues at the minute, not rub them the wrong way by criticising their code.