Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Ok, seriously, I'm sort of sick of the file-stew meme in software development these days. Our editors aren't particularly designed for the one-file-per-function method of development that's been ohh-so-common. Serious, if a file is under a hundred lines of code, it probably doesn't need to be a separate file, it only undermines the grouping value that files are useful for.


I usually do the following:

- if function A and B are always used together, than they are one file.

- if linecount gets to big, split A and B into separate files

- if function C is shared between modules than it belongs in it's own file

So far it worked out great.


So long as #3 takes #1 into account.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: