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?
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)
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
[1]"
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.
[1] http://catb.org/esr/writings/taoup/html/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.
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!".......................
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.
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 [1]) 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.
[1] http://www.lips.utexas.edu/ee382c-15005/Readings/Readings1/05-Broo87.pdfWe 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.
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 [1] and NetBeans [2] 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.
[1] http://www.eclipse.org/If you like to feel the familiarity of Visual Studio while developing on Linux you should try Slickedit [1]. 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.
[1] http://www.slickedit.com/index.php?option=com%5Fcontent&view=article&id=49&Itemid=73I 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.
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.
I also moved to Linux development ( Mono [1]) 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 [2].
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] http://en.wikipedia.org/wiki/Mono%5F%28software%29Yes. 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.
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.
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:
On Linux, I tried the following:
Nothing compares to Visual Studio:
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...
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?
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).
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).
CreateFile(LPCTSTR,DWORD,DWORD,LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE)
. Yes, that's a function with seven parameters, none of which are built-in types. Oh, yes and it returns a pointer to a pointer to... something. (I'm not kidding.) - alex tingle
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:
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.
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 :)
You may want to look at Advanced Programming in the Unix Environment [1] 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 [2], boost [3], wxwidgets [4] etc. I guess only ide could be a problem in unix(take a look at this [5]).
[1] http://rads.stackoverflow.com/amzn/click/0201433079Personally, 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
As I've said in this related thread [1], 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] http://stackoverflow.com/questions/618398/does-using-linux-benefit-you-as-a-programmer/618735#618735If you are using in Java, IntelliJ IDEA [1] 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 [2], which brings some functionality of IntelliJ into Visual Studio.
Don't get me wrong, Eclipse [3] is not bad, but it just can't hold a handle to IntelliJ... Eclipse is more of a grassroots forest, and IntelliJ is Yggdrasil [4], the World Tree.
[1] http://en.wikipedia.org/wiki/IntelliJ%5FIDEAI 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.
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?
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?
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.
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. :)
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.