r/learnprogramming • u/Temporary-Warthog250 • Apr 05 '22
Name one programming/comp sci concept you never understood and if you understand it, try to explain it to them
Name a programming concept such as virtual functions, pointers, certain algorithms, etc that you always had a hard time understanding and why.
Someone else who reads yours and does understand it, try to explain it to them to help them learn
1.6k
Upvotes
10
u/tzaeru Apr 05 '22
Consider a typical web application. It runs on a particular server. That server needs particular software to support the application.
Let's say your application needs Python version 3.6 and Postgres version 10.
You can manually install those on the server, but you would have to do that again for each server where you run your application.
Containerizing an application is a way of bundling the dependencies together. Instead of running your application on a server that already has the required components installed, you run your application as a Docker container which already has the required dependencies. So the server you host your application on doesn't need to know about Python or Postgres; It only needs to know about Docker. Docker takes care of all the dependencies required by your application.
This also makes it easier for you to run multiple applications with incompatible dependency requirements. Perhaps you have another application that requires Python 3.7 and Postgres 11. You could install those on the same server, but you would need to run the Postgres instance in a separate port and you may run into trouble with where Python3 points to. But if this application is also bundled in a Docker image, it doesn't matter - you just run that Docker image and again it takes care of the dependencies.