I know, the number of lines-of-code (LOC) is not the most important performance indicator. It might be even one of the least important indicators.
There are a couple of reasons for this. First, 10 good lines are by far preferred over 1000 lousy and poorly written lines.
The number of LOC is important as a relative performance indicator, when compared in the scope of the same language. Besides, everyone agrees that writing good 1k is better than good 100 lines.
Here's how to do it:
The obvious and most basic rule is to write fast. Try beating 50 WPM in typeracer. Now develop in 50 WPM - That's 24,000 words a day, assuming 10 words/line give 2400 LOC a day. We even have some time left over for research and to find libraries to reuse before writing a new piece of code :) Another basic tip is to avoid interruptions. Meetings, notifications, emails, slack, facebook. Get a good pair of noise cancelling headphones and start tracking time - there are many time tracking applications to help you track the progress. Learn IDE tricks. Especially in languages that are considered verbose where there is a lot to write, and in strong typed languages where the IDE has much more understanding of what's going on. Learn Regular Expressions. A good example for an IDE trick is to use find and replace properly, sure you can go over all the functions that start with func and with var1 as parameter and change it to run manually. Though a better and faster option would be to find func([\w]*(var1) and replace it with run$1. Don't write bugs. Seriously. Debugging is one of the most time-consuming tasks. Think about that graph on how much it cost to fix bugs in different level of development - The lowest cost is before even writing the bugs. How to do that:
Learn the language caveats and avoid them
Read a library documentation before using it Use the library the way it supposed to be used Understand what's happening underneath Copy and paste wisely. I know a guy that always say: In every copy and paste there is a bug.
Mark some checkpoints for yourself. Parents are more productive when they know they must go home at specific hour and finish the tasks before leaving (ref). I like to mark short-term checkpoints. For example, continue working on the standing desk until a specific task is finished, or drink coffee only after I finish writing a specific document.
Let me know in the comments below what you think and if you have some other suggestions on how to write 1k lines-of-code a day.