share
Stack OverflowLinux vs Windows Programming?
[+44] [28] community_owned
[2009-09-20 11:21:20]
[ c++ windows linux unix ]
[ http://stackoverflow.com/questions/1450810] [DELETED]

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?

(40) Yes, I do. Not because of the platform. The real problem is that Visual Studio is really unmatched on other operating systems. - Mehrdad Afshari
(5) Yeah, it's mostly the lack of anything near visual studio, and stuff like eclipse that takes forever to run yet is widely accepted makes things worse. VS's intellisense and debugging interface are both amazing. - Blindy
(5) This is about the closest I'd like to get to this discussion ... partly because there will be a tendency to focus on software development at a level beyond my experience, and partly because it's almost inevitable it'll turn into a religious debate. - pavium
(1) @Blindy: I have good experiences using Eclipse CDT. Actually I have to develop C++ (not C++/CLI) and C#. For C# I use VS but for my C++ development I prefer Eclipse because it's Syntax highlighting and "Intellisense" is much more complete than VS's is (although slower than VS). - rstevens
(34) One thing that never stops to surprise me is how far people are prepared to defend their blindingly ignorance for using and supporting Microsoft development tools. Unless you have made a deal with the devil, there's no reason to lock yourself in to a platform that does not support another platform. Smell the coffee guys and start developing on another tool other than Microsoft VS. - Helen Neely
(24) @Helen: one reason developers like to write software for Windows is that we like having these things called "customers". - MusiGenesis
(3) @Helen - For most developers the decision about whether or not to choose Microsofts development tools should be based on the benefit to the customer. If the ease of use of the Microsoft tools offers a reduction in development costs enough to outweigh the costs of the tools themselves then there would be no reason not to. - Kragen
(11) @Helen Neely: At work, I work on Visual Studio, and at home, on CodeBlocks. I'm a C++ coder. My code is cross platform. I'm using the best tools at hand. If those data don't make sense for you, then sorry... But at least, I didn't call you "blindingly ignorant" for not knowing my constraints and assuming some kind of religious statement. - paercebal
(8) @paercebal - I'm sorry if my comments offended anyone. My disappointent was aimed at those who were recommending that the OP use Microsoft VS to write C++ code for Linux. As a developer myself, I think about platform independence on personal projects. Of course its understandable if your work dictates which IDE/platform. Other than that, it makes better sense to be platform independent. - Helen Neely
(6) @Helen: you really can't say something like "people are prepared to defend their blindingly [sic] ignorance" and then claim that you're "sorry if [your] comments offended anyone". Of course your comments offended people, and as an adult (I'm assuming) you really should have learned this by now. - MusiGenesis
(7) Personally, I'm not all that fond of Visual Studio, and I suspect that's because I worked with Unix tools like vi, gcc, gdb, gmake, and gprof until they were ingrained. Even after a couple of years, I still find myself wondering how to do something that would be quick and almost automatic on a Linux/Unix box using the Gnu toolchain. (Of course, if Intellisense worked well on C++, I might change my mind.) Different people have different preferences, I guess. - David Thornley
(3) I have still yet to find debugging tools on linux that come anywhere near the functionality and usability of MS VS. It is painful on linux... - Tim
If you want to write software thats multiplatform, have you considered web development? - Frank Schwieterman
[+86] [2009-09-20 11:47:29] ypnos [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)


(20) Also, once you step outside the bounds of Visual Studio you'll find the windows development platform sadly lacking (I'm talking about things like deployment scripts, automatic checkout/build, things of that nature). PowerShell is getting them closer, but I honestly find linux to be a better environment. - Fred
(4) Also, on non-.NET platforms, there are free reusable library repositories such as CPAN for Perl, Gem for Ruby, PEAR, for PHP, and Maven for Java. The end result of this is that you can import these components easily into your project which promotes reuse. On .NET, you pretty much rely on Microsoft to provide everything for you. - 0sumgain
(3) very metaphorical. I'm a sucker for a beautiful metaphor such as this. - Alex Baranosky
(2) A diplomatic, metaphorical answer that raises more questions than it answers. Windows has to do a lot of work to catch up to... what exactly? How do bash scripts improve my productivity over using Python in Windows (and Linux)? Aren't the small handy tools also available on Windows (cygwin + ports, etc)? - rpg
(5) You raise an interesting question. You carry over open source technologies that originated on the Linux platform to Windows. It is totally valid and if you pursue this, you may end up getting a similiar productive environment -- essentially what you are doing is bringing in a full POSIX system with GNU toolchain etc. The question is, am I willing to do this instead of just putting an Ubuntu CD into the drive, so that I get the whole package? Essentially, I would say you talk about option 3 here: Linux vs Windows vs "Cygwin/GNU/X11/... on Windows". The "catch up" would be to have this natively. - ypnos
(1) This is a great answer. Windows has a better single tool, but Linux (Unix) is a giant development system, and the users are largely developers. (And it does have Eclipse now...) - DigitalRoss
(1) Great answer. I am even more curious to learn more about linux after reading this. @0sumgain: There are tons of .NET libraries other than what Microsoft provides - ifwdev
(1) @rpg: Python is awful on Windows. How can you stand that terrible command prompt dialog? On Linux, interpreters are a natural extension to the shell, on Windows they're bolted on awkwardly. - Matt Joiner
1
[+28] [2009-09-20 14:05:23] alex tingle

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/

(2) POSIX and WinAPI are C APIs, not C++. - rpg
(2) @rpg: sure, but they are also the gateway to the services of the operating system and unless you use an abstraction layer for everything, you'll bump into those APIs under C++ too. - Isak Savo
(2) Since Microsoft made .NET, it became increasingly unnecessary to worry about the native Win32 API. For cross-platform concerns, I have very limited experience with Mono, but what little I do have has been positive. - senfo
(1) senfo: .NET and Mono are not C++ programming environments. If you want cross platform and you're willing to put up with the overhead of scripting, then Python's a good choice. .NET, not so much. - alex tingle
2
[+11] [2009-09-20 18:17:44] Lee B

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.


(1) +1. I tried Kdevelop a few times, but I wasn't ever happy with it - but Kdevelop 4 (3.9.*) fixed a lot of the problems that 3.5 and below had. Very worth checking out for anyone who hasn't recently. - greyfade
Qt Creator was added in pretty recently and makes a decent cross platform Qt environment. The only issue to look out for is the open source installer for Qt on windows lacks several components (like phenon or whatever it was called). - envalid
@envalid Phonon you mean? - en.wikipedia.org/wiki/Phonon_(KDE) - Pharaun
3
[+10] [2009-09-20 21:58:22] pgast

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!".......................


(1) Sounds like you are familiar with Visual Studio and not assorted Unix tools, and the people you watch aren't either. Nothing wrong with being more familiar with one than the other, but it makes it hard to make accurate comparisons. - David Thornley
(3) @david yes you are correct. 25 years ago I grepped and vi'd and command lined. I wrote embedded code, drivers, wrote Unix based threads/fibers code cause context switch was too slow all that sort of crap. But I have left grep,vi,command lines behind. I was told that the people I watched were "experts". The problem I really find is that there are so many tools out there that do 75% of what is required. So all of a sudden it is a "big deal" (meaning a significant evaluation effort) to evaluate which of the tools you are going to use and what you are going to sacrifice. - pgast
(1) @david again- When I downloaded some of the other tools to try (2+years ago) they just did not work (seg faults hangs all the usual garbage of bad software) If things are very much better then that is a good thing. I have not had the time to evaluate again. I found it much easier just to develop on MS VS and then port. - pgast
@david again - some of the problems with chasing down references were with overloaded functions where ctags really could not seem to make distinctions with many versions of the function name(eg set(...)). Now this may have been a problem with how the linux development "experts" set up ctags or a deficiency in ctags, I dont know. All I do know is that, when demonstrated to me, it was a linear manual search (in a separate window) to find the right function. - pgast
Don't overlook the Data Display Debugger. It's not Visual Studio, but it's one heckuva lot better than gdb. OK, damnation by faint praise... - Norman Ramsey
4
[+8] [2009-09-20 19:18:07] Tom Savage

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.


5
[+8] [2009-09-21 19:56:55] jkerian

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.pdf

(3) ...By contrast, the GDB ability to connect to a core dump and show the stack/executing code... so does MSVS, actually. - Clay
Hmm, a core dump from a non-dev windows machine? This was a capability I was unaware of. - jkerian
(2) Yeah, I believe the "send info to MS" dialog sends minidumps: msdn.microsoft.com/en-us/library/ms680369(VS.85).aspx You can also create a minidump programmatically in your code using the Win32 msdn.microsoft.com/en-us/library/ms680360(VS.85).aspx - Clay
Hmm... not as useful as the system-wide *NIX feature of automatically dumping a core file of a crashing application, but still useful. A bit of extra work to build it into your crash handler, but quite worthwhile. - jkerian
(1) The DDD front end to GDB is not as good as VS, but it is way better than using GDB on the command line. I find bugs maybe 3 times as fast? - Norman Ramsey
ddd sux, i don't know why you bother to use it. gdb all the way - Matt Joiner
6
[+6] [2009-09-20 11:41:55] S.Lott

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.


(1) And what are these right tools? .NET / Mono ? - Oliver Hanappi
(1) If you choose the correct tools and know how to use them. - Vinko Vrsalovic
(1) The only cross-platform tools (or most of them anyway) are linux tools. - hasen j
7
[+5] [2009-09-20 11:25:42] Daniel Elliott

You could leverage your C# and try monodevelop [1].

[1] http://www.monodevelop.com

(2) I'm not looking to develop managed code on Unix. Just good-old c++.. - community_owned
(5) MonoDevelop is just an IDE. It supports C(++) quite well. - Dykam
(1) Define "quite well"... Most so-called C++ IDEs support the syntax coloring and a half-hearted gdb integration. - rpg
8
[+4] [2009-09-20 20:41:29] Jesper

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/
[2] http://www.netbeans.org/

9
[+3] [2009-09-20 11:45:08] Cristian Adam

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=73

Cris - what's the debugger integration like? - pgast
Debugger is OK. But it doesn't have support for STL types. std::vector<std::string> looks horrible. I guess if customers complain on their forum they will have to implement it community.slickedit.com/index.php. - Cristian Adam
10
[+3] [2009-09-21 18:55:48] Paul Nathan

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.


11
[+2] [2009-09-21 22:09:05] David Thornley

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.


12
[+2] [2009-09-23 14:05:26] Ramesh Vel

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%29
[2] http://en.wikipedia.org/wiki/MonoDevelop

13
[+2] [2009-09-20 14:21:24] Ryuken

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.


14
[+2] [2009-09-20 17:56:36] paercebal

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).


(5) You don't have to be an admin to use shell/Emacs/Vi(m). It's a different way of working, but your assumption that it is worse because of that is a silly one. Perhaps it doesn't suit you as well. I know I'd go mad using GUIfied IDE all day. Different strokes and all that. - lil_cain
Yeah apparently, we have different vision of what is being an admin. Now, I never wrote it was worse. I wrote it was harder. You know, in the kind of way it's harder to write a document from the shell than using Word or OpenOffice... And this was the point of the question... Sorry if I hurt your feelings... ^_^ - paercebal
(2) "Harder" is in the eyes of the user when it comes to editors like Emacs and Vi. There are a plethora of editors available for use, and you don't have to use any one of them if you don't want. Kate and Geany, for example, are very easy to work with. You're also not restricted to autotools. Use CMake or Scons or Jam or anything else - even raw Makefiles. You don't have to use any one of them if you don't want to. - greyfade
BTW: use ViEmu to have the quick vim style editing in VS (though its not free) - Emile Vrijdags
(1) @greayface: Wrong. There is a learning curve for everything. And if you want ot spend your time learning a language, you perhaps don't want to spend your time on bash scripts and compilation files. An expert of Vi will find it easy and powerful, or course. But this doesn't invalidate my argument that "clicking" is magnitudes easier than writing a bash script or using a mouseless or even a generic editor, and that drag'n'dropping your source files is easier than configuring some compilation script, whatever its kind. The question wasn't about existence of choice. It was about the easiest one. - paercebal
(1) Hey paercebal, I would read your answer in full, if it would have more substance than rant. Unfortunately the rant proportion kills it for me. But, if you answer somebody's text, you definitely should read the whole thing. Your answer "Wrong. [...]" totally ignores greyfade's arguments. And he is right. You do not have to learn vi, there are plenty of GUI editors and IDEs, see QtCreator, just to name another one. It seems your only problem with the platform is your ignorance. So then, just leave it and not use it, but why argue about it, with that much emotion? - ypnos
@ypnos: Thanks for your comment, but if you did bother to read my original answer you would have learned I DID try other IDEs. I guess this invalidate anything else you wrote. Thank you for your time, but next time, please don't comment answers you did not bother to read. - paercebal
(5) " "clicking" is magnitudes easier than writing a bash script" Only until you want to do something that there isn't a click for. - Colin Coghill
(14) Wanna create a file, look at 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
@ypnos: yes, QtCreator is the glimmer of hope for cross-platform programming. It was not available when I started with Linux, but I use it now. Back then it was vi/kate and command line gdb for me. @alex: It is very rare to need to call into WinAPI, most people use frameworks. fopen works too. - rpg
FWIW, I think managing/admin projects on Linux is much easier as a coder than on Visual Studio. I'm sufficiently a CLI aficiondo I use the cl.exe interface in Powershell unless I'm debugging(at which point VS rules the roost). I really. truly. abhor. the Visual Studio filespew. - Paul Nathan
(4) You're getting downvoted b/c: a) you complain about "layers of extra files you have to create on linux", in defending visual studio, the irony is obvious b) you complain about lack of centralized documentation on linux, as opposed to the massively self-contradictory (very scattered) documentation on windows (which you even admit to later on) I program professionally for both Windows and *NIX (separate projects), and although I do feel that visual studio provides an easier development environment (mostly due to the excellent debugger&code browser), your rant here was worse than uninformative. - jkerian
(4) Downvoted for half a screen of rant before you ever got to anything vaguely substantive. The rest of the post is full of prejudices and unsubstantiated claims, not to mention your apparent attitude that anything you find easier is objectively better, but not worth downvoting. - David Thornley
No need to downvote your rant, although it is unhelpful in many ways and a vote would be easily justified. I told you what's the problem with your answer, others did as well. It is not your opinion. It is just the rant character. If you want to rant, why not start a blog. See, I just told you what's wrong if your answer, your thank-you is to bash me. The rest of my comment was not about your answer, it was about comments. Somebody writes "if vi is too complicated, use other easier tools, which work with mouse" you respond "vi its too complicated, I want to work with mouse"... aaalright.. - ypnos
Though there is a little bit more rant in your answer than one might expect on stackoverflow, this is still a good answer and I can't believe it has so many downvotes. My personal viewpoint is somewhat different than yours, I prefer Linux for developement, yet there is some truth in everything you say (well, except the ease of the CreateFile API, see alex' comment...) so I voted you up. Basically I read that answer as "If you like clicking more than typing, then windows is better" and even though I personally like typing more, your if-then-construction is still valid and true. - Brian Schimmel
@Brian Schimmel: Perhaps I should have summarized it all with your "If you like clicking more than typing, then windows is better". Anyway, the +9/-11 votes are informative. The irony is that my personal computer runs on Linux, so, yes, I did try the "typing way". But what makes me smile is that where I work (and this is a major software developer), Visual C++ is used by more than half "server developers", and our servers apps are delivered as Solaris and Linux binaries (the windows binaries are not sold to the client), so, all in all, despite the votes, just by looking my co-workers... - paercebal
15
[+2] [2009-09-20 18:17:01] rpg

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.


I understand that a good craftsman knows his tool, however claiming you'll be half as productive as in windows is as if you're saying your tool does all the work for you. - vise
(2) Often code introspection tools like Visual Assist do indeed do a lot of legwork for you. - Tom Leys
A lot of the issues you mention can be done easily with Linux, using cscope (find definition, callers, references ...) , insight/ddd/emacs+gdb (more 'visual' debugging), etc. - John Ledbetter
(2) @rpg: you don't know the Linux toolset. It's a bit more advanced than what you make it out to be. - Paul Nathan
(1) So what did I miss Paul? I'm using an IDE on Linux and I feel that I am more productive. - rpg
There are two options for the "search for the proper make directive, edit the file by hand, make sure that I didn't break anything" problem: use wildcards and never include source files you don't want compiled, or use automake and a makefile.am - James Morris
16
[+2] [2009-09-21 15:52:16] Nemanja Trifunovic

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 :)


17
[+1] [2009-09-20 11:41:30] barism

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/0201433079
[2] http://qt.nokia.com/products/
[3] http://www.boost.org/
[4] http://www.wxwidgets.org/
[5] http://stackoverflow.com/questions/1302786/c-ide-for-solaris-sparc/1365073

(1) 2nd Edition is from 2005 amazon.com/Advanced-Programming-UNIX-Environment-2nd/dp/… - Cristian Adam
Cristian: thanks, i didn't know the new edition. - barism
18
[+1] [2009-10-17 19:39:14] andremo

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


19
[+1] [2009-09-23 13:00:32] Liran Orevi

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#618735

+1, Buying MS Visual C++ was the biggest waste of my money as far as programming went, and I was on a tight budget. Soon after I found out about Linux and made the switch. It took some time to get used to, but I believe I've learned a hell of a lot more than I otherwise would have. - James Morris
The closer to the O.S. for me is definitely a good thing. The openness makes me happy :-) - James Morris
The openness is a good thing because during those moments where you don't have anything to do, you'll start playing around and find something of interest to delve into. - James Morris
20
[+1] [2009-09-21 21:51:23] Bugmaster

If 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%5FIDEA
[2] http://en.wikipedia.org/wiki/ReSharper
[3] http://en.wikipedia.org/wiki/Eclipse%5F%28software%29
[4] http://en.wikipedia.org/wiki/Yggdrasil

21
[0] [2009-10-17 19:58:43] Matt

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.


22
[0] [2010-07-01 23:49:37] matcher1

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?


23
[0] [2010-09-01 06:19:47] Ritch

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?


24
[0] [2009-09-20 22:32:33] mblackwell8

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.


eclipse cdt? It's intellisense is pretty good. - KitsuneYMG
I find VS intellisense (in unmanaged C++) to be frustrating. It's great stuff when it works, and it frequently doesn't. - David Thornley
VS intellisense does have occasional problems. When you end up having a problem delete the .ncb file and let it be regenerated that seems to correct it many times. I had hangs and reference off by 1 problems. When I deleted the .ncb and it regenerated the .ncb those problems were fixed in both cases. - pgast
25
[0] [2009-09-21 10:39:47] Michael Foukarakis

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. :)


26
[0] [2009-09-20 14:59:07] DVK

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.


27
[0] [2009-09-20 11:31:35] jldupont

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

[1] http://www.gnome.org/

28