[Geany-devel] Default snippets
alex.eberspaecher at xxxxx
Fri Aug 26 10:57:08 UTC 2011
Dear Lex, dear list,
On Fri, 26 Aug 2011 20:39:38 +1000
Lex Trotman <elextr at gmail.com> wrote:
> My 0.5c worth, in C++ it is important to pre-increment unless you
> really need the previous value since post increment could create a
> wasted expensive copy of an object. Although an int isn't expensive,
> it is probably better to make it ++i in the for loop so it agrees with
> the usual idiom.
I changed that for C++ (revised patch attached).
Now that we go into details, let's briefly discuss assumptions being
made by those snippets:
The snippets for the loops assume that the counting variable is shall
be i. Furthermore, it is assumed that i was not declared before. This
seems to work for most people, however, I personally would opt for
In this case, the name of the counting variable is to be filled in by
the user (I left that decision to the user in the Fortan snippets,
too ). Changing the snippets towards less assumptions changes
Geany's default behaviour.
So, what do we want here? Anyone else +1 for less assumptions about what
the user wants?
 Considering that Fortran is mostly used in scientific computing, I
think it is reasonable to assume that `i` is not the variable the user
wants to loop over.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4696 bytes
Desc: not available
More information about the Devel