برگرفته از کتاب Programming Erlang, Second Edition
برداشت اول: ترجیح میدم برنامه هارو کم کم بزرگشون کنم جای اینکه از اول به نوشتن یه برنامه خیلی بزرگ و جامع فکر کنم.
برداشت دوم: مزیت این روش اینه که immediate feedback میگرم از کدی که نوشتم و از اشتباهات بزرگی که بخواد حجم زیادی از کد رو تحت تاثیر قرار بده جلوگیری میشه.
برداشت سوم: سعی نمیکنم از قبل به ساختار برنامه و data structureهای مورد نیاز فکر کنم. حین برنامه کم کم میفهم م چی لازمه.
برداشت چهارم: یه ذره کد مینویسم٬ یه ذره تست ش میکنم. مجدد همین کارو تا جایی که لازمه ادامه میدم.
How I Write Programs
When I’m writing a program, my approach is to “write a bit” and then “test a bit.” I start with a small module with a few functions, and then I compile it and test it with a few commands in the shell. Once I’m happy with it, I write a few more functions, compile them, test them, and so on. Often I haven’t really decided what sort of data structures I’ll need in my program, and as I run small examples, I can see whether the data structures I have chosen are appropriate.
I tend to “grow” programs rather than think them out completely before writing them. This way I don’t tend to make large mistakes before I discover that things have gone wrong. Above all, it’s fun, I get immediate feedback, and I see whether my ideas work as soon as I have typed in the program.
Once I’ve figured out how to do something in the shell, I usually then go and write a makefile and some code that reproduces what I’ve learned in the shell.
@gocasts