Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-30 Thread Albert-Jan Roskam
- On Tue, Dec 30, 2014 12:34 PM CET Alan Gauld wrote: >On 29/12/14 23:50, Patti Scott wrote: >> Could someone clarify "Modularize code rather than copying and pasting?" > >Joel and Danny have given the basic answer in terms of putting >loose code into functions. But it

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-30 Thread Alan Gauld
On 29/12/14 23:50, Patti Scott wrote: Could someone clarify "Modularize code rather than copying and pasting?" Joel and Danny have given the basic answer in terms of putting loose code into functions. But it goes a little further too. You can be tempted to copy/paste functions because they alm

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-29 Thread Danny Yoo
> When you have nearly identical or identical pieces of code, make functions > rather than cut and paste the same code. Call the function from various > places. It makes it easier to bug fix later We can make this more concrete. Let's say that we are writing a program to do all kinds of dice ro

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-29 Thread Joel Goldstick
than cut and paste the same code. Call the function from various places. It makes it easier to bug fix later > > On Fri, 11/14/14, Albert-Jan Roskam wrote: > > Subject: [Tutor] [OT] Best Practices for Scientific Computing > To: "

Re: [Tutor] [OT] Best Practices for Scientific Computing

2014-12-29 Thread Patti Scott
Could someone clarify "Modularize code rather than copying and pasting?" thanks On Fri, 11/14/14, Albert-Jan Roskam wrote: Subject: [Tutor] [OT] Best Practices for Scientific Computing To: "Python Mailing List" Date: Friday, N

[Tutor] [OT] Best Practices for Scientific Computing

2014-11-14 Thread Albert-Jan Roskam
Hi, I thought this might be worth sharing, especially on a windy, rainy Friday evnening: http://www.plosbiology.org/article/info%3Adoi%2F10.1371%2Fjournal.pbio.1001745 Here are the best practices mentioned in the article: Write programs for people, not computers. A program should not require