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

Lex Trotman elextr at xxxxx
Sun Sep 1 00:08:39 UTC 2013


>  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.
>> Sadly, containers means iterators, inevitably, and yes C++03 syntax is
>> ugly, but you get used to it, and just type it automatically. Pity "auto"
>> and "for( a: container )" is C++11, oh well.
> Yes. Unless we use a foreach macro ;-P


There seems to be a typo here, I assume you mean the std::for_each template

And of course requiring the use of a function object declared immediately
before the for_each, not a function declared some distance away.

> I'm not sure iterators are needed often for string though, but it's been a
> while since I looked at code using it.

Ahh, I may have been misunderstanding you again.

Strictly strings are not containers, so I havn't considered them whenever
you said container, I was thinking vector, list, etc.

I find iterators are rarely used on strings because it has operator[] and
most of the operations return an index, not an iterator.

>  I proposed banning OOP, operator overloading and exceptions in src to make
>>> it (much?) easier to understand & maintain the code vs idiomatic C++,
>>> with
>>> all its unintuitive bug-prone corner cases (which are still in C++11),
>>> see
>>> my reply to Lex for more info.
>>>  Looking at it again, I'm not sure we mean the same thing by OOP, its a
>> much
>> abused and overloaded term, could you perhaps explain your meaning?
>>   Depending on what you mean, banning it is either sensible, or the
>> silliest
>> idea ever :)
> 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 no reason to ban it.

Mind you, the concepts of document and filetype could be combined by
deriving a filetype specific document type from the base Document class,
allowing filetype specific overriding of functions like indenting :)

class Perl_document::Document { etc };

Which brings me to the point that some *design* and planning might be
useful before we start hacking.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geany.org/pipermail/devel/attachments/20130901/49d538e7/attachment-0001.html>

More information about the Devel mailing list