1. Music, something fast paced with minimal to zero lyrics (usually a GOA radio station in my case)
2. No distractions around (use a "do-not-disturb" flag or something to hang on your monitor or show on your desk)
3. No chats or other communication/social media visible, best case those apps / tabs are completely closed or muted
4. Having a clear goal to achieve, might even be only a sub-goal for the current coding session.
5. Structure your code before your actually write it, I usually create step-by-step comments in each file, documenting my thought process and what steps the current file/class/whatever should do.
6. Try to code your stuff in the same order as the aforementioned comment step-by-step list dictates (unless there is a reason to change the coding order)
7. Only windows open: IDE/Editor, Browser
8. Also keep only the browser tabs needed for your work open (testing clients, documentation, music if using a browser client, etc.)

At least that's what works for me

Add Comment