7 ms·
How I Write Code: 1. Copy the smallest piece of code I've already written and change it slightly to do something really small. Get it working perfectly. 2. A
by edw519 17y ago
How I Write Code:
1. Copy the smallest piece of code I've already written and change it slightly to do something really small. Get it working perfectly.
2. Add a little bit. Get it working perfectly.
3. Add a little bit more. Get it working perfectly.
4. Repeat until it's not so easy to add anything, even a little bit. Print a hard copy. Holy shit! Did I write all that?
5. Mark it up like crazy with a red pen. Combine similar code into common functions. Rename variables. Rename them again. Rename them again. Rename them to what they originally were, but without vowels. Restructure unwieldy functions. Rewrite the stuff I can't believe I actually wrote myself.
6. Sit down at terminal and enter changes. Save every version (even though I never look at it again). Get it to work perfectly (again). Holy shit! What did I do? It's totally broken! Debug, debug, debug. Good. Now it runs perfectly. Time to add more...go back to Step 1. (Except every 5th time through this loop: Scrap it all and rewrite it the way I should have in the first place.)
7. Repeat until dead.
- vinutheraj 17y agoMy style is is a combination of both this and what is written in the article. I don't whats the best, but this seems to work for me !
- anamax 17y agoAdd in some 5 to 1, 2, and 3.