It's Just Files

Understanding the relationship between programming languages and files will help you create or debug software projects.
Jan 25, 2023
4 min

Using a programming language to solve a programming problem is one thing. Creating an entire project from scratch is another. Every programmer reaches a point where solving well-defined problems (i.e LeetCode) becomes manageable. However, it’s common for programmers to hit a wall once tasked with creating a project from scratch.

Every software project begins with an idea. From here, a single question exists: “How do I create this idea?” The obvious answer is to start working on the idea in the first place. Yet completing a software project is not easy. Many people tend to get stuck at some point in a project, and this occurs because they forget one thing.

It’s Just Files.

A software development project is composed of files, so understanding the full implication of this fact will help you solve any development issue that you encounter. But what is a file? A computer file is a virtual representation of a physical document such as a paper or folder. Computers maintain many types of files (which can be identified by the file’s extension).

An executable is a type of file that performs instructions on a computer (which people refer to as a software or program). The executable file  — which people call a software or program —  contains machine code (bits; 1s and 0s) that a computer executes with a runtime environment. The significance being that the starting point  of your program — called an entry point — should never be unclear: You write code using a programming language and store that code in a file. It’s compiled to an executable file which — upon execution (via terminal or shortcut) — is run bit by bit.

Or in more colloquial terms, your program is run line by line.

This operation doesn’t change when you create a software project: There always exists a file that is used to execute your program; or the program that interprets your program. In any case, the usage of bits is abstracted by your programming language, which will specify where the entry point exists (i.e func main()). As a result, you will always start a programming project by creating a file — or a folder of files — which contains the starting point of your program.

What is a File System?

A screenshot of the VSCode File System Navigation Bar.

A file system stores files in an organized manner. Understanding the file system within a computer is important because it’s common for programming languages to reference files from various locations within a file system. In modern times, a folder (also called a directory) is a common file type that is used to store other files in a file system. A folder is a virtual representation of a physical folder which stores files.

Following the information above, an “installer” is a program that “installs” software by placing numerous files in the right folders of your file system automatically.

Software Project Architecture

As a reminder, there is no difference between a program created from a single file vs. a program created from a project that contains hundreds of files. So why not include your entire codebase in a single file? Well, you can. However, this practice isn't common for the same reason that you use human readable programming languages instead of writing 1s and 0s all day long: Chances are that organizing your project makes it easier for a human to develop software.

The structuring and organization of a codebase in software development is called Software Architecture. A software project architecture refers to the organization of a single codebase; as opposed to a system’s design. Debatable claims aside, it’s typical for programmers to use software architecture patterns in order to organize their code. Domain Driven Design, Command Query Responsibility Separation, Hexagonal Architecture, and Clean Code are all examples of software architectures. These architectures were created by developers who solved many programming problems, then noted the patterns of the ideal organizational schemes for their respective projects.

Every developer has an opinion on which architectures should be used for a given project. Some adhere to the above architectures like a religion. Others exclaim that an architectural pattern isn’t required “until it’s required” (then proceed to write thousands of lines of code in a single file). Of course, the truth is that the architecture you should use depends on the problem you are solving. Spending time on an unnecessary organizational problem is a waste. Yet so is addressing every organizational problem at the last minute, then proceeding to blame “technical debt” for your productivity issues.

The significance of a project architecture is that one determines where files are placed within a software project. In a tutorial, a developer may place a file in a specific folder because they are using a specific architecture. When you start a project from scratch, you will be the person who decides what files go where. In other cases, the programming language and libraries you use will dictate where a file must be placed.

One of the easiest ways to become accustomed to a codebase is by understanding what each file does.

What is a Software Dependency?

The purpose of a software dependency (also called a package) is to save time from writing code that has already been written. While the implementation of software dependencies differ among platforms, it’s typical for a programming language to allow the user (developer) to import code definitions from one file to another. This allows you to use the same code among multiple files within a given file system. Dependencies are important in project architectures since a dependency is used to classify a group of files within a program.

Don’t Get Stuck

Tutorials tend to skip over important details which cause you to get stuck while creating projects from scratch. The significance of a software project being composed of files is that any error you receive is the result of a misconfiguration of certain files. Being able to identify these files and fix them results in the error being fixed. As a result, you are able to fix any error as long as you identify which file is causing an issue.

And when you don’t know where to start, try the entry point.

Read More