On 13-08-16 04:38 AM, Nick Treleaven wrote:
On 16/08/2013 07:36, Lex Trotman wrote:
The more we can allow modern(ish :) programming styles using a well known standard the simpler it is to produce correct code (eg inlines not macros, who will remember that EMPTY may compute its arguments multiple times).
That's why it's in capitals, so it's clear it's a macro. An inline would be better, good idea. Though for FALLBACK we don't know the return type.
Templates! Oh wait, C, right :)
At the moment C11 is too new (not enough complete support) but C99 is fine.
Unless we follow the example of gcc itself and upgrade to C++ :)
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.
+1. While I'm also not sure it's a good idea in Geany and certainly won't be pressing for it anytime soon, 90% of C++'s crumminess is due to backwards compatibility with C, so I think it should be (theoretically, not socially) possible to gradually transition from one to the other in a project like Geany without too much pain.
Fun (but useless) fact: over 50% of Geany's codebase is already C++[1]
</offtopic>
Cheers, Matthew Brush
[1] Based on count of *.cxx vs *.c files in codebase, and obviously including Scintilla, which isn't really part of our program, hence the "(but useless)".