The main idea is simple: to get rid of the concept of having source code divided into many files. I will use a program written in C as an example. We have seen many sample programs that fit into one source code file.
Code: Select all
/* program.c */
#include <stdio.h>
int main()
{
printf("hello, world\n");
return 0;
}
Code: Select all
cc -o program program.c
We all know that having a big chunk of code is quite hard to understand and maintain. It is easy to have a "hello, world" program packed into one file. What about any bigger programs? One solution to this could be to have a powerful "IDE-like" management system. Then the responsibity of having a tree-like (like source file hierarchy nowadays) view of the program is passed to the IDE. There could be same kind of helpers as #regions in C#. I think the size of code a developer should work on at a time is something that can be seen without scrolling the screen.
I am almost hearing the criticism that follows this idea. What about the compilation speed if we have to compile everything if making a small change in code? Answer: true, we do unnecessary code compilation but is that overhead significant today? If using normal "at least one hundred source files" method, we would have a significant overhead when doing several compilations. I would say the one file approach is almost always faster in practice. If the program is so big that the building overhead is significant, then it is time to divide the actual program. As a bad example: Microsoft Office is not a single program: it consist of Word, Excel, Powerpoint etc.
What do you think?