On 2/9/2013 3:24 PM, Evan Huus wrote:
On Sat, Feb 9, 2013 at 1:50 PM, Guy Harris <guy@xxxxxxxxxxxx> wrote:
(Subject line changed to match what you presumably intended.)
Yes, thank you.
On Feb 9, 2013, at 6:41 AM, Evan Huus <eapache@xxxxxxxxx> wrote:
This just occurred to me as I was reading an article on GCC (which has
recently migrated to using a C++ compiler, despite still being mostly
written in C). I haven't given it a great deal of thought yet, but I
figured I'd bring it up and see what general opinion was.
At a first glance, building Wireshark with C++ compilers would give us
two major benefits:
...
- Built-in exceptions. This would be additional migration work, but it
would permit us to drop a non-trivial amount of code that we currently
own in order to do our own exceptions.
Note that I'm not suggesting we start writing Wireshark in C++ (that's
an entirely different debate), but that we could compile using C++
compilers, and then potentially sneak in a few C++ constructs where we
used to roll our own.
Presumably by "start writing Wireshark in C++" you mean "rearchitecting Wireshark as a C++ program", as once you've snuck in one C++ construct you're writing in C++. :-)
Fair point.
Note that some of Wireshark, i.e. the Qt GUI part, is already written in C++, and at least one third-party Wireshark plugin, i.e. the WSGD packet description language plugin:
http://wsgd.free.fr
is written in C++.
I was aware of the QT GUI, but not of the extension. As far as I'm
aware, Gerald's been doing the vast majority of the QT work, so I
didn't want to take that as indicative of a general interest.
See also
http://hub.opensolaris.org/bin/view/User+Group+rs-osug/evan-adams
The Old Man and the C
Evan Adams
Sun Microsystems
Abstract
"You can't teach an old dog new tricks" goes the old proverb. This is a story about a pack of old dogs (C programmers) and their odyssey of trying to learn new tricks (C++ programming).
C++ is a large, complex language which can easily be abused, but also includes many features to help programmers more quickly write higher quality code. The TeamWare group consciously decided which C++ features to use and, just as importantly, which features not to use. We also incrementally adopted those features we chose to use. This resulted in a successful C++ experience.
Very interesting article - I agree with most of it. I personally have
some C++ experience (though less than I do pure C), but I have no idea
what kind of experience with it others have. I do think that slowly
and carefully adopting certain limited features of it would make our
lives easier, though honestly the primary reason I suggested it was
because of how fed up I am with MSVC :)
Evan
___________________________________________________________________________
Sent via: Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives: http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe
I haven't done any Wireshark development recently, and all of the
dissectors I have written were proprietary and not submitted.
That said, I have some experience with C to C++ transitions. Twice in
my career, the team I was with was given the job of maintaining legacy
products written in C (several 100K lines of code) to maintain and
enhance. In both cases, our first step was to recompile with a C++
compiler. This was done as a quick and intense effort without
introducing any C++ language features. We would just get the code to
compile, link and pass its regression tests. Only later did we replace
#defines with consts, macros with inline functions and such. I judged
these efforts as being very beneficial in improving code quality.
As fixing and enhancing could not stop, a small special team was
assigned the work. They basically kept recompiling, transitioning and
merging until they a had C++ equivalent code base. Then, the whole team
switched to the new code base.
Don