3 ms·
Abstractions and code generation. Start by being completely intolerant of repetitive code. Boilerplate must die. Closures can help a lot with this. To whatever
by DennisP 17y ago
Abstractions and code generation. Start by being completely intolerant of repetitive code. Boilerplate must die. Closures can help a lot with this.
To whatever extent you can't abstract away, use code generation. Make your generator insert code directly into your project files, maybe in between comment tags. You want to be able to configure things with minimal code and hit a button to get everything you need.
I'm experimenting with using emacs for this, but generally I've just built c# projects to generate my c# code. On one project this had an unexpected benefit: I realized I could change my generator from a compiler to an interpreter, doing everything at runtime, and I got a very concise and flexible data-driven project, with 1/3 the lines of code as a similar project built by a contractor that had everything hardcoded.
Of course, know your language and libraries well. You don't want to be googling for every little thing. To help learn the libraries, staged memory software like anki or mnemosyne can be a big help.
Finally, get really good at a topnotch text editor. I'm about 8 months into using Vim for everything (mainly via Viemu, a plugin for Visual Studio) and it makes a huge difference. It's not just that I can edit faster, but that it helps keep me in flow.