Re: Fix for tny_camel_account_matches_url_string_default()



On Thu, 2007-07-12 at 11:54 +0200, Murray Cumming wrote:
> On Thu, 2007-07-12 at 11:22 +0200, Philip Van Hoof wrote:
> > Please in Tinymail always start variables at the top of a block.
> > 
> > The variables org_path and org_pos_path are in the middle of the block.
> > 
> > ps. I know this sucks but there are definitely still C compilers that
> > don't like this.
> 
> OK, will do, but I don't think you'll find any compilers in use by
> anyone likely to use tinymail that actually have this limitation. I
> personally find it's not worth making the code more error prone just for
> that theoretical case.

It's also a personal preference. In C# I also always did that. Just for
clarity too. Although I know I'm not so much into forcing coding style,
I do like things that influence the execution and/or understanding the
code to be clear.

But I'm one big grey area when it comes to coding style and things like
indentation. I know :-). 

I have this silly idea that it's good to keep your code close to what
will happen. Variables are, afaik, always put on the stack at the
beginning of a {} block. Also the ones in the middle of the {} block.

I also some times had some difficulties with optimisation flags vs. the
location of variables in gdb.

Finally. Anybody who needs really a lot of variables at the beginning of
a function, will if he puts them at the beginning of the function,
consider reusing them and/or consider redesigning what the heck he's
doing (which is probably a good idea in that case).

Reusing such an integer at a function that is called very often, might
also keep it in cache. Starting to use a new one, might be optimised by
the compiler (but I'm not sure). Although I agree that this is a micro
optimisation and that I'm "inventing" reasons, indeed :-)

> > On Thu, 2007-07-12 at 11:12 +0200, Murray Cumming wrote:
> > > This patch stops tny_camel_account_matches_url_string_default() from
> > > falsely matching accounts when there are 2 local maildir accounts.


-- 
Philip Van Hoof, software developer
home: me at pvanhoof dot be 
gnome: pvanhoof at gnome dot org 
http://www.pvanhoof.be/blog







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]