Re: [Firebird-devel] Two in one

2014-03-26 Thread Dimitry Sibiryakov
26.03.2014 11:19, Alex Peshkoff wrote: > What do you not like here is definitely non-obvious... Enormous 'if' statement I don't like there. -- WBR, SD. -- Learn Graph Databases - Download FREE O'Reilly Book "Graph

Re: [Firebird-devel] Two in one

2014-03-26 Thread Alex Peshkoff
On 03/25/14 20:35, Dimitry Sibiryakov wrote: > 25.03.2014 17:19, Adriano dos Santos Fernandes wrote: >> Without know what is "foo" and the meaning of "flag" in it, I would not >> say it is (or is not) two routines in one. > For examples you can look at why.cpp:YStatement::CheckCursor() can be

Re: [Firebird-devel] Two in one

2014-03-25 Thread Dimitry Sibiryakov
25.03.2014 17:19, Adriano dos Santos Fernandes wrote: > Without know what is "foo" and the meaning of "flag" in it, I would not > say it is (or is not) two routines in one. For examples you can look at why.cpp:YStatement::CheckCursor() or less obvious VIO_verb_cleanup(). Depending on the valu

Re: [Firebird-devel] Two in one

2014-03-25 Thread Adriano dos Santos Fernandes
On 25/03/2014 13:14, Dimitry Sibiryakov wrote: >Hello, All. > >Currently in codebase there is a quite a few routines that looks like this: > > void foo(bool flag) > { >if (flag) >{ > //do something >} >else >{ > // do something completely different >} > } >

[Firebird-devel] Two in one

2014-03-25 Thread Dimitry Sibiryakov
Hello, All. Currently in codebase there is a quite a few routines that looks like this: void foo(bool flag) { if (flag) { //do something } else { // do something completely different } } Isn't it a bad coding style - to put, actually, two different routines i