What is a Code Base?
hey my name is Mike in this video we're gonna break down and define a very important term in computer programming which is a code base a code base is a very general term but it's a term that you'll hear used all the time if you're working with other developers or you're looking up things online and so it's very important that you have an understanding of exactly what a code base is what it's not and where code bases usually live so that's exactly what we're gonna go over we're gonna cover all the basics of what a code base is and really demystify this term so let's get into it what is a code base well believe it or not it's not an actual base like a military base or something that protects code code base is essentially a complete body of source code for a given program or application in other words it's all the code that the program needs to run in one single location and when you're first starting out as a programmer your program might be contained in one single file or a few files at most and so if that's the case then that one file or those few files is your code base but as applications get more complex single programs can spend hundreds if not thousands of files and so the code base is then the collection of those hundreds or thousands of files basically just all the files that you're working on for the program and the cool thing about a code base is that multiple people can use the same code base so if there's two or three developers working on something then they're all using a shared code base and contributing code to it so that's what a code base is now let's talk about what a code base isn't and so this term code base is a very general and high-level term and so sometimes people will use it to define different aspects of the code or different aspects of the project that they're working on and so while it may sometimes code base generally doesn't refer to the standalone compiled minified or bundled code that a computer might execute rather it's the source code that developers would be actively developing and writing so for example if you had a C++ program the code base for that program would be the actual C++ files it wouldn't be the compiled files that would be run on the actual machine so here we have a couple examples of code bases out in the real world the first example here is just a hello world pro so you can see that this is just a program it says hello world and even though it's only one file that itself is a code base right it's all the code that makes up this hello world project here we also have another code base this is actually one of the projects on code Academy calm and on here you can see there's a collection of different files that make up this project and all of these files together is considered the code base for this code academy project finally we also have one more example which is the react repository on github so react is a JavaScript framework and github is actually a really great place to store code bases and in this case the entire react code base is stored here on github so it's all these files collected together makes up the code base so now let's talk about where code bases live so where might you find a code base in the real world now code base is a lot of times can just live on the file system of your computer so if you write a hello world program like we saw on the last slide then that code base lives on your computer right it's stored in your file system and that's where it is a lot of code bases though are stored on version control systems so things like github bitbucket stash these are all common examples of where code bases might live and one of the good reasons for storing code bases on places like this is that they provide processes for good communication between developers they allow developers to work in parallel so multiple programmers can work on the code base at once and they also provide ways to ensure a new code isn't breaking anything so you can run for example tests on the code in the code base right from these websites so let's talk about why code bases are important why is it important to have all of the code for a project inside of this one single code base in one location the first is that a code base accesses the source of truth for the application so while individual developers might have a slightly modified version of that code on their personal machines the central code base is the official version so it's good to have one central code base which acts as the one true program and the code base is generally where all the development takes place and where any changes are added so it's basically where all the activity happens code bases also make it really easy to scale a project so the big the codebase the more issues are likely to be encountered in development right if you only have a project with two or three files chances are it's not going to be that difficult to maintain those two or three files but if you have a code base with thousands of files and the code base is a couple years old it can be really difficult to manage all of that so that's why it's important to have a well organized code base a place where all that code can live code bases also allow you to establish rules so you can for example create a style guide and then all the components or all of the user interfaces within that code base can adopt that same consistent style you can also enforce linting rules so linting would basically be like how the code is written how many spaces are between different parts of the code is the code using camelcase as the code using snake case does the code have comments in it etc so because you have this centralized code base you can establish rules for how all of these things work and you can make sure that everything is consistent so now finally let's talk about when you would use a code base a code base can be one single file if that's all you have for your project it could also be thousands of files so anytime that you're writing a program that in itself is its own code base also anytime that you're looking at an open source project for example on github that's considered a code base also any time you're on a software development team so if you get a job as a software developer generally you'll be working with a specific code base to make changes and to ultimately make them better thanks for watching join the conversation by subscribing to this channel or leaving a comment below and if you want to take your skills to the next level start learning at code academy today
https://youtu.be/7xaGRxiN75o















