45

I've spent the last 5 years developing software with Windows as the target OS (mainly C++ and C#). Recently I started to become interested in development for other environments as well, Linux for example.

So I guess I actually have two questions. The first is: Do you find developing software for Linux harder than developing for Windows?, or perhaps you find it the other way? Or perhaps there's not an actual difference once you get used to the different environments (how bad is the learning curve?).

Also, are there any good books that you could recommend reading for anyone who would like to dive into the Linux/Unix OS? Perhaps something that target already experienced developers?

89 accepted

The important difference between the two platforms from a developer's point of view is how different parts of them help you to get your job done.

  • Under Windows, you have the swiss-army-knife kindof application called Visual Studio, an oasis full of joy inside of developer's desert.

  • Under Linux, you live in the land of the developers. You have a wild forest of tools that grow on an extremely fertile ground. However, the "one tree that does it all" is missing.

If you are able to leverage the power of the platform, for example using shell scripts, knowing all the small handy tools etc., then I find developing under Linux being much easier and quicker than under Windows. But if you don't, it has to be harder. Because, and that is true, Visual Studio is severely missing.

I would assume the learning curve therefore is quite tough, as you have to change the way of thinking. There is no button or menu entry for everything. On the other hand, there cannot be a button for everything -- this is where Linux wins. I see Windows developers regularly writing 'redundant' code (code that you wouldn't neet to write under Linux as you can just ask your shell to do it for you). On the other hand, I see Linux developers who do redundant hand-work. Me personally, I prefer the linux platform, and new IDEs like QtCreator are promising. (Windows has to do a lot more to catch-up than Linux has)

30

I believe that developing software for Unix is much more pleasant than Windows development. Posix is a much simpler, more powerful, and more consistent interface than the WinApi.

I often get the impression that many WinApi interfaces were designed by inexperienced programmers and Microsoft was then unable to go back and fix them because of their commitment to backwards compatibility. Functions often have a plethora of confusing and redundant arguments. The behaviour is complex, crufty and (therefore) poorly documented. New features seem to have been added by creating new interfaces, whose purpose overlaps with the old ones - leaving me unsure which one I should be using.

Posix isn't perfect, but it's far, far better. Interfaces tend not to overlap, and they are typically much simpler. Having fewer parameters and better defined behaviour means that the documentation is much more complete and (to me) trustworthy. Start with a book like "Advanced Programming in the Unix Environment", and then use man 2 and man 3 as your handy reference. For an easy reading introduction, try Eric Raymond's "The Art Of Unix Programming"

As for IDEs - I've never personally had much use for them. If you like one, then use it. I've known lots of people who use VisualStudio (via a Samba share) as an editor for developing Unix code, and it works just fine. Microsoft's debugger really is very good, but DDD on Linux is quite acceptable, once you get used to it.

11

For C++, KDevelop 4.x and Qt are about as good as it gets. Make sure you're using the KATE editing component for KDevelop, and you'll have a very nice editor. It also supports RAD, with Qt's very good, very modern, portable GUI toolkit, project configuration management, debugging, and some other features you'd miss if they were gone.

I'd also recommend a look at developing with PyQt4 (python + qt4) using the Eric4 IDE. If you want rapid cross-platform development with modern tools, this is it.

9

Every one of the statements above regarding better productivity in the MS VS environment is true. Note I am NOT claiming anything about PLATFORM APIs as they really have nothing to do with my development environment (they are all wrapped) and I write server side code or non GUI library code.

Maybe the tools have gotten tremendously better since I had someone evaluate them (late 2007 early 2008) but back then there was nothing that came close to MS VS. There is nothing in Visual Studio that locks one into the platform when one is writing C++ server side code or non GUI library code. One makes sure one wraps the OS API in one's code (through boost or whatever).

If one steps through every line of new code that one writes and examines every variable that changes to ensure that the code that one writes behaves EXACTLY as expected I have trouble seeing how that can be done effectively with a command line debugger.

In addition the benefits of right clicking to open/close a data structure in the debugger and right click to goto definition or declaration are really significant. I have watched people "browse" code with command line tools on Linux and spend literally minutes to do what a right click in an IDE will do. Similarly chasing pointers.

Having the source in front of you when debugging and the program counter highlighted. Looking at assembly code in a separate window from source ...

Pretty soon I'll sound like Ron Popeil: "But wait there's more!".......................

8

After using Visual Studio on Windows for a long time, I switched to Linux and found that no IDE is really worth using. I just use SciTE and CMake now (along with GDB of course).

If you develop on Linux without a full IDE then I think you really need to be a command line person. Luckily, I love the command line so I'm as happy as can be.

I don't miss VS at all but I will still use it if developing on Windows.

8

It might be good to focus back on the actual questions.

Do you find developing software for Linux harder than developing for Windows?, or perhaps you find it the other way? or perhaps... there's not actual different once you get used to the different environments (how bad is the learning curve?).

The "hard bits" of software development are not particularly different on windows and linux. (Obligatory Silver Bullet Reference) Once it's established that we're talking about accidental difficulties in development, I would argue that each platform has solved a slightly different set of problems. The steepness of your learning curve will depend on how quickly you can adapt to the lack of conveniences you're used to having.

The Visual Studio environment has a fantastic project-level editor and integrated debugger. By "fantastic project-level editor", I mean that MSVS comes out of the box with the ability to track variables and references throughout your project, finding the location of identifiers and greatly assisting in refactoring efforts. This has the disadvantage that less experienced coders tend to spread code semi-randomly throughout their code files.

By contrast, the classic *NIX editors have a very steep learning curve. They are also extremely customizeable. For file-level editing, a *NIX coder can be significantly faster with vi/emacs than with a pretty textedit widget. This has the disadvantage that less experienced coders tend to produce massive inscrutable .cpp files with everything in one place. There are fairly good project-level editors under Linux, but they do not have the polish of MSVS.

The ability to easily (and visually) debug a misbehaving application is unmatched on any non-windows platform. This advantage breaks down somewhat if you are debugging something slightly nontraditional (library debugging can be somewhat messy).

GDB is insanely useful, but I've seen no front-end nearly as good as the integrated interface in MSVS. By contrast, the GDB ability to connect to a core dump and show the stack/executing code allows you to find problems in a production application well after it has moved into production. (see comments for partial correction here)

Also, are there any good books that you could recommend reading for anyone who would like to dive into the Linux/Unix OS? Perhaps something that target already experienced developers?

It depends on what you're planning on doing. Graphical Application development? Network/server development? Scientific/Machine-control software?

One problem you may have is that there is no one single graphics API on Linux. If you're doing standard application programming, you have your choice of raw-X11, Qt/KDELibs, GTK+, and literally dozens of smaller toolkits. There are books on all of these.

6

We write and test on Windows laptops, but deploy on Linux.

Interestingly, if you choose the right tools, there's almost no discernible difference between the two.

We use Komodo Edit -- it seems to work well everywhere and has the right price.

We use only cross-platform components and libraries. If it doesn't run the same in Windows and Linux, we don't use it.

5

You could leverage your C# and try monodevelop.

4

It also depends on what programming language you are using.

If you're using Java for example, there's really no difference at all between developing software on Windows, Linux or Mac OS X - the two most well-known IDEs Eclipse and NetBeans are available for all three platforms and work exactly the same.

Java is platform-independent; software that you write in Java runs on any platform for which there is a Java virtual machine available. Also GUI programs written using Java's native GUI library Swing run on any OS without modification.

4

I find that pushing scripts out and data analysis is orders of magnitude easier on Linux.

The advantage of Windows is Visual Studio pushes GUIs out orders of magnitude faster than anything I've monkeyed with on *nix.

The other big advantage is the VS debugger. ddd's usability/interface is like something from the early '90s(unless it's changed drastically in the last 4 years, quite possible). GDB is like something from the '70s. Now, if your code doesn't need debuggers usually, it's not really a point to be considered.

I don't like Intellisense, so the emacs basic autocomplete is just fine for me(let's not argue about that, it's off-topic).

Part of what the question rests on is the premise of what you're developing against. Linux is much better for the scripters/backend/coding world. Windows is much better for the GUI world. If you're doing data analysis or back-end data pushing, Windows is not the best choice. If you're doing user-friendly apps or Microsoft integration, Linux is not the best choice.

Oh - side comment: keyboard speed is faster than mouse, according to Actual Scientists. So if you can convince your editor to do commands in several strokes without actually using a mouse, your productivity improves. Yes, that's a micro-optimization. But some keyboard work is very inner-loop-y, so it will add up. I don't remember the link to the reference, sorry.

3

If you like to feel the familiarity of Visual Studio while developing on Linux you should try Slickedit. It has a Visual C++ 6 keybinding option, to which I'm very accustomed. It is not Visual Studio but very close to it, debugger and intellisense are very welcomed.

It is not free/open source, but on the other hand Visual Studio is not also.

3

It's so much easier on Windows...

And I have a Linux at home, and I code at home, so I had a lot of time to experiment with alternatives.

Edit

I'm writing this now because at least one commenter did not bother to read the whole answer before commenting and potentially downvoting it. For example:

Hey paercebal, I would read your answer in full, if it would have more substance than rant. [...] for me. But, if you answer somebody's text, you definitely should read the whole thing. [extract from ypnos' comment]

I guess it means that ypnos did not bother to read my post, but (wrongly) accuses me of the same crime about a comment.

Anyway, for the downvoters out there, please:

  1. Don't comment if you did not read the whole post. Thank you. Yes ypnos, this is for you.
  2. Don't comment if you didn't read the original question. The author asked if it was harder to develop on Linux than on Windows. Sorry if I committed the crime of answering yes.
  3. Don't comment about how there is choice on Linux. Everyone knows that. I know that. I even tried that. Read again the question. Write your own answer.
  4. Don't comment about great tools if I already wrote I tried them and wasn't impressed in my post You're just showing you did ignore my post.
  5. Don't comment if a full answer would be better. The question needs viewpoints from multiple sources, so please write down your own experience instead of doubting mine.

Back to the subject: The IDEs

On Linux, I tried the following:

  • KDevelop
  • Anjunta
  • Eclipse
  • Code::Blocks
  • etc. (miscellaneous generic editors)

Nothing compares to Visual Studio:

  1. Projects are eons easier to create and maintain
  2. The compiler is very very good (Visual C++ 6 is a long time ago).
  3. The text editor is very cool, including Intellisense
  4. Debugging is so much easier I don't even consider debugging a feature on Linux.

People will laugh at the fact Visual Studio is the "on tree that does almost anything", but then, it means that it works now for almost anything you want to do (and for most people, this means more than everything).

And I know you care about productivity and results.

In my personal case, I've had only ONE rare case where something worked on Linux, and not with Visual Studio, and as far as I see it, I just don't care about it. I'll use Visual Studio anyway even if I have 10 more of that cases.

At home, I have a Linux system, and have struggled to find a decent IDE (sorry, but using console tools is just a pain in the @ss). I tried Anjuta, as well as KDevelop and Eclipse, but finally settled on Code::Blocks, which I consider the best tool.

And Code::Blocks is nowhere near Visual Studio.

(Still, Kudos for the Code::Blocks developers...)

MonoDevelop could be cool, but I am mainly a C++ developer, and MonoDevelop is about C# (which is a worthy language, but then, I'm so much in love with RAII...)

The Tools

The Tools...

Muaaah ah ah ah!

Sorry for the outburst, but I'm not an admin: I'm a coder.

I don't care about the full divine power of console tools that will do everything and more for me, if only I knew what existed and what it did.

The last thing I want in my life is opening a Vi console, EMACS, or using the autoconf framework.

Sorry, I can't bear the complexity, and don't want my "hello world" projects polluted by hundred of useless files I don't care about: The question is about "easiness of developing on Windows vs. Linux", not about "Hey, your Linux box can do me coffee, too, with the right bash script!".

The documentation could be cool, but then, nothing is centralized, and when it is, it's a console documentation (MAN is a pain to use, sorry). Just reading the automake/autoconf doc made turn away in disgust, and search for an IDE. JAM, BJAM CMAKE or whatever would be cool, but then, I don't care about the new Nth process of compilation some people reinvented because the existing (N-1)th did not work like they liked.

I have the strong impression that instead of updating MAKE to read decent makefiles (and not the disgusting mess it is now), people keep on producing console tools that produces files that are used by console tools that will produce scripts that will call g++ to compile your files.

Layers upon layers. Pleeeeaaaaaase...

The major reason, I guess, is that Visual Studio produces projects that works right out-of-the-box.

You can then rely on the GUI to learn about features, and make project changes, and if you need to automate project changes (as I did recently on 200 projects that needed some project cleaning), you can still examine project files (XML files!) to determine all viable options, and modify them.

On Linux, this is the contrary, you must know everything out-of-the-box before even starting a project, and while autoconf/automake seemed a good idea, the pollution of your "Hello World" project with unnumerable files is such you can't believe someone had the guts to produce such tools.

So, people could say perhaps that I'm spoiled by having developed on Windows.

Ok, I'll accept that. In fact, I assume that. Again, I'm a coder, not an admin.

And then, everyone I know is either "you should learn VI because it's the one editor that works everywhere" or "I develop and test on Windows and produce the final binaries on Linux". And I'm talking about professional development, where only our Linux/Solaris binaries are used by our clients. So, are we all wrong?

The API

Someone mentionned the API, and the fact WinAPI is complicated, so I guess I'll speak about my experience about it.

WinAPI is not complicated.

The only problem I have with WinAPI is that it is C (I'm a C++ coder), and that its GUI framework is disgustingly hard to use compared with other recent GUI frameworks like GTKmm, QT, or even Swing on Java, or the equivalent on .NET.

But for other tasks, it is as easy as any other frameworks to use (because it's C, mainly).

  • Wanna create files? Look at CreateFile (I'm not kidding).
  • Wanna create a thread? Look at CreateThread (again, no kidding).

MSDN is a very good reference, but that will not be enough, as you must at least spend some time reading the major API functions for A to Z because starting.

WinAPI is an old framework (30 years?), but then, it works.

Just as everything else, avoid it if you're doing cross plateform code. And as everything else, avoid using undocumented features. And even then, Microsoft apparently does an impressive job to maintain undocumented features (try Raymond Chen's blog for more info on Win API).

2

Yes. I find it hard cause there are no strong tools like Visual studio and other GUI based IDE. Also there is variation with KDE/Gnome/ICEWM. KDE comes up with QT. But most of the distros don't ship anything with gnome. So most of the time you've to download IDE's for linux and there is very little help with IDE available on internet. In case of windows there is ton of developer information available on windows.

It's just that we need more dev tools and documentation, tutorial and screencasts for platform. so that it would be easy to lookup and to get faster results like windows.

2

I think that Linux C++ development is more difficult than Windows development when it comes to tool support.

Be prepared to take a productivity hit when debugging and possibly with project management if you're unlucky enough to work on a project that uses autotools or the like. Don't expect code completion anywhere near Visual Assist X. If you follow the advice of using vi/emacs + command line gdb + script + make you can expect to be less productive than you were on Windows.

I recommend using an IDE such as KDevelop or Qt Creator and a cross-platform framework.

Edit:
Not all the work, but a good IDE will do a lot of work for you:

  • In gdb I have to set breakpoint with b and then type the file name/function. In an IDE I just go to the line and hit a key.
  • In gdb I have to print X to see the value of a variable, in an IDE I hover over the variable. MSVC shows me the contents of std::list or std::vector in a tree tooltip and I can drill down the members. It can show me how many references a shared pointer has or the return values for the last three functions. By default, gdb shows me the memory address of the vector; thankfuly some IDEs like QtCreator added debugger dumpers that allow you to inspect container values and the like.
  • In an IDE, adding/removing files and libraries is a breeze. In a makefile I have to search for the proper make directive, edit the file by hand, make sure that I didn't break anything.
  • With VA X, I can search for all the references to a symbol. In vim/emacs I have to do a grep and I will get a lot of false positives.
  • With VA X I can right click a variable/function and choose rename, in vim/emacs I have to do a search replace and then double-check to see if I didn't break anything..
  • With VA X I right click a member function and choose "implement". In a text editor I copy the function declaration, I add {}, I indent it, I type/autocomplete the class name...

A modern IDE is significantly more productive than using the old Linux way when it comes to C++ programming. I've noticed that a lot of Linux C or C++ programmers are not familiar with the wide array of available GUI tools and they automatically assume that the GUI way is less productive. Not so, there are plenty of tools out there that are better than command line programs when it comes to programmer productivity. If I can't find them, I will use one of the command line tools from cygwin or the ports.

2

Having developed quite a bit on both systems, I would say there is not much difference, at least when it comes to system programming (never tried any GUI on Linux). Linux is more "geek friendly" with many dev tools coming out of the box. On the other hand, WinAPI offers much more features than POSIX, and Windows debuggers are more powerful than gdb. I like both :)

2

Microsoft tools seem to me to be designed to make things easy, while Unix/Linux tools seem to me to be designed to make things possible. I find Visual Studio easy to work with until I hit a snag, something that wouldn't be too difficult in a Linux environment but is more difficult than it should be in Windows. The Linux tools are more powerful, but clumsier, and require more effort to learn.

So which would I recommend? That would depend on what was being programmed, as well as the developer or developers. There's no clear answer, as both environments have advantages.

2

I also moved to Linux development (Mono) after several years of Windows development (Visual C#).

As a programmer I don't find any difficulties since am using C# in both the environments.. But I really miss the Visual Studio IDE capabilities. But now I am fine with MonoDevelop.

The real hard part is learning the Linux OS features like file systems, application deployments, application installation and server deployments. In Linux, mostly we rely on shell scripts.

It's better to learn and understand Linux features. Programming is not a real deal in any environment.

1

You may want to look at Advanced Programming in the Unix Environment for "dive into unix"

Actually there aren't big porting problems when you use good cross-platform libraries. Most of the porting problems are solved by qt, boost, wxwidgets etc. I guess only ide could be a problem in unix(take a look at this).

1

If you are using in Java, IntelliJ IDEA is pretty much unmatched, IMO. It's cross-platform, and it is more powerful and easier to use than Visual Studio for .NET; in fact, whenever I find myself developing .NET applications, I end up installing ReSharper, which brings some functionality of IntelliJ into Visual Studio.

Don't get me wrong, Eclipse is not bad, but it just can't hold a handle to IntelliJ... Eclipse is more of a grassroots forest, and IntelliJ is Yggdrasil, the World Tree.

1

As I've said in this related thread, Linux is easier if you're on a tight budget. I assume that it won't be easier if that's not a concern, just different.

On Linux you get a 'closer to the O.S' feeling, in my opinion. for better or for worse - that's very much subjective.

1

Personally, I prefer coding for the POSIX API easier and cleaner then coding for the WIN32 API.

On Windows, you have a HANDLE. A HANDLE can be many kinds of handle. On the Posix API, you have for example a pthread_t for a thread, a pthread_mutex_t for a mutex, etc. I think this is much cleaner, because you can see what the variable actually contains, in stead of the Windows HANDLE which can be anything.

Also, when writing network enabled programs, it seems the winsock is missing some functions that are available on most other socket implementations, for example, gethostbyname2, with is like gethostbyname but takes a 2nd parameter specifying the address type. When coding an IPv6 application, I think the sockets implementation on POSIX systems is nicer then the WinSock variant.

The downsite for POSIX OS'es is there is no unified graphics API. X11 is always used, but applications are usually developed using a graphics toolkit, like GTK, QT, wxWidgets, etc. All have their own interfaces, design standards, etc. a QT program looks and feels different then a GTK program. etc. Where on windows, you usually have the same graphics engine.

No enviorement is perfect. Both have advantages and disadvantages, but for now, I prefer coding on Linux/*BSD

0

You could learn by example e.g. look at the Gnome project.

0

It depends, do you mean developing GUIs that run under Unix/Linux, or developing back-end non-GUI software?

The latter is immensely easier than on Windows, by sheer virtue of GUI development being so complicated. The former is probably on the same order of difficulties, just different points are easy or hard on each environment.

0

Language and desktop vs web apps haven't been mentioned so far. If you're using a statically typed language (C++, C#) then VS intellisense is easily the best in the business... I've not found anything to match it. Dynamically typed languages on the other hand (PHP, Perl, Python etc) make intellisense impossible to implement (or at least a lot harder). Similarly, the visual tools for designing UIs for desktop apps are excellent in VS and lacking elsewhere... but they are a lot less useful for web apps. Same in a way for the debugger. I left the VS-world before the object-relational mapping really hit the bigtime, but I hear that is very good in VS too.

When I first switched to Linux full time I sorely missed VS because I was still using statically typed languages and writing desktop apps. Nowadays, writing web apps using dynamically typed languages I have a lot less use for intellisense (because it wouldn't work anyway), for visual tools (which are a lot less useful in the HTML/CSS world), for the debugger (because web apps have a lot less 'state', and so less memory and functionality to debug) and finally for the ORM because it is generally provided by the framework, rather than the IDE.

Under Linux the IDE really does collapse down to a text editor... although I must admit I'm not tough enough to use Vim or even Emacs.

0

As someone who has started developing on Linux environments with no tools but vi and the GNU suite, I can tell you I feel a lot more comfortable while developing for Linux. However, I can understand this is purely due to habit and the time I've spent on UNIX-like environments (a bit more than 10 years atm). I haven't had many problems developing for Windows though; partly due to very good tools available on them (does Visual Studio come to mind?) - the biggest problem I had was that the documentation was only available on the Web, as opposed to good ol' manpages (another artifact of habit).

Overall, I'd say I've faced pretty much similar challenges in difficulty, but I haven't spent much time developing with/for Windows for my opinion to matter much. :)

0

I prefer Eclipse to VS even though I use VS at work. Eclipse's refactoring support, incremental compilation (for Java anyway), and plugins (particularly for source control, code analysis, and memory profiling) make development enjoyable. Visual Studio does seem to make deployment easier, but if you program in a language supported by Eclipse, Linux development is not hard. In addition, MonoDevelop has come a long way recently.

0

Take a look at this interesting post i've stumbled upon. I think it encapsulates the difference between linux and windows very accurately

http://dprl.wordpress.com/2010/06/22/real-mvc-for-control-freaks/

what do you think?

0

I may get a downvote here, but I see Windows as vastly superior to Linux. Some don't like Microsoft because of there monopoly, but I personally find Windows easier to use than Linux. How many computers do you find that come pre-installed with Linux? Unless there's more people committed to making Linux work with every computer, I see its fall. No wonder that Bill is so rich. They might be secretive about their strategy, but it really seems to work for them. If they would go open source, what then? If you want to know which is easier to learn to develop for, I really don't know. But do you really get anything for "free" in this world?

-2

Anyone who programs solely on windows is trying to dance with a full body cast on. Unfortunately, A lot of IT education programs and stuff slap Visual Studio based things in front of their students these days. Visual Studio has it's strong points - but really, I wouldn't call anyone a programmer if all they know how to do is use Visual Studio. Windows is mega-flawed.. Learn Unix

-3

paercebal makes many excellent points in the above response, and he/she is right about the amount of time 'wasted' in Linux/Unix trying to find out what commands are actually useful ! I well remember the confusion when crossing over from OS/2 and Windows NT to Linux/Unix. I've finally settled on Linux ( Sidux ) or OpenBSD and only have a Win XP on hand for rare usage. While command line usage is interesting, and useful, its really a GUI world we're into today, and has been since MS decided to drop DOS !, so get over it and start using GUI IDE tools under Linux -- then real development will occur on IDE's. Hand coding in Vi/Emacs is just not efficient. There are plenty of good useful GUI based Editors under Linux. The main problem with Vi/Emacs is that is its very easy to make mistakes during editing and not know that you've stuffed up -- because you don't necessarily see the effect of that mistake ( until much later).

I avoid the whole transportable development problem by using a fully transportable languages, for simple stuff ( small quick & dirty problems) I use REBOL with Scite editor, for more complex systems where I like using Smalltalk ( either Smalltalk/X or Cincoms VWST ), which I find rather productive and genuinely transportable and fully GUI IDE development environments. I'm not into C/C++/C# at all,but a lot of programmers are so Linux IDE developers must concentrate on those languages to get people interested in doing development under Linux -- as a GUI development environment.