in reply to Subroutines versus straight top to bottom scripts
So yes, subroutines greatly aid reusability, on both levels.
Additionally, subs are easier to test than a top-down script. You only have to extensively test one sub at a time - once it's clean, you're confident to use it. Writin unit test is also simpler for subroutines with well defined interfaces than for whole scripts.
|
|---|