60

Why is writing a program in text files or via the terminal a better option (as I read) than using IDE(s) like Visual Studio on Windows? Do the features an IDE provides exist there (eg. showing compilation errors) or is it a manual process?

11
  • 16
    Some people have been doing programming for a long time, and have come to be highly effective at doing what they do from a text-driven command prompt. They might also find editors like vim to their liking. This is a very subjective area! Many people use IDEs on Linux though, so you're conflating multiple things here.
    – Warren P
    Oct 17, 2013 at 13:53
  • 3
    I believe IDEs are not the main point of the question. There are plenty of IDEs for linux OSes. For example all the JetBrains IDEs(IntelliJ/PyCharm etc.) work on linux. Eclipse works on linux. QtCreator works on linux.
    – Bakuriu
    Oct 17, 2013 at 16:00
  • 12
    This question being on this site is going to suffer from confirmation bias.
    – zzzzBov
    Oct 17, 2013 at 21:50
  • 5
    In an effort to keep question clean of meta-discussion, I have opened a separate Meta topic to specifically address it.
    – Oli
    Oct 18, 2013 at 8:13
  • 4
    Please rephrase this question to make more sense, in particular the title. Ubuntu doesn't force you to avoid IDEs and stick with text editors for software development any more than Windows does. Oct 19, 2013 at 13:32

13 Answers 13

87

This sort of hypothetical might do better on Programmers.SE because it's likely to be pretty one-sided here. That said, I was a .NET developer for a few years and came to depend on Visual Studio. It does a lot for you and yes, I particularly like the integrated debugger... However, I think there are a few reasons people choose Linux:

  • Ubuntu is free. Windows and VS can be extremely expensive.

  • Ubuntu is free. Windows and VS give you very little control over how you use them.

  • Ubuntu is a programming environment straight out of the box. Tools like Bash, grep, sed, awk. Windows is historically a big pain in the bottom to script from. Batch files are awful and even with PowerShell, the command-line experience in Windows pales into insignificance when compared to Bash and the GNU tools. You can port some of that over to Windows but it's not the same experience.

  • Complicated setups are easy to automate and replicate through apt-get, tools like Puppet, Chef, Juju, Fabric and simple scripting.

  • Some things don't need complicated IDEs. I'm a Python developer these days and I'm perfectly happy with its own built-in tools and debugger. I use a text editor, the command line and fabric... And I'm way more in control than I was under .NET. I can build, test, commit and deploy my webapps with a single Fabric command.

    That's not to say there aren't monolithic IDEs. Eclipse and Netbeans. MonoDevelop. KDevelop4 and QT Creator. They all have their users who swear by them.

Is Ubuntu better for you? Who knows. It's a very capable and very customisable system. If you give it a chance and alter your workflow to allow it to help you, you should be able to make it stick.

13
  • 18
    "Free" is both about cost and hassle. I use a Mac, but a tool like Vagrant makes it easy to set up a clean Linux VM for any project and discard it when the project is done. "What do I want?" is the only consideration, not "do I have a license key for this OS and how do I get it recognized...?" Oct 17, 2013 at 13:12
  • 14
    +1 For staying objective when so many people find it easy to have a knee-jerk "Windoze sucks at everything" attitude.
    – Phil
    Oct 17, 2013 at 14:24
  • 2
    One thing that should be noted, the visual studio is more free than it used to, it has supported MAKE files for a while now and plugins let you write and debug cygwin applications entirely inside Visual Studio. Oct 17, 2013 at 16:21
  • 6
    even PowerShell scripts lack the power of Bash - I'd argue that you don't know PS very well then; it's immensely powerful and I haven't met anything that you can do in Bash that you can't do in PS Oct 17, 2013 at 20:55
  • 4
    @MarkHenderson Yeah it's almost certainly through not using it enough. It was introduced just as I was leaving Windows and .NET behind me. I think Bash (and by "Bash" I really mean GNU) took with me because you use it everywhere and for everything. PS required so much Googling every time because everything was just always super-specialised. It's honestly hard to say after so long with Bash.
    – Oli
    Oct 17, 2013 at 22:36
37

I would like to add one more important reason though; Ubuntu is great for experimenting with new libraries, languages, IDEs and compilers. Everything is one apt-get away.

So you've heard about a fancy language called Haskell:

sudo apt-get install ghc
nano hello.hs
<copy-paste hello world example>
ghc -o hello hello.hs
./hello
Hello World!

Oh, you've heard a fancy editor for Haskell:

sudo apt-get install <fancy-editor-for-haskell>

The same with C/C++ libraries, you just apt-get install them and the binaries and the headers go to the right folders, and you can just #include them in your source files without even needing to check where they get placed!

In essence, it's not about how fast you can setup your day-to-day working environment. It's also about how extremely fast you can setup an experimental environment. I believe that's what accelerates the learning experience under Linux.

14
  • 36
    apt-get, and the mentality that everything must be installable that way, is maybe the best thing about Linux. Neither OSX nor Windows compares here. Oct 17, 2013 at 13:14
  • 11
    Yes, but you have to fetch each application's installer manually: the fact they use the same installer inside doesn't buy you much (it saves them some effort). That's not the same as a built-in package manager.
    – Useless
    Oct 17, 2013 at 14:53
  • 2
    @NathanLong I just did the exact same thing using Macports: sudo port install ghc. Freshly compiled from the sources. The MacPorts Project currently distributes 17699 ports. One difference is that it always compiles.
    – alecail
    Oct 17, 2013 at 15:39
  • 2
    @karadeniz: And that's not to mention yum, pacman, emerge, petget, pkgadd...
    – Aesin
    Oct 17, 2013 at 22:32
  • 2
    I like MacPorts (and maintain a couple of packages there and on Homebrew), but it can't really compare to Debian. These smaller projects just don't have the person-power to maintain a large repository to the same standard. The same goes for cygwin and coapp on the Windows side. The key difference is cultural, I think, the linux package managers are part of the system and are used for everything by everybody, they are not a slightly-neglected backwater of add-ons.
    – jcupitt
    Oct 18, 2013 at 8:49
20

Here's an opinion from a primarily Microsoft platform developer. If you're not targeting the .NET ecosystem I would argue that your best option is Ubuntu. You will have a much easier time obtaining, configuring, and using tools for almost every other platform/language if you are on Ubuntu instead of Windows.

The value of Microsoft's toolchain is that it is HIGHLY integrated. From the IDE to Source Control, Project Management, Build, Deployment, Database, Cloud Infrastructure, ad nauseum. Microsoft makes it VERY easy if you're going full-bore with their platform.

As some have mentioned, deviating from the Microsoft Way can be a pain. Using .NET for your code and Oracle for your database...d'oh that's gonna be a pain.

Want to create an .NET web application and deploy it to Amazon Web Services...not very straight forward.

But if you stay within the Microsoft Ecosystem...that baby will sing like a mocking bird for you. In the hands of a competent software developer, the Microsoft Platform is like PEDs for a talented athlete. It's not going to enable an amateur programmer to create the next Facebook. But it will give an edge to a talented developer who understands how the pieces fit together.

The argument for the free (as in beer) cost of getting started with Ubuntu is out the door, there are a number of programs Microsoft offers that let you get started with their tools for free. Including Bizspark which gives your startup company 3 years of licenses (including production use licenses of their tools). And Dream spark which gives it to students for free.

That being said, if you want to explore and learn new languages and platforms, you'll find better tools to get started on Ubuntu and if you're looking for work outside of the Microsoft ecosystem, you're going to need to be familiar with Ubuntu.

2
  • 7
    Yep, I agree. After writing low-level C/Unix code for a while on a Linux environment, I decided to take a break and do some C# graphics development, fired up the new VS, and, well, it was liberating, to say the least. It's not as flexible but it sure makes things easier if you don't mind selling your soul to Micr.. uh, I mean, expanding your horizons!
    – Thomas
    Oct 18, 2013 at 7:34
  • 3
    Yeah +1 for a welcome antidote to half-informed anti-MS sniping.
    – Alan B
    Oct 18, 2013 at 8:38
15

I use both tools, IDEs and text-editors with Command-Line Interface (bellow referred to as CLI), to write programs.

What Linux offers is a useful CLI starting from the default installation. If you don't need that and you are just using an IDE anyway, then there isn't much of a difference anymore (IMHO).

IDEs

  • IDEs are very good when it comes to integrating many features and present them in a graphical GUI.
  • The downside is, it can overwhelm someone new to this. Now you will have two things to learn: the IDE and the programming language.

Text editors and CLI tools

  • Text editors and CLI tools don't take long to learn.
  • If something doesn't work, it is easy to see which tool doesn't work as expected.
  • It easier too look up problems with Google as everything is text-based.
  • Programming with text editors and CLI tools is faster and more responsive, especially comparing them on older hardware.
  • You can work with them even on low resolution screens.
  • It allows you to program and debug with minimal resources on a remote server.

I often do my prototyping with text-based tools. Later, when there are more files to manage, I value the refactoring tools an IDE is offering me.

7
  • 8
    For future reference, CLI is an abbreviation for command line interface. CLI typically refers to an interface like aptitude which is similar to a GUI, but in text. Vim would be a CLI editor, but grep would not be CLI, it does not have an interface (it would just be a command line tool)
    – kiri
    Oct 17, 2013 at 12:01
  • The disambiguation is good. Coming from a Windows programming background CLI could stand for Common Language Infrastructure.
    – jltrem
    Oct 17, 2013 at 13:52
  • I use a GUI to develop GUIs, and a text editor to develop CLI or text-based programs/content. I would never try to write a GUI-heavy business application in Vim, Visual C# makes prototyping such things effortless. Similarly, I would never do web development (PHP/HTML/CSS/JS etc.) in an IDE on Windows, because doing it in Vim on my web server is infinitely more efficient and convenient.
    – Dan
    Oct 17, 2013 at 15:05
  • @minerz029 CLI is grep-style programs (one command [line] at a time). You're thinking of "console applications", which is aptitude/vim-style.
    – Izkata
    Oct 17, 2013 at 21:44
  • 4
    @minerz029 The interface for grep is the arguments, stdin, and stdout - the word doesn't imply anything graphical or pseudo-graphical. Other types of interfaces include web APIs, serial protocols, and so on.
    – Izkata
    Oct 17, 2013 at 23:23
12

I'll throw my answer into the ring (though I believe these all are good ones too).

The most basic answer you can get is that it's all about philosophy.


In the Microsoft world, it's a bit religious - You have the gods on Mt. Redmond who must be petitioned if you want anything implemented. Sometimes they will listen, other times your sacrifices and pleas will fall on deaf ears. Perhaps they were out hunting. Microsoft controls the entire ecosystem - they own the OS, they own the IDE, and they couple them together in ways that are probably inappropriate to talk about on a SE network. Even within the IDE pieces are tightly coupled - it may be called integrated but I think coupled is more accurate. If you would like to change things up a bit, Gates forbid that you would want to alter something in a way that either the designers of Windows or Visual Studio did not expressly allow. And then throw in technologies like IE, and IIS, Microsoft servers, and MS SQL Server, and Office... and everything is a nice big happy family. But if you should want to leave part of the family behind? shudder!


On the other hand, you have Linux, which inherits from the Unix philosophy that each piece should be responsible for its own small sphere of responsibility. It should do one thing, and do it well. And preferably, communication should happen by way of strings of text. As others have pointed out, sed, awk, grep, etc. are perfect examples of this. They do the one thing that they are designed to do, and they do it very well. If you need to do two things, then you combine the two tools. Which is very easy to do.

Because sed expects nothing besides the input coming in will be text, that means that anything that can produce text does not have to reinvent the wheel. They can simply use sed. And because sed produces text, anything that can read text can use the output from sed. Text is very universal (there are some exceptions to this), and it's very easy to combine these types of things together.

Not only is it easy to combine them, but it's also very easy to split them apart - if I decide that I no longer need to edit a stream, but I want to filter the results, rather than passing my text to sed, I can pass it to grep instead.

Now, this is the fundamental philosophy behind development in a Linux environment - so even if you go up from there, many tools provide similar sorts of interfaces. They allow you to decompose them into parts, or interface with them through the command line or ports or HTTP.

And even if that were not the case, you also have open source software. Most (if not all) software on the Linux platform is open source. So if you don't like how it's written you are completely, totally, absolutely able to change the software yourself. This is incredibly empowering. Can't break apart that IDE the way you want to? Either make the changes and submit them back upstream, or fork the project. Not sure why something behaves the way it does? Use the source, Luke! Need to be able to automate something through the command line? Hack on the project and stick your changes in. Come across a bug, or a security issue? Hey guess what - you can fix that yourself, you don't have to wait for SP3.432vb89234.startdate1eQ to come out.

You can combine the tools that you want and you need. And if there's something that is in your way, you are 100% able to get that changed. Even if you don't have the capability, you could certainly pay someone to develop that change - or even suggest it to someone else who has the know-how.

The reason this is better for programming is because when you come across friction, you can eliminate it from your workflow. Because development is hard there are a lot of things that you have to think about to be a successful programmer, and the more you have to think about the harder it is to think about other things.

Eliminating friction is key.

So if the Microsoft ecostystemreligion is where you feel at home, and you enjoy the tools so much that it doesn't provide you with much/any friction... well, it's probably just fine then.

But if you don't fit the Microsoft Mold(tm), patent pending, then you will run into friction. Development will be a pain. Each time you wish you could do something, but can't, that will drain precious cognitive resources. And if that's the case, then a Linux development environment is probably for you.

2
  • 1
    I really enjoyed the essays you linked, thank you. Oct 18, 2013 at 9:33
  • 3
    Praise Balmer, and may all his Parity Bits be set correctly. ACK. ACK. ACK.
    – Warren P
    Oct 18, 2013 at 23:45
9

I'd like to provide my more general thoughts to the question:

"Why is Linux a better environment for programming?"

I think the most important reason why to develop on Linux is because you have full insight into most software internals. You are able to learn how things actually work if you are interested. That allows you to learn and adapt good or bad practices by seeing them in action. This allows more diversity for your ideas.

4
  • 2
    Good point. Open source is a natural benefit to all developers who have any kind of curiosity. On windows, it's turtles all the way down!
    – Warren P
    Oct 17, 2013 at 13:56
  • That's a good point. You have insight into the internals of a software here
    – Anwar
    Oct 18, 2013 at 5:52
  • Lots of Windows developers will work their whole working lives on the Windows platform, programming against an API they will never see the other side of it. Kind of a prison for the mind, don't you think?
    – Warren P
    Oct 18, 2013 at 23:43
  • @WarrenP If an API is properly documented, then you're not going to learn more about it by looking at the source code. (Though I admit many APIs are not fully documented, in both worlds.)
    – svick
    Oct 20, 2013 at 18:34
8

Why Linux is better for programming

IDEs

Besides Visual Studio and Xcode, which serve their specific purposes, most popular IDEs are multiplatform. It might seem like there are gazillion IDEs for dozens of languages, but in the end most of them are based on either Eclipse, IntelliJ IDEA or NetBeans. What they have in common is that they are all Java-based. Java works more efficiently on Linux, than on any other OS on the same hardware. In fact, Java is as much as 20% faster on Linux, than on OS X on same hardware. Many of these IDEs are ready to install with one click in Ubuntu Software Center.

Compiler

GCC has very much become industry standard. Beyond any doubt its primary platform is Linux, where it's best supported. And it's free and royalty-free.

Additional tools

Linux provides unique tools, not available on other platforms, like for example Valgrind (a tool for memory debugging, memory leak detection, and profiling). Linux also comes with debugging tools such as strace and ltrace, which can be used to debug even production code (i.e. not compiled with debugging symbols). Equivalent tools for Windows are either non-existent or very expensive and do not provide the same functionality.

Ease of installing OSS

Ubuntu has an excellent package manager. In most cases installing software is just apt-get install package-name (you can do it with GUI too, either Ubuntu Software Center or Synaptic). Once installed, they get automatically updated by the system with bugfix releases. The package system also automatically keeps track of dependencies, so you don't have to worry about other packages needed; they will be installed automatically.

On the other hand, in Windows you have to manually download and install packages, and if they require some other packages, you have to do that manually too. There is no system wide updating either, each software package either implements its own annoying updater or does not update at all.

Production machines are very likely to be Linux

If you doing any kind of programming for back-end, for web, for cloud, etc. it's very likely that your target machines are Linux. There are lot less nasty surprises when you're developing on same kind of OS as your target machine.

Of course, you might be developing a desktop application for Windows, but nowadays this is kind of a niche job market for programmers.

4
  • Desktop apps for Windows are a niche market? Wha?
    – Alan B
    Oct 18, 2013 at 10:39
  • 2
    @AlanB: No, programmers of desktops Windows apps are niche. Estimated 90-95% of programmers are doing in-house development, and these are mostly not desktop apps. Also, just think about it, when was the last time you've bought (as in paid actual money for) a Windows application, that wasn't a game (nor Adobe product for that matter)?
    – vartec
    Oct 18, 2013 at 11:24
  • As far as I can see almost everything in the business space is still resolutely desktop-based and paid for, despite cloud-centric companies continually claiming otherwise.
    – Alan B
    Oct 18, 2013 at 15:11
  • 4
    @AlanB: again, I'm not talking about market of end users. I'm talking about job market for programmers. For example one of the applications you're talking about is MS Office. Yet whole Office team at MS is only about 2,500 programmers, and many of them aren't even working on desktop version.
    – vartec
    Oct 18, 2013 at 15:44
7

Why is writing a program in text files or via the terminal a better option (as I read) than using IDE(s) like Visual Studio on Windows?

It's not, I can argue that it's quite the opposite. Generally though, people tend to prefer tools which they're better at. The type of tools you use might benefit the ease of writing programs. So for example, I can write Java programs just fine with vim but it's really counter productive as opposed to a full fledged IDE like Eclipse or IntelliJ. Jon Skeet gave a great answer to the question Why use an IDE.

Back to your original question, the only thing Linux is better at is C programming. Everything else you can do on Linux you can also do on Windows and vice-versa (programming wise). C programming is better on Linux for historical reasons, it offers a great set of tools (which you can get on Windows BTW but it's much easier to set up Linux for it). Likewise, if you're writing C# and like .NET then Windows is a better choice for obvious reasons. Everything else is completely subjective and you'll hear pros and cons of both sides.

7
  • 5
    Please, try to set up a <put another programming language except MS's here> environment in Windows, lets see how far it goes.
    – Braiam
    Oct 17, 2013 at 13:37
  • 1
    @Braiam I did, Java :P.
    – Daniel
    Oct 17, 2013 at 13:55
  • 6
    Linux is better at running anything Unix-like. The GCC toolchain (which includes a C and C++ compiler and other stuff) has a long Unix/Posix heritage. But, if you think that all Unix-like programming is C programming, you're sadly underexposed to the rich diversity of the Unix/Posix/Linux heritage and tools.
    – Warren P
    Oct 17, 2013 at 13:55
  • 2
    Java is a bit of a special case as you quickly generate deeply nested folders and many files. And as soon as you rename classes or packages, you need to sync the filenames or the folders respectively. Fun fun fun :)
    – MadMike
    Oct 17, 2013 at 14:01
  • 1
    I don't know whether Linux and the CLI necessarily are better for C programming (VS is great at C++ but lacks C99 support, Posix may be a little cleaner than Win32). But apt-get is great when it comes to C development. You can quickly get tools, libraries and debug symbols for e.g. sudo apt-get install libcurl4-openssl-dev, sudo apt-get install valgrind, sudo apt-get install libz-dbg And try things out easily. Oct 17, 2013 at 22:45
6

What tools (text editor or IDE) you use for programming is a matter of choice. Generally speaking you can say: Beginners and very small projects tend to use better text editors, like sublime text or a modified version of gedit. Just because you learn more when using plain text editors. IDEs can screw up your learning process by automating things (like Visual Studio does ;) ).

When it comes to professionals, messing with lots of tools and languages, IDEs come in handy, because they can do so much more for you, if you let them. There are many IDEs to choose from, depending on the language you want to program in. There are better ones and also less convenient ones.

My personal experience is, that an Ubuntu OS is by far faster and easier to setup for development than Windows. I presume, this is because most of the tools and programs I use are build on Linux and because I do not have to search the internet for download links to my favorite programs. It is just an 'apt-get install program1 program2 program3' away. In comparison: I need 3 working days to install and configure a fresh Windows install with everything I need for programming (company, not private, that would be faster), but it is just one day for the same task in Ubuntu.

My experience is, that programmers, who switch to Linux for programming have (most of the time) a deeper understanding of technical contexts and how basics work. Mac and Windows users tend not to know why something works this way or why it does not. I am not sure if you can actually learn something from working with Linux or if just that those williong to learn switch to Linux.

Hope my "blafasel" helps a bit...

0
1

I would argue that a Linux distribution is an IDE.

For a start, Unix was designed from the outset to be a development environment. It was written by programmers for programmers. Most Unixes, and Linux, still ship with development tools in their default configuration. And missing parts are only an apt-get (or the equivalent) away. Windows, on the other hand, is a terrible development environment until you install an IDE, which is not cheap, or a trivial process.

An IDE is more integrated, in the sense that IDEs are more tightly coupled than using GCC, Git and Vi (for example). Tight coupling allows things like `intellisense' to work better. But on the other hand, loose coupling has many advantages (e.g. flexibility, interchangeability, lack of lock-in).

And advances in compiler design (compilers with easily separable front-ends such as LLVM) might eventually mean better support for features such as syntax error highlighting even in loosely coupled environments.

1
  • So, basically you're saying that Linux is an Integrated Development Environment that's not actually Integrated much? :-)
    – svick
    Oct 20, 2013 at 18:36
1

On the matter of philosophy: Ubuntu/Linux permits the computer programmer direct access to the internals and hardware, whereas Windows is a sort of gatekeeper. This is an important philosophical issue when it comes to programming. So, philosophically speaking, this feature being an advantage will depend upon whether the user is sufficiently knowledgeable or technically aware of the importance of it.

On the matter of programming: The entire system architecture of Ubuntu/Linux is founded upon the Unix tradition of small, simple programs doing one thing, and then piping them together to do more complex things. For a programmer this architecture is incredibly powerful, and, in my view, is the reason why Unix will prevail in the long run against every other software architecture on every platform. One of the few places where Unix is not currently dominant is the desktop, but that will change over time. Distributions like Ubuntu are helping to see this evolution through.

I don't dispute, however, that there are some very good programming environments on Windows. For programming within a corporate environment, these often dominate.

0

Speed is the sort answer.

I find that with an graphical IDE like Visual Studio or QtCreator that I use the mouse too much when I should be using short cuts. Each time you switch context you are having to pause your brain, focus on your target and wait for the action. Whereas pressing F5 is infinitely quicker.

Now if you are using vim, Emacs or something else that doesn't have nice looking buttons you'll be focused on the key presses, you have one method and become faster because its routine.

The errors are presented in a more verbose way with a command line interface, which I prefer, and it also gives feedback during compilation. One thing I hate about Visual Studio is the default is a little icon indicating its doing a compile, then you get an error list out.

With a narrow view you'll keep to the 80 column width which helps readability, I've seen code that spans out to the 200 column width. With code fitting to 80 columns you can have 4/5 windows open at a time.

With a CLI editor you can code remotely, no need for a slow (compared to text) RDP session to your Visual Studio. You could code over a GSM link.

Visual form development kind of sucks. One advantage you might put on a GUI IDE is that you can draw your screens and its quicker. However in my experience its fine for a prototype but often you get better results with doing it manually in code. The VS2012 Code Analyser this morning just warned me about 200+ problems with code that was auto-generated by Visual Studio?!?!?

0

I think your real question might be, "Are there any Visual Studio alternatives that will run on Ubuntu, since it won't?"

MonoDevelop.

It's workable, but you'll hate it if you're used to VS and all the features.

There is NO advantage to using a text editor. Remember that nice thing called Intellisense? Not happening (but MonoDevelop has something like it). Hope this helps.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .