From: Phil Hobbs on
Mathias Gaunard wrote:
> On 15 juin, 10:54, Phil Hobbs <pcdhSpamMeSensel...(a)electrooptical.net>
> wrote:
>> gcc is a little
>> stricter than MS as far as enforcing some scoping rules, and generally
>> produces better error messages. MS C++ probably produces slightly
>> better code (at least it does for my purposes, which are mostly
>> console-based simulation programs).
>
> That looks like the kind of thing someone who only knows GCC through
> the old 3.4 version provided by MinGW would say.
> Isn't it simply a legend that MSVC++ generates better code? I at least
> know lots of cases where MSVC++ is much worse, like when there is a
> great deal of abstraction.

Probably so. I mainly use a hand-built GCC 4.1.2 on an X86_64 Rocks 4.3
cluster (Rocks 4.3 uses Centos 4.3, which is still on gcc 3.4.6), and as
usual, YMMV. (I've actually never used MinGW.) The difference between
gcc and MS is fairly small, but in my experience definitely favours MS
slightly. Intel is considerably better than either, especially when
there are lots of vectorizable loops around--Intel's heuristics seem to
do a much better job finding them than gcc 4.1.2. I haven't done a
whole lot of apples/apples comparisons--in my original post, I'm talking
about MS 2003 on Windows vs Intel 7.1 vs gcc 4.1 on Fedora 7 on the same
686 machine.

>> Debuggers are the real Achilles' heel of Linux development, IMHO.
>
> Linux is one of the very few platform that has valgrind, which is
> arguably one of the best debugging tool ever.

It's a great tool, which I use a couple of times a year (along with
Mudflap, which I use routinely). But it's specialized to a certain
class of bugs.

You can't load your code up into valgrind and single-step it, for
instance, or check whether the method that's being called is the one you
expected, or whether that assignment in the conditional is right or not,
or whether the input data layout is what your code is expecting, or....

The combination of gcc with valgrind and mudflap, plus Visual Studio and
icsdebug (the old VisualAge C++ debugger for OS/2, which I love) forms
the mainstay of my debugging toolkit. I hate the Visual Studio
editor--a programmer's editor with word wrap, yet--but the debugger is
pretty nice. I've also tried WireShark for TCP/IP things, but haven't
needed to get too deeply into it, fortunately.

Cheers,

Phil Hobbs

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Jorgen Grahn on
On Sat, 14 Jun 2008 04:58:14 CST, bballplaya998(a)gmail.com
<bballplaya998(a)gmail.com> wrote:
[...]
> So, the question again is - what are the differences (advantages/
> disadvantages) of using either a linux OS vs a Windows OS for
> programming?

For C++ programming, the main difference is what libraries you program
against. And attitude, perhaps.

I could write a lot of off-topic things in favor of Linux (Unix in
general, really), but instead I refer to Eric S. Raymond's book "The
Art of Unix Programming", available online at:

http://www.catb.org/~esr/writings/taoup/html/

Read the languages chapter. But be warned: the author doesn't like C++
much.

/Jorgen

--
// Jorgen Grahn <grahn@ Ph'nglui mglw'nafh Cthulhu
\X/ snipabacken.se> R'lyeh wgah'nagl fhtagn!

[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Brendan Miller on

> environment your target has. For Windoze this will most likely be a
> Micro$oft compiler. For Linux it will almost certainly be GCC.

I object to the use of "windoze" and use a $ when spelling microsoft. How
can someone take a post seriously when it uses that kind of language? It's
basically the ethnic slur of operating systems.

I have a lot of respect for the people that post on this group. Clcm is
probably the best newsgroup I've seen in terms of having an elevated level
of discussion and I'd like to see it stay that way.

I don't think that the author was intentionally trolling, as many people
seem to write things like "M$" out of habit, but I'd like to point at that
it is technically flaimbait and kind of obnoxious to a lot of people who
are trying to have serious discussions.

> GCC adheres more closely to the std and has good support for various
> warning levels, including spotting violations of Meyers Effective C++
> rules. The Windoze compiler is quicker and comes with a nice IDE with
> integrated debugger. You can have an IDE on Linux if you want using
> the C++ module for Eclipse.

G++ has historically had a higher level of compliance, and I believe is one
of the oldest C++ compilers to compile to assembly instead of just
outputting C. Currently, I'd say that g++ 4.2 and VC9 both have a very high
level of conformance to the 2003 standard. The one area of difference that
pops out at me is that VC still doesn't support exception specifications.

VC9 SP1 on the other hand has *much* better support for TR1. For instance,
GCC has no support for TR1 regular expressions, and has nonstandard tr1
header locations (header names must be prefixed with tr1). On the other
hand, my understanding is that TR1 is not a required part of the C++
standard, but an optional extention that will become standard with C++0x.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Mathias Gaunard on
On 16 juin, 07:27, Phil Hobbs <pcdhSpamMeSensel...(a)electrooptical.net>
wrote:
> The difference between
> gcc and MS is fairly small, but in my experience definitely favours MS
> slightly. Intel is considerably better than either, especially when
> there are lots of vectorizable loops around--Intel's heuristics seem to
> do a much better job finding them than gcc 4.1.2.

Version 4.3 is quite better at auto-vectorization. This was a new
feature in 4.1 and what it could do was limited.
Also, how well GCC optimizes really depends on the options used. For
some reasons it seems people are afraid of -O3 and stick to -O2, even
though it makes a great difference. Enabling code generation for a
modern CPU is important too, otherwise GCC generates code for 386.

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]

From: Andrei Alexandrescu on
Phil Hobbs wrote:
> Debuggers are the real Achilles' heel of Linux development, IMHO. The
> best Linux debugger is probably DDD, which (like all Linux debuggers)
> runs on top of the capable-but-extremely-arcane GDB. The combination is
> rather less convenient to use than MS Codeview for DOS, circa 1990. If
> you're used to Visual Studio, you're in for an unpleasant shock the
> first time that you can't find a bug using code reading and printf().
> One of my main reasons for coding for multiple platforms is that I can
> use everybody's tools, but a decent Linux debugger would go a long way
> to getting me off MS completely.

Apologies for the non-free product placement, but since you sound so
much in need :o) - the ZeroBugs debugger, written by Cristian Vlasceanu,
a good friend of mine who's a prolific hacker, has improved my
experience debugging Linux programs by leaps and bounds.

ZeroBugs is a "real" debugger (not a GDB saprophyte) meaning it has its
own engine that's been thoroughly honed. Also it has stuff you'd expect
from a today's debugger - a real GUI, syntax-coloring, C++ expression
evaluation, plugin architecture, Python scripting, memory watchpoints,
the works. FWIW, it also supports D. See www.zero-bugs.com.


Andrei

--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]