which is better programming practice?

Mutikasa

Power Member
Joined
May 23, 2011
Messages
589
Reaction score
216
Let's say I have to download 30 files, rename them, then upload them, this is just an example.
Now, is it better to write 3 functions and repeat them 30 times, so it will be download all files rename them then upload all, OR, one function with all 3 jobs and repeat it 30 times, so it will be download file, rename it then upload, next file?
 
One function for each job. This allows you to use those functions in any combination down the road. At some point you may want to script something using only two of those processes.
 
Just like I thought so. Programming is all about control and flexibility of the process
 
Back
Top