Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-06 Thread Nick Treleaven
On 05/09/2013 10:48, Matthew Brush wrote: On 13-09-05 02:26 AM, Nick Treleaven wrote: On 01/09/2013 02:36, Matthew Brush wrote: On 13-08-29 05:08 AM, Nick Treleaven wrote: On 29/08/2013 02:39, Matthew Brush wrote: [...] If we were to use C++, I think it'd be pointless to limit it to CFront

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-05 Thread Matthew Brush
On 13-09-05 02:26 AM, Nick Treleaven wrote: On 01/09/2013 02:36, Matthew Brush wrote: On 13-08-29 05:08 AM, Nick Treleaven wrote: On 29/08/2013 02:39, Matthew Brush wrote: [...] If we were to use C++, I think it'd be pointless to limit it to CFront/CwithClasses-style 1980's C++. We should u

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-05 Thread Nick Treleaven
On 05/09/2013 10:26, Nick Treleaven wrote: Also even if there were more C++ programmers, it would still be much easier for a C++ programmer to write C than vice versa. Here I meant *idiomatic* (STL-heavy) C++. Some features e.g. references are well known to programmers of other languages and I

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-05 Thread Nick Treleaven
On 01/09/2013 02:36, Matthew Brush wrote: On 13-08-29 05:08 AM, Nick Treleaven wrote: On 29/08/2013 02:39, Matthew Brush wrote: [...] If we were to use C++, I think it'd be pointless to limit it to CFront/CwithClasses-style 1980's C++. We should use common/standard stuff like standard librar

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-05 Thread Nick Treleaven
On 05/09/2013 09:41, Matthew Brush wrote: On 13-09-04 09:20 AM, Nick Treleaven wrote: My C89 & C++ version: guint i; foreach_document(i) { GeanyDocument *doc = documents[i]; // do stuff with every valid doc } While this code is short, it's actually sort of nuts too (and also not ve

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-05 Thread Matthew Brush
On 13-09-04 09:20 AM, Nick Treleaven wrote: On 01/09/2013 02:36, Matthew Brush wrote: I would even go so far as to say it's silly to not use C++11 since it's [...] Just for fun I wrote some theoretical code that could be used in a program like Geany to compare styles between various C's and

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-04 Thread Nick Treleaven
On 01/09/2013 01:08, Lex Trotman wrote: I mean inheritance and virtual functions. I don't think they would pull >their weight in src, unless we were going to use gtkmm for custom widgets. Agree I can't immediately think of places where inheritance is likely to be useful at high level, but thats

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-09-04 Thread Nick Treleaven
On 01/09/2013 02:36, Matthew Brush wrote: I would even go so far as to say it's silly to not use C++11 since it's [...] Just for fun I wrote some theoretical code that could be used in a program like Geany to compare styles between various C's and C++'s (note: none of it tested). http://past

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Matthew Brush
On 13-08-31 04:37 PM, Lex Trotman wrote: On 1 September 2013 00:05, Nick Treleaven wrote: On 29/08/2013 06:47, Lex Trotman wrote: [...] On using gtkmm, personally I think it is *way* better than the C interface to GTK, but I don't know if it can be mixed with C GTK easily, and changing *

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Matthew Brush
On 13-08-31 07:05 AM, Nick Treleaven wrote: On 29/08/2013 06:47, Lex Trotman wrote: [...] Nick has offered that C++ "might" attract him to contribute more, I "might" have time at the end of my current contract, unless I get another quickly, I guess Colomban is out, Matthew? anybody else? I'

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Matthew Brush
On 13-08-31 07:42 PM, Lex Trotman wrote: [...] Just for fun I wrote some theoretical code that could be used in a program like Geany to compare styles between various C's and C++'s (note: none of it tested). http://pastebin.geany.org/**gYFMO/ As discu

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Lex Trotman
[...] > >> > Just for fun I wrote some theoretical code that could be used in a program > like Geany to compare styles between various C's and C++'s (note: none of > it tested). > > http://pastebin.geany.org/**gYFMO/ As discussed on IRC here's another way of d

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Matthew Brush
On 13-08-29 05:08 AM, Nick Treleaven wrote: On 29/08/2013 02:39, Matthew Brush wrote: [...] If we were to use C++, I think it'd be pointless to limit it to CFront/CwithClasses-style 1980's C++. We should use common/standard stuff like standard library containers, inheritance (maybe not multip

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Lex Trotman
[...] > Readability is definitely better in C++11 when avoiding iterators and >>> using lambdas, but I was kind of hoping we could avoid those ugly cases. >>> I >>> wasn't thinking of using the STL heavily, just a few containers like >>> string, and perhaps others for any specialized use cases. >

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Lex Trotman
On 1 September 2013 00:05, Nick Treleaven wrote: > On 29/08/2013 06:47, Lex Trotman wrote: > >> On the topic of exceptions, remember many STL operations and "new" can >> throw. Of course only throwing on uncorrectable errors like out of memory >> is fine, it just exits the application. Thats wha

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Nick Treleaven
On 29/08/2013 13:52, Lex Trotman wrote: I would even go so far as to say it's silly to not use C++11 since it's such a major improvement over previous C++ versions, in both performance I'm curious, why does it perform better? I'm putting words in Matthews mouth here, but things like move

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-31 Thread Nick Treleaven
On 29/08/2013 06:47, Lex Trotman wrote: On the topic of exceptions, remember many STL operations and "new" can throw. Of course only throwing on uncorrectable errors like out of memory is fine, it just exits the application. Thats what will happen to a throw from Scintilla in current Geany, its

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-29 Thread Lex Trotman
Hi Nick, [...] > > I would even go so far as to say it's silly to not use C++11 since it's >> such a major improvement over previous C++ versions, in both performance >> > > I'm curious, why does it perform better? I'm putting words in Matthews mouth here, but things like move semantics can re

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-29 Thread Nick Treleaven
On 29/08/2013 02:39, Matthew Brush wrote: Personally, I think it'd be great to use C++ in Geany, and it would more than likely actually make it *easier* for people to contribute since outside of a sampling of GTK+-using desktop/GUI software (and obviously embedded, kernel, drivers, and similar),

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-28 Thread Lex Trotman
Nick, Matthew, Dimitar, To keep it short, a few comments: @Nick, Thinking back on previous conversions from C to C++, those that went smoothest were the ones that first changed to compiling with the C++ compiler, with minimal changes to the C code. This means that you are not having to be unrea

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-28 Thread Matthew Brush
On 13-08-26 08:07 AM, Nick Treleaven wrote: From the C99 discussion: lex: >>> Unless we follow the example of gcc itself and upgrade to C++ :) me: >> Not sure that's a good idea for Geany now, although I'm glad that gcc >> did it. They use a restricted subset IIRC. I miss templates and RAII

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-28 Thread Dimitar Zhekov
On Wed, 28 Aug 2013 15:52:17 +0100 Nick Treleaven wrote: > >> * Developer enjoyment, productivity & gaining more experience with C++. > >> (This might be an incentive for e.g. me to spend more time working on > >> Geany). This has to be offset against those that might need to learn > >> e.g. RAII

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-28 Thread Nick Treleaven
On 27/08/2013 02:48, Lex Trotman wrote: Hi Nick, Thanks for the well thought out sensible proposal. In general I agree with the idea of progressively moving appropriate parts of the code to using appropriate C++ features. Of course, as usual, I disagree on some of the details and I'm sure we w

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-28 Thread Nick Treleaven
On 26/08/2013 19:54, Dimitar Zhekov wrote: On Mon, 26 Aug 2013 16:07:13 +0100 Nick Treleaven wrote: * RAII - this is a pretty essential feature for safe resource >management. This works for global/static and auto classes. We can wrap a gchar *s = g_strdup_printf() in a class, but I'd rather no

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-26 Thread Lex Trotman
Hi Nick, Thanks for the well thought out sensible proposal. In general I agree with the idea of progressively moving appropriate parts of the code to using appropriate C++ features. Of course, as usual, I disagree on some of the details and I'm sure we would disagree on some of the selections of

Re: [Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-26 Thread Dimitar Zhekov
On Mon, 26 Aug 2013 16:07:13 +0100 Nick Treleaven wrote: > I now think gradually using a (quite heavily restricted) subset of C++98 > for *some* source files might be better than moving to C99 [...] > > Reasons: > > * RAII - this is a pretty essential feature for safe resource > management.

[Geany-Devel] Let's move to C++98 - Re: Lets move to C99

2013-08-26 Thread Nick Treleaven
From the C99 discussion: lex: >>> Unless we follow the example of gcc itself and upgrade to C++ :) me: >> Not sure that's a good idea for Geany now, although I'm glad that gcc >> did it. They use a restricted subset IIRC. I miss templates and RAII in >> C though. I now think gradually using a (