Hacker News new | ask | show | jobs
by choletentent 1533 days ago
If well done, single file projects are not bad. They save a lot boilerplate code. It is also easier to find things, since it is all in the same file.

EDIT: I'll go even further. Programmers who don't like long files are probably using the scrollbar to navigate around the file. Vim saves me from that bad habit.

1 comments

What programming language requires 'a lot' of boilerplate code to use multiple files? That sounds awful. I don't think the argument for things being easier to find goes up either, with a tool like grep.
You don't need to go far. In C, function prototypes in header files are boilerplate ;)
Perl XS (the system used to interface with C) requires module == file, so if you have a particularly large module then it just has to live in a single file. Here's one:

  $ wc -l perl/lib/Sys/Guestfs.xs 
  11930 perl/lib/Sys/Guestfs.xs
Worse still, this expands to C which can be large and takes a noticable time to compile:

  30019 perl/lib/Sys/Guestfs.c