I've been working on a Python(Django)/JavaScript(AngularJS) based application for some time now.(I learnt all of these on the way, had previously been a Java only programmer)and have hit moments where the code was really unmanageable:
Single js script for the entire application, around two-dozen controllers, a dozen or so services and other components, all squashed into a single file.
I refactored that successfully, though, added a Grunt for minification and proper generation of final code for the application, shifted to bower for package management and in turn basically made my life easier.
Only if I had optimised things earlier in the development cycle, things would've been easier. So one thing that I've been wondering is what would be the right time to optimize my code? Weekly..Biweekly or just when and how do I assess code quality everyday, everytime I run a build.
There's probably a lot of tools out there for what I want to do, but what I want to know is where I should get started with this and what is the right way to optimize source code to use good programming standards, given that Python and JS are statically typed languages, with no particular coding standards enforced by default, as compared to Java, where I found it easier to write good code.