In all the code I see online, programs are always broken up into many smaller files. For all of my projects for school though, I\'ve gotten by by just having one gigantic C sour
is it just for ease of reading?
No, it can also save you a lot of time compiling; when you change one source file, you only recompile that file, then relink, instead of recompiling everything. But the main point is dividing a program into a set of well-separated modules that are easier to understand and maintain than a single monolithic "blob".
For starters, try to adhere to Rob Pike's rule that "data dominates": design your program around a bunch of data structures (struct
's, usually) with operations on them. Put all the operations that belong to a single data structure into a separate module. Make all functions static
that need not be called by functions outside the module.