
Ask HN: Why use Linux for coding? - pyeu
I&#x27;m learning coding. I use Windows. But I have heard that Linux is the best choice OS to start learning programming. What do you think?
======
jfaucett
I program on Linux here's why.

1\. Every library known to man exist for Linux and is very easy to install,
build from source, hack on, and customize, especially if you know what you are
doing. This is comparably easy enough on Mac since its Unix based but Windows
is its own beast when it comes to building from source and getting custom
libraries working, etc.

2\. You have complete control of your operating system and programming
environment.

3\. I don't program for iOS or .NET, so I don't need anything offered by other
operating systems for Development purposes.

4\. The languages I do program in have great ecosystems and development
environments on Linux. These are : Android, Ruby, Java, JavaScript, Python, R
and the occasional C/C++.

5\. I don't write desktop software and virtually all software I create is
deployed on Linux systems, so I write my code in a similar environment to the
one its going to get run in (exact environment using docker, vms, etc if
necessary).

6\. Finally, I'm philosophically much more aligned with the democratic and
decentralized spirit of Linux and Open Source than I am with closed source and
centralization espoused by Msft and Apple. Admittedly, if their products were
significantly better for my purposes as a programmer - I'd use them, since I'm
not a Richard Stallman, but this is still one of the reasons I continue to use
Linux. I think its a positive thing for the world.

------
mtmail
(duplicate of
[https://news.ycombinator.com/item?id=16384949](https://news.ycombinator.com/item?id=16384949)
from an hour ago)

Linux and starting to learn programming: if your goal is to learn programming
(python) then the operating system doesn't matter. I'd concentrate on popular
Python libraries. Switching from Windows to Linux will only grow the number of
unknown systems/pieces to feel uncomfortable with and add distraction. It's
fun to learn, just separate from programming.

I note you submitted 9 questions in the last day alone. This week 4-5
questions just which IDE/text-editor other developers use, the answers tend to
repeat. There will always be a better coding setup (grass is greener) and the
preference of editor is as old as programming itself.

~~~
acqq
Yes, looking at all the submissions, they appear to me to be generated by
somebody who tries to game the HN:

[https://news.ycombinator.com/submitted?id=pyeu](https://news.ycombinator.com/submitted?id=pyeu)

~~~
goblins
Giving the OP the benefit of a doubt I'm really just learning to program and
have many of the questions the OP has asked. Reading the comments to these
questions does actually help me make more informed decisions based on the
knowledge and experience of you guys. Gaming or not they are of benefit to
some.

------
brudgers
To the degree there is a better operating system for starting to program, the
operating system a beginner uses is orders of magnitude less important than
just sitting down and writing code. The best operating system for learning to
code is the operating system you are using.

The only certain thing Linux is the best operating system for is learning
Linux. Learning Linux is not learning to code. It is not a step on the path to
learning to code. Mostly, it is a distraction from getting started. There is
time to learn Linux
later...[http://norvig.com/21-days.html](http://norvig.com/21-days.html)

Good luck.

~~~
craftyguy
I disagree. The best operating system to use for learning to program is the
operating system that stays out of your way, allows you to easily install your
dev environment, and allows you to keep things reasonably up to date. For me,
that's using Linux.

The last thing I want to do when learning a new programming language is waste
a lot of time trying to install all of the dependencies/libs/compilers, being
nagged by the OS to reboot because updates were installed, having cortana
randomly pop up (it's like the modern day clippy), and deal with a host of
other things that windows does to get in your way.

~~~
brudgers
Over time, a person's needs change. The argument that Linux is the best
operating system for learning is equivalent to one that
Emacs/Vim/Eclipse/VScode/PyCharm/etc. is the best editor/IDE for learning to
program or that Python/Javascript/C/VB/PHP/Java/etc. is the best language for
learning to program.

The important part of learning to program is sitting down to program and
sticking with it despite its difficulty. Developing habits of mind is what
makes a person a programmer. A lot of beginning programming resources are OS
agnostic because they run _on the web_ and Firefox/Chrome/Edge/Safari/etc. are
fungible (and of course HTML/CSS/Javascript are also OS agnostic).

------
xet7
I installed Nim programming to Windows 10. Windows Defender deleted it
immediately. [https://blog.wekan.team/2018/02/time-well-
spent/index.html](https://blog.wekan.team/2018/02/time-well-spent/index.html)

Quote from Windows Weekly 557 [https://twit.tv/shows/windows-
weekly/episodes/557?autostart=...](https://twit.tv/shows/windows-
weekly/episodes/557?autostart=false) "Future of Windows apps is to have Visual
Studio on Mac and deploy software to Linux Docker containers."

There is no Windows servers anymore at top 500 supercomputers. It's all Linux.

------
amorphid
Almost all developers I personally know use a Mac. I know a few that use Linux
on occasion. I personally know of no developers that actively use Windows for
writing code. However, I'd argue that using the OS you use for development is
less important than understanding what is happening when you run software on
any platform.

Ultimately you'll need to deploy software somewhere, and you will need to
understand what is happening when the software has a problem. You often won't
have a choice about the operating system on which your software is deployed,
and you will still be expected to understand the OS well enough to work with
it.

I say focus on understanding what is happening to the extent that you can.
Always be curious. Always learn. Always strive to learn what question you
should be asking to get the answers you seek. And when the trusted advisors &
Google fail to answer your questions, that's where the real adventures begin.
And, if you'd like to make money, don't forget make find a way to get paid.

------
ry4n413
I've been "coding" full-time for two years now and I use Windows as primary
operating system, the biggest issue/pains that I've experienced is:

1) Most of the tutorials online are written for linux 2) installing
dependencies on windows is a bitch sometimes (75% of time I can get stuff to
work on windows other times I give up because of lack of availability of
certain packages and compiling issues).

It's my opinion that you will eventually need to learn how to operate in
linux, so what I'd recommend you do to help with learning: \- Install Hyper-V
if you have Windows Professional, this way you can install various linux
distros (start with ubuntu, then debian, then centos possibly). \- install
Bash for Windows \- install docker for windows

[http://www.evernote.com/l/AUkyLCQy0YJFQYIxEsVqV1nD1fUEpd4Uqf...](http://www.evernote.com/l/AUkyLCQy0YJFQYIxEsVqV1nD1fUEpd4Uqfg/)
^ how to turn on hyper-v and bash for ubuntu on windows

------
matt_s
For learning how to code, you are perfectly fine on Windows. You are going to
read lots of technical arguments in here about why you should use Linux or a
Mac. You are learning how to program, so once you progress outside of an
editor and compiler and want to learn more about a certain specialty you may
want to investigate things related to that specialty.

The reason Linux is used a lot is that a lot of software development is
writing web applications which typically run on Linux on servers. You can
explore Linux on your Windows machine using tools like VirtualBox to create a
virtual machine running Linux. You don't need to dual-boot, reformat your
system, or spend any money to learn it.

What flavor of Linux should you learn? It doesn't matter for just starting
out. You could post a question and get lots of technical arguments about one
vs the other.

For a lot of technical topics, the same concept applies - you are in a
learning phase, pick a common one (programming language, operating system,
etc.) and learn using that. Once you reach a comfort level and feel confident
you can "get things done", investigate differences between what you learned
and other options out there.

------
danschumann
When I started coding, I installed linux one day. I didn't use windows again
for like 6 months.

It seems to open up a new world, where you can program what you need to use.
Sure you can do this on windows, but on linux it feels like you're closer to
the smell of sawdust.

Also, when you likely deploy your server to something like AWS, it'll probably
run on linux, so there's that consistency.

You feel like you live inside the internet. Because the internet runs on
linux.

I'm typing this comment from a debian laptop. This laptop isn't super fast,
but debian makes it seem totally fine, whereas windows makes it sad. (speed
boost).

I'm thankful when I use linux. When I see all the lines of computer code at
startup and during install, I think of all the time someone put into that,
wow, so glad.

------
zxy_xyz
I stopped using linux this month after 3 years. I'm a game programmer and I
want to do casual things and get productive work done. I had appreciated linux
for the speed it gave me when i had a slower PC. I could do more quicker and
customize it a lot. The cost was that with the less bloated distros, most
things didn't work well and had very few sensible solutions. Linux overall is
terrible for casual users and productivity at the expense of a lot of time
configuring it.

As a game dev, i like to play games as well and there are a fair bit that are
windows only. The only wine app that worked was lutris. Everything else
crashed with vague errors and no info online. Even then, games were slower (as
expected) and often had errors. John Carmack had made a post before that he
doesn't really see Linux as fit for gaming and that effort should be put into
making wine better due to how few people on linux make up sales sales and I
agree.

The community can be quite unhelpful as well. A lot of people are elitist and
use their ego to bash people's choice of software or at their problems getting
things working. There are a lot of genuinely helpful people as well though,
just not as impactful.

I think linux will have a place in tech like servers and lightweight gadgets
like Android, but not for every day use. And I've used Linux every day before.
Instead of making multiple distros that due some of the same thing, the
community could have focused on solid high quality apps to become competition
to windows. Ubuntu is the best thing to that and even that isn't very usable.
Using Windows, things just work. I'm uncomfortable with how Microsoft treats
users but was more willing to put time into improving privacy and interference
on an OS that can last. I'm still an advocate of linux, but only when it's
needed.

------
bediger4000
Because a develper can keep GUI code or whatever out of the way. Because a
developer can get tools for free, without having to justify the purchase to
managers, directors, etc etc. Because a huge range of any given tool is
available, from compilers to interpreters to text editors to testing
frameworks. Because Linux distros aren't full of bad design decisions, like
carriage return/linefeed end-of-line markers, drive letters, and magic device
names that can shoot you in the foot very easily. Because developers can
generally look at the source code of everything to figure out if the developer
made a mistake or the underlying code has a mistake. Because Linux distros,
unlike Microsoft, generally don't believe that they know what developers want
to do/need to do, and don't prevent certain actions. Because developing on
Windows puts you one patch Tuesday from your product being a DLL in Windows.
Because freedom. Because good taste. Because Windows isn't very customizable.
Because Microsoft does not document the real Windows system call
interface/ABI.

------
vmishra
Reading this on Mint Linux machine. I had used Windows and Mac almost all my
life up until I joined a startup about 2 years back when I was given a 16gb
128 SSD Dell laptop with Mint 18 on it. TBH I was not very excited initially
But fast forward 2 years I can now say with a fair degree of confidence that
there is no going back for me ever. One can possibly do everything and only
better and faster on a Linux like Mint running on good hardware. I can only
say this to fellow developers if your job is to write code or scripts or
automation on a day to day basis Linux is the place to be. You'll get better
every day, effortlessly. I reboot my machine every once in a few months and it
has never ever crashed on me, It hanged once I plugged a specific projector
one time but I could recover it without full reboot, and to put things in
perspective I install and uninstall pretty crazy stuff on almost on a daily
basis and it wakes up from hibernation in just about 5-8 seconds.

------
marpstar
If you're new to programming, and you're already a proficient Windows user,
stick with Windows. The main advantage to developing with Linux is the vast
availability of free and open source tools for writing and compiling code.

10 years ago the situation was a lot different but now even Microsoft is a
huge proponent of open source development tools.

------
bitwize
Because Windows is now an OS-as-a-service, except running on your own damn
computer. Meaning you ultimately don't control the OS, or your computer. As an
open-source kernel and OS stack, Linux gives you that control back.

Ceding some control for putative convenience might -- MIGHT -- have been
justifiable in the 90s. But it's 2018, Linux graphical shells are on fleek (if
that's your thing), and your only excuse is if there's some app you NEED which
requires Windows and doesn't work with Wine. Which isn't a problem for
developers, except on a few proprietary platforms (like iOS).

Defaulting to Linux as you learn to develop software will build the skills
you'll need to remediate the "software to do X is not available on Linux"
problem should you come across it.

------
he0001
I code on all three platforms but whatever I do I keep ending up in Linux just
because it’s so more powerful and useful (but hard). Second best is macOS even
though lately it’s been a suck fest. I have coded in Windows for Windows but
it’s clunky, awkward and riddled with bad APIs. If you don’t want to know what
a machine does or appropriate problems, chose Windows. Also it doesn’t give
you the mechanical sympathy which Linux breathes. Linux is better if you want
to run something with raw technologies. Sure it’s harder to learn, so macOS is
a better starting point, if you can afford it. Also I think Linux is a lot
less opinionated than the others which means it’s easier to come up with your
own ideas.

~~~
Accipitriform
I agree except I might swap macOS with Linux, because there's a lot of helpful
macOS-only software, a good selection of proprietary software, and I think
macOS is generally easier to deal with.

I recently moved to a job where my development laptop is Windows-based, after
having a Macbook Pro at the last gig (I'm told we're working on getting Macs
for developers). Windows 10 is still pretty bad in a lot of ways, large and
small. Not having homebrew, apt, or yum to manage packages is a pain. I'm
using elementaryOS running in VMware Workstation as my primary dev environment
for the time being...

------
BjoernKW
Because of the generally superior command lines and command line tools you get
with UNIX and UNIX-like operating systems like Linux or macOS.

Recently, Windows has somewhat caught up in that respect but so far nothing
beats a native Bash (or similar shells) environment.

------
andrei_says_
Because windows 7 will simply never be fully compatible environment for ruby +
gems with native extensions.

So I prefer to run Linux in a vm and focus on coding vs. trying to fit a
square peg into a round hole and spend my time o troubleshooting the
environment.

------
dragonwriter
> I'm learning coding. I use Windows. But I have heard that Linux is the best
> choice OS to start learning programming. What do you think?

There are a number of interesting technologies that have better supported dev
environments and less frustration for the inexperienced on Linux, but there is
plenty you can learn and do fine on Windows, and that avoids the cost of
learning a new OS just to learn the basics of programming.

Linux can wait.

(Note, if you have a particular thing you are learning for, and the best tool
for that is heavily Linux -- or, at least, UNIX-like-OS -- biased, you might
want to learn Linux early on so you can use it, but otherwise, there's time
for that later.)

------
chaoticmass
I was already a coder long before I learned to use Linux. It was a steep
learning curve to jump into Linux. I'd say it was worth learning absolutely,
and now with 13 years experience with Linux it is my favorite OS to code in.

But if you're just now learning to code, focus on that and use whatever OS you
are already comfortable with.

With that said, when I made the switch to Linux, I also decided to learn C. So
I had two new things to learn and both had a steep learning curve, but C and
Linux go hand in hand and are complementary skills. It was a lot of fun.

------
goodoldboys
It's the best OS for me because I containerize as much as I can (I use a
separate docker-compose file for every client, for example). I've tried Docker
on Mac, Windows and Linux, and it _just works_ on linux. The others were a
major pain.

The added benefit of doing it this way is that I'm not really tied to a
machine - all I need to do is clone my repos onto a new machine and I'm
basically good to go.

------
collyw
Depends on what you want to build. iOS software and you will need a mac.
Microsoft stack and you will need windows.

If you are doing more general web development then there is a good chance you
will be using a Linux server so it makes sense to learn it - your dev
environment will be more similar to your production environment. There is
plenty of open source software and material available so you can try things
out.

------
potta_coffee
I like Linux for programming because a lot of the tools you're going to use
originated on Unix like systems and are easier to setup and use. It really
depends on what kind of programming you're trying to learn though. Are you
going to use C#/.NET/ Visual Studio? Then stick with Windows. Personally, I
think setting up environments for Python, C, MySQL is better on Linux.

------
farhanhubble
One compelling reason for using Linux is the availability of an incredible
number of command tools that can be combined to automate just about task.
Recently I had to download about 2 million video clips, extract audio from
them and do this parallely using some 40 threads. I used an openly available
script that uses youtube-dl, ffmpeg and gnu parallel to do exactly this.

------
davelnewton
Somewhat- _shrug_.

For me, Linux (or even OS X) is better because in general building existing
packages is easier than on Windows. A lot of tooling is built on Unix-y
platforms: to use Windows you have to play a lot more games.

To be fair, Windows has _vastly_ improved its support for many of the most
common tools, and cross-platform development has advanced enough that it's not
the major issue it once was.

------
neilsimp1
I'm going to play devil's advocate and say that a lot of the things people are
saying on here as pros for Linux are capable on Windows with the Windows
Subsystem for Linux. At least most of what a beginner would use, anyways.

But to actually answer your question, one of the things I like about
developing on Linux is deploying onto a Linux server is a lot easier.

------
znpy
Eh. Everything is basically just there, or very very easy to get (just apt-get
it). It's very easy to have a working development environment that doesn't get
in the way.

Plus, every aspect of the operating system is ready to be explored, if you
want. If there's something you don't like, just change it, rebuild your
program, and you're good to go.

------
stealthcat
Because Linux font rendering is awesome. MacOS is about as good. Windows
Cleartype is not even close.

You are going to read code all day -- that comfy feeling when reading them is
important

------
bjourne
Linux gives you control. Compare compiling C++ code with Visual Studio vs.
gcc. Yes, it is easier to get started with VS but you don't have as much
control. With gcc (and my build tool of choice) I can control every step of
the compilation and linking process.

It's "learning what's under the hood" \- which I guess is an expression that
comes from auto mechanics. To really learn how cars work you need to open the
hood and interact with the engine.

~~~
jetti
>Compare compiling C++ code with Visual Studio vs. gcc.

That is not a valid comparison as Visual Studio is an IDE and gcc is the
compiler. It would be no different if you were using CLion from Jetbrains on
Linux to do C/C++ work. The compiling would be handled all through the IDE.
You are more than able to get down and handle building C++ from command line
by using cl

~~~
bjourne
I know you can use cl.exe directly, but it is not the same. For example, you
can't even suppress its output completely.
[https://social.msdn.microsoft.com/Forums/vstudio/en-
US/9eabe...](https://social.msdn.microsoft.com/Forums/vstudio/en-
US/9eabed6b-8bae-4c86-a8d8-c7fc2c8e6ed2/clexe-how-to-suppress-filenamec-and-
creating-library-filelib-and-object-fileexp?forum=vclanguage)

~~~
planteen
As much as I dislike MSVC, I'm still not sure that's a fair comparison. I've
used cl.exe in large, complex makefiles to build programs that could also
change CC and CXX to gcc or clang. And as far as output suppression goes,
couldn't you pipe it somewhere else? I've had to do the same trick on Linux
utils (pipe to /dev/null).

~~~
bjourne
For fucks sake! OP asked and I gave him some FREE advice. He doesn't give a
shit about the output of cl.exe (it was just an example...) so what's the
point of these annoying nitpicks? It makes me want to stop commenting. For the
record, NO you can't pipe it somewhere else:
[https://stackoverflow.com/questions/1453767/prevent-cl-
exe-f...](https://stackoverflow.com/questions/1453767/prevent-cl-exe-from-
printing-the-compiled-source-file)

------
notyourday
Since stuff that I write runs on Linux I use Linux for everything.

