r/learnprogramming • • 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

738 comments sorted by

View all comments

Show parent comments

6

u/painted-biird Apr 05 '22

This is kind of in the same vein, but what is the difference between virtualization- ie using VMware to run Red Hat on my Mac- and virtualized containers à la Docker and Vagrant? I’m so confused about this (yes, I’m a total noob- only studying Unix/IT since December), because as I understand you can spin up an OS in Docker and Vagrant…

15

u/Avastz Apr 06 '22

Docker was born from the thought process of people famously saying "well it works on my machine...why don't we just ship them my machine." And they did.

Think of it as their name/logosake, shipping containers. Whatever is inside the shipping container is shipped off somewhere else, then eventually delivered, everything (theoretically) still enclosed and safe inside. That's what's going on, except it's software and the necessary pieces of an OS and other dependencies to get that software to work.

0

u/[deleted] Apr 06 '22

[deleted]

3

u/painted-biird Apr 06 '22

Hmm, b/c when I've spun up Ubuntu on Docker, it had /etc files and whatnot- I don't recall it having all the utilities that my virtualized OS had, but it had a great deal of them- which is what I think added to the confusion. As a disclaimer- I'm not really focusing on programming right now- mostly learning *nix, CLI and Bash scripting, with a VERY small amount of Python, so maybe I don't know enough about programming and development to really understand containers and their purpose. I also think I just need to play with Docker/Vagrant some more and I'll likely/hopefully learn from just fucking w/it- just kind of difficult when I'm in my late 30s, trying to finally finish my degree while learning IT and finding literally everything fascinating lol- I sincerely wish I had gotten into IT when I was a teenager or even my 20s!

Thanks for the reply, btw!

2

u/DevDevGoose Apr 06 '22

In effect there isn't really any difference between the two. They both virtualise the environment in an attempt to provide benefits like isolation between applications.

However, docker virtualises at the container level which doesn't include the OS while obviously VMs do virtualise the OS. This makes VMs much heavier to create and pass around. Containers can be spun up and discarded in seconds whereas VMs take minutes. This is important for improving the workflow in development and for scaling out to meet production performance burst requirements.