<div dir="ltr">I don't think anyone has ranted about moving the code-base to C++ before - although Rodrigo Cabral (the original Oracle Spatial driver author) was hot on the idea years ago. Modernization is a good thing and you're probably right regarding the continuation of the project - so I'm very supportive of the idea.<div><br></div><div>Still, it's likely a lot of work depending on how far it was taken. I mean does this mean turning xxxxxObj structures into proper C++ classes, etc...? How would you see pulling off a conversion like that off? I mean, is this something that would best be handled by a single developer (not pointing fingers) under contract? If yes, how big a contact?</div><div><br></div><div>Definitely RFC worthy...</div><div><br></div><div>--Steve</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 26, 2019 at 5:43 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
the kind of topics that is always controversial, but I do think this is a <br>
matter of survival for the project. I can write C89 code for sure, but which <br>
bad thing did I do to still be obliged to do it :-) ? Should new contributors <br>
be constrained by that... 2020 is just in a few days :-)<br>
<br>
Do we have a strong reason to stay with C89 for our .c files ? Not being able <br>
to use for loop initial declarations ( that is "for( int i = 0; i < ... ; ++)" <br>
) is the example of something really annoying. Or being able to put <br>
declarations in the middle of a function instead of putting them at the <br>
beginning of it. This makes code harder to read, maintain and more error prone <br>
because of potential accidental reuse of variables that shouldn't.<br>
<br>
All gcc and clang compilers from the last 10 years support C99. Regarding <br>
MSVC, MSVC >= 2015 has decent enough support of it. Do we need to support <br>
older MSVC versions ? I don't think so. Neither current GDAL nor PROJ can <br>
built with older versions <br>
<br>
For the record, PROJ requires C99 for its few remaining .c files (and C++11 <br>
for .cpp. So does GDAL)<br>
<br>
Next topic would be a<br>
<br>
for i in *.c; do mv $i "`basename $i .c`.cpp"; done<br>
<br>
Well, maybe not like that, because I'm expecting a ton of warnings. But more <br>
on a case by case basis where someone needs to do non-trivial changes in part <br>
of the code.<br>
<br>
Being constrained by C deeply sucks honesty. Apart from the Linux kernel which <br>
still resists for good reasons, I can't think of a single one for MapServer.<br>
<br>
The main point where C sucks is string manipulation, and MapServer does a ton <br>
of it. Being able to use std::string would be such a relief.<br>
<br>
Ah for the record, we do have C++ in the code base: mapogr.cpp and the agg <br>
renderer.<br>
<br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
_______________________________________________<br>
mapserver-dev mailing list<br>
<a href="mailto:mapserver-dev@lists.osgeo.org" target="_blank">mapserver-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a></blockquote></div>