agent max wrote: |
---|
Those are all well and good, but for a small program, say 40 lines or so, is it really necessary? I mean, in that case, wouldn't having multiple files just take up disk space and make things unnecessarily complicated? |
Hence the quotes and mention of workflow. Yes, there can be tiny, but very real programs.
If you work in a way that is not affected by the number of files, then having more than one is less an issue.
Number of files on modern storage is not a huge issue either. Filesystems typically use 4kB blocks, so yes, small files "waste" space, but disks today are "big".
There was a filesystem that had option to use unused part of data blocks of directories for tiny files.
Other than space is "inodes", the number of files that a filesystem can hold. One terabyte disk has about 250'000'000 4kB blocks, doesn't it? I have a 20 TB volume that can have "only" 60 million files ...
Furthermore, there is issue of
reuse. What if you write a "perfect" function? So good that you use it in more than one 40-liner program? Do you copy-paste? What if you find a way to make the function "better"? Copy-paste again?