Re: [GENERAL] C++ port of Postgres - Mailing list pgsql-hackers

From Dmitry Igrishin
Subject Re: [GENERAL] C++ port of Postgres
Date
Msg-id CAAfz9KM0YFyCS-EcnJ3Sc2mnbH-A6simuFGrVy4kM8O9gLG7Yw@mail.gmail.com
Whole thread Raw
In response to Re: [GENERAL] C++ port of Postgres  (Heikki Linnakangas <hlinnaka@iki.fi>)
List pgsql-hackers
2016-08-16 18:52 GMT+03:00 Heikki Linnakangas <hlinnaka@iki.fi>:
> On 08/16/2016 05:47 PM, Jim Nasby wrote:
>>
>> I realize there's little technical reason why we *need* C++ support. The
>> level if discipline applied to our codebase negates some of the benefits
>> of C++. But maintaining the discipline takes a lot of time and effort,
>> and makes it more difficult to attract new contributors.
>
>
> I suspect that it would take as much discipline to keep a C++ codebase
> readable, as the current C codebase. If not more.
For example, its easier and less error prone to define structures with
virtual functions in C++ than write vtables manually in C. So, the adequate
subset of the C++ features can be useful to write more readable and
maintainable C-style code. These features are:
 - abstract classes (well, structures with virtual functions); - RTTI; - lambda functions; - constexpr functions; -
destructors;- templates (very reservedly).
 

But these features should be avoided (as least for now):
 - exceptions; - the parts of the standard library which generates exceptions   (in particular, regex and thread).

-- 
// Dmitry.



pgsql-hackers by date:

Previous
From: Shay Rojansky
Date:
Subject: Re: Slowness of extended protocol
Next
From: Peter Eisentraut
Date:
Subject: Re: parallel.c is not marked as test covered