DEV Community

Cover image for  Why Linux Is Better For Programming 🤔
Elliot Brenya sarfo
Elliot Brenya sarfo

Posted on

Why Linux Is Better For Programming 🤔

What makes Linux really popular among programmers? Well, the answer is that there are actually lots of things, but I'm going to go through the major ones that I've found and they're generally accepted among programmers. They're about seven things that programmers, in general, appreciate about Linux.

The first one is; Security

This simply means that Linux tends to be a safer system, so you won't need antivirus software and viruses overall just aren't really an issue, so it's a really secure system and you won't get bothered by needing to find and pay for antivirus software and then update that software and get notified by it.

Linux just works and is safe. The reason that Linux is really secure is because of the fact that the Linux operating system is open source. This means that anyone who wants to can look at the source code for the system, and if you aren't familiar with this concept, then this may sound like it would be the opposite of safe since anyone can find vulnerabilities and create viruses for it or exploit the vulnerabilities really easily and that's not wrong.

Anyone can do that, and a lot of people do try to do this, but the thing is that Linux is a really popular operating system and that means that there are so many people reading through the source code every day and looking for these vulnerabilities that they can patch them themselves because of the fact that they are actually using the system themselves, so they don't want these vulnerabilities there and so they try to fix them. And so, what ends up happening is that there's actually very, very few of these vulnerabilities out there, and the ones that are out there had become really, really hard to find because so many people are actually looking for them and that also means that even if there are a few bad people out there looking for these flaws and trying to exploit them in a bad way for every bad person that's out there trying to find these flaws. There's potentially like 1000 good people out there looking for the exact same floor and trying to eliminate it, and so that kind of results in a really safe system.

The second reason is that; Linux can improve your programming workflow

The package manager in Linux is a godsend for programmers in terms of efficiency. If you want to install something or use something new, just type in “Sudo apt-get install” whatever you want to use, and then within a couple of seconds or a minute or two you get it and you're ready to rock. This is something that can sometimes be painstakingly difficult in other operating systems.

First of all, you need to install a package manager in Mac OS and Windows. If you want to have a good, reliable one and just doing that can be a difficult task for a beginner with Linux that just comes preinstalled and you're ready to go, and it also has a lot of packages already installed and set up alright, so let's take a really simple example here. That kind of illustrates both point number one of our security and also point number two about ease of use and just workflow in general.

Let's say that you wanted to install a VLC Media player on your Windows machine, or you have to do is you have first open up a web browser and then you'd have to find or like Google search for VLC media player, find the right actual website to actually download it. Go to that website, press the download link and start to download it. Run the exe file and then choose whatever like installation location and then after you've done all that you potentially also need to restart your computer for these changes to take effect or for you to be able to actually use the program.

Now, let's say that you wanted to do that exact same thing, but in Linux, all you have to do is open your terminal window and type in “Sudo app. Get install VLC” and hit enter and then you're done the windows approach leaves a lot of room for errors to occur. You could get to the wrong site and accidentally download malware, or you can get to the right sites but accidentally press one of the thousands of downloads now buttons.

That is actually an ad for something completely different compared to Linux where you just type it in and it automatically does everything for you making sure to get it from the right source so you won't accidentally get the wrong thing or malware. As a programmer we usually work with lots of different technologies and we're installing things constantly to get things to work, so making the process of installing stuff as easy as safe as possible is really important, and Linux does this really well.

The third reason is; no rebooting

This is something that I touched on in the previous point when I was explaining how installing something in Windows might work, and how at the end of that process you might end up having to restart the entire computer just to be able to work with whatever it was you installed, and this is not the case with Linux, and in fact, with Linux, it's to the point where you can update the entire operating system without having to actually reboot.

And this is neither possible with Mac OS nor with Windows, and it's something that I think is really important because of the fact that as a programmer we tend to install lots of different things, and so the ability to just be able to install something without them having to reboot the entire machine for those changes to take effect is something that I think is really important when doing research.

I found an article on the segment that talks about “Why Linux is often used for servers”, and there's no rebooting point was one of the reasons according to the article, why Linux is used for servers. This is something that they touch on in a part of the article where they talk about the fact that Linux is built for stability and reliability. Many Linux servers on the Internet have been running for years without failure or even being restarted.

The fourth reason is that; Linux actually comes with a ton of really powerful programming tools pre-installed.

Things like grip, Wit, gift crown, and lots of other things that once you learn how they work can be extremely powerful tools that again can help you improve your workflow.

This is a point that's highly individual, and it really depends on your specific use case because there are so many pre-installed tools that come with Linux and it also depends on what specific distro of Linux you choose to go with because certain distros come with certain extra tools like Kali Linux, for instance, comes with a lot of like hacking specific tools. So if you feel like learning a little bit more about these tools, you can check that out.

Number five on my list is; task automation.

Linux is almost built for the automation of tasks. I'm not an advanced user yet, I'm still learning and exploring the wonders of Linux, but more experienced Linux users who also know how to code rarely need to do anything twice because of the fact that Linux lends itself really well for automation. It pretty common thing in the Linux community is something referred to as one-liners, which is often used to refer to short little scripts that you write to automate a task.

You may find yourself doing three things in a row every morning as you start up your computer. Maybe you always open up Spotify to play a certain playlist, and then you open up your latest project that you're working on, and then you open up discord. With Linux. It's very easy to write a quick little script to automate. There are lots of pre-installed tools like we talked about in our previous point that lend themselves really well to automation.

The six-point is; performance

Linux is not necessarily faster than any other operating system, but it is very lightweight for an OS and it's compatible with pretty much any machine you can find you can run Linux on almost anything. So, this means that you can very often take an old laptop that is virtually useless because of being so slow and install Linux on that machine and all of a sudden breathe new life into that.

A machine that was impossible to work with before is now all of a sudden working really well. There are more performance benefits of Linux, like their reliability of the systems and other things.

Number seven is a bit of an odd one, but it is that; Linux actually provides you with useful error messages.

This may sound a little bit weird or whatever, but it is really important because with Windows and Mac OS where you often find yourself stuck with is an error message along the lines of like “oops, something went wrong” and it's not very useful because like Googling that and like finding the actual answer to that question. This is really difficult because lots of different people had that same error message for lots of different things, but with Linux instead.

What you'll get is a full readout of the actual processes, and you'll get like proper. You'll actually see what actually happened, and that means that it's way easier to actually Google that and find an answer to your specific problem and that is something that's really important, especially for programmers. When you're running into these errors constantly. Now, this also comes with the caveat that a beginner might not find that much help from these error messages, at least not if they've never spent time in a terminal-like interface. Because for a beginner this can be very intimidating and just seemed like a bunch of texts that also it's the same thing. But once you've spent some time in a terminal, these error messages are super useful.

Conclusion

So, in conclusion, there really aren't that many things that you can do on Linux that are impossible to do on other systems, especially if compared with Mac OS. But the overarching theme is the ease of use. As a rule, it's easier to do what you want to do on Linux than it is to do on other operating systems.

So should you switch to Linux? The answer that I like to give here is that you should probably try out Linux first in a virtual machine and then see what you think of it, and then you can kind of go from there because that's what I did. That's how I got started.

I started out with a virtual machine and then after a while I just found myself spending more and more time there than I did in my main OS, especially for like programming related tasks that was just so much smoother to do in Linux than it was to do in my main OS at the time, and so that's kind of my advice. That's how I would go about it.

Visit anythingprogramming.com for more interesting articles

Discussion (43)

Collapse
franjurinec profile image
Fran Jurinec

Been using WSL/Docker based Linux environments on top of Windows personally.
Having lightweight isolated Linux environments for each project allows for extremely clean dependency management. Especially if you have multiple projects on different dependency versions.

Added bonus being project dependencies are localized in the containers and don't bloat your main OS. Once you're done, the whole thing can be removed without a trace.

Collapse
ivanjeremic profile image
Ivan Jeremic

I use the same setup.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

That’s absolutely true

Collapse
petrof21 profile image
Bojan Petrović

What distros would you generaly recoomend for starting point beside Ubuntu? :)

Collapse
anotherishi profile image
rishio

Give a try to Void Linux.
It is lightning fast, very minimalistic, comes with an awesome package manager (xbps), and has an easy learning curve.
Moreover, the installation is so simple that it only takes about 5 min for the whole process.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Ok

Collapse
theawesomeguy47 profile image
TheAwesomeGuy47

Arch Linux after learning basics of Linux via Ubuntu is a good option. The learning curve isn't actually that bad, it's over exaggerated and the installation is quite self-explanatory and there are even tools to automate it for you.

Collapse
pandademic profile image
Pandademic

I absolutely agree! You might struggle for a bit , and then you'll enjoy the ride!

Thread Thread
theawesomeguy47 profile image
TheAwesomeGuy47

I started using Ubuntu as a VM to make yescoin (YES would be the shorthand term) but failed miserably. Then I moved to Arch VMs discovered how much I love Linux and spent like £200 (GBP, around $250 USD) to buy a 500GB SSD to dual boot Arch Linux with Windows 10.

Thread Thread
pandademic profile image
Pandademic

Nice!

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

You’ve a point

Collapse
hayden profile image
Hayden Rouille

Fedora is a good if you want to step up from ubuntu to something a bit more cutting edge, but still want the convenience of a widely used and easy to manage distro.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Ok

Collapse
cess11 profile image
PNS11

I'd recommend Debian, it's fiercely reliable.

A more important question is what window manager you choose. If you have more than one monitor i3wm is most likely the superior option.

Collapse
sigzero profile image
sigzero

Debian is my go to distro.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

It depends but currently I am having a good time with zorin OS 16

Collapse
leonardolpds profile image
Leonardo de Souza

Very good points, I first start with Linux just because is cheaper to buy a computer with Linux than windows, and I use this awesome S.O since I'm a child.
When I turning up a developer, all of that become to account, and also, use bash helps you when you need to access a remove server, because the servers in the most cases/companies are Linux, not only because of the reboots but because is free!

And once you are involved with the Open Source community there's no coming back.

Collapse
darkterminal profile image
Imam Ali Mustofa

That's the true wonderful ironic

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Maybe

Collapse
lexlohr profile image
Alex Lohr

Even though I am a Linux user for a few months shy of 30 years now, the operating system does not really matter that much. As long as I have vs code, enough web browsers to run tests and node and I'm fine. I'm still glad that my employer allows me to choose Linux, as it's my personal preference.

The only bad things about the other systems are a) in windows the file system convention of using backslash as a path delimiter and that b) Apple still hasn't agreed with everyone else on a sensible keyboard layout 😉.

Collapse
raguay profile image
Richard Guay • Edited on

I’ll have to disagree with the line that says you have to reboot to add programs to macOS. I’ve been using a MacBook Air and now a MacBook Pro since 2014. I have never had to reboot upon installing software, except for one program: Little Snitch because it has a kernel module.

I also use Docker with light linux installs as well when I need a setup that is different from what I have on my Mac.

For automation, I’ve found it easy with lots of tools on the Mac. Alfred for launching and controling my environments, Keyboard Maestro for doing visual screen hacks, Hazel to automate workflows on changes in the filesystem, LaunchControl to control the launchd daemon, and even more.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Linux would have been easier and simpler

Collapse
tythos profile image
Brian Kirkpatrick • Edited on

I feel like I'm reading a Slashdot forum post from 2001.

Mess around with Linux. Have fun with it. It's quirky, but worth learning.

But, no: if you are focused on locking into a single OS as "better for programming", you need to broaden your horizons: think about how many different ways there are for how many different kinds of code to run and solve how many different kinds of problems. Use the best tool for the job that you feel you know well enough to work with a sufficient degree of competence. That's it.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Well noted

Collapse
adam_cyclones profile image
Adam Crockett

Wow this is a very detailed post. I'm afraid I'm in the, here's a free MacBook camp that's been consistently in my life for at-least 4 years so A I don't have a choice, B I have just enough Unix to get by thanks brew 🙂

Also wondering if your response will be a single or two word reply 😂 just kidding you have done enough writing already!

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Mac is great 👍

Collapse
darkterminal profile image
Imam Ali Mustofa

Since I was in elementary school, my mother told me to study computers and my mother took her to a friend who really understands computers and she taught me many things, especially Linux.

I knew Linux before Windows and that sounds really weird to my friends. But I believe one day my strange knowledge will take me to the future.

And yes I am blessed by Tux!

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Interesting

Collapse
drsensor profile image
drsensor • Edited on

For me it can fit on anything and can be customized at lower level. I happen to have my own pocket dev environment using nanopi which literally fit in my pocket. As for customization,

  • I can manage, route, and even mux the audio output per application. Very handy for screen sharing
  • I can totally remap my input (keyboard/mouse) per device (e.g keyboard A will have different mapping and shortcut when plugged while keyboard B use the default mapping when plugged)
Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Will you recommend a beginner to start with Linux

Collapse
drsensor profile image
drsensor

As long as they are not gamer 😂
Properly setting Linux for running Windows game can be annoying for beginner.

Thread Thread
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Alright I get you

Collapse
siddsarkar profile image
Siddhartha Sarkar

Setting up a any dev environment will take seconds

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Yhh

Collapse
athifbinu profile image
Athif binu

iam a linux user becuce linux are better fast and no errors

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Linux is the real deal 🎯

Collapse
cavo789 profile image
Christophe Avonture

Hello. Did you know winget docs.microsoft.com/en-us/windows/p...
? winget is the equivalent of apt-get, it's core in Windows. Really unknown isn't it ? 😉

Collapse
pandademic profile image
Pandademic

Not at all! Most people know winget

Collapse
tarikoez profile image
TarikOez

It is free and reliable - that is enough.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Security wise 👍

Collapse
thefluxapex profile image
Comment marked as low quality/non-constructive by the community. View Code of Conduct
Ian Pride

You young bucks in the "industry" are becoming more and more dangerously incompetent each year. And you're out here filling the internet with nonsense so the very few rare actual young competent programmers that do come along are met with this nonsense first. Never trust a programmer who focuses on a single OS or who lets an OS control them rather than the other way around. This is a major reason almost all new software is subpar, but portrayed as evolving lol. A sick nightmare.

Collapse
elliot_brenyasarfo_18749 profile image
Elliot Brenya sarfo Author

Who hurt you? 🤔

Collapse
ginsburgnm profile image
Noah Ginsburg

That explains the new software, but why's the old software shit too? 🤔