Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread NIkolai Marchenko
Which actually raises the question, can we get Extract Lambda refactoring ?:) On Fri, Jun 3, 2016 at 4:59 PM, NIkolai Marchenko wrote: > Or you could turn the second expression into a lamba for lazy evaluation > and use it like > bool computationNeeded = [](){ return another.such(that, makes, >

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread NIkolai Marchenko
Or you could turn the second expression into a lamba for lazy evaluation and use it like bool computationNeeded = [](){ return another.such(that, makes, the.line.too.long) || and.then.some.more(); } if (alreadyComputed || computationNeeded()) On Fri, Jun 3, 2016 at 4:37 PM, Olivier Goffart wro

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Marc Mutz
On Friday 03 June 2016 15:14:13 Edward Welbourne wrote: > Marc Mutz > > > The three clauses should stay three clauses if the action (their > > then-block) is independent. If the then-block, as you seem to suggest, > > is idenitical in tokens and semantics, then you *will* find a name to > > descri

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Olivier Goffart
On Freitag, 3. Juni 2016 12:50:08 CEST Edward Welbourne wrote: > On Friday 03 June 2016 10:05:52 Edward Welbourne wrote: > >> if (somee.really(long.and.complicated, expression) || > >> another.such(that, makes, the.line.too.long) || and.then.some.more()) > Marc Mutz responded: > > To be perfect

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Thiago Macieira
On sexta-feira, 3 de junho de 2016 13:10:42 BRT Edward Welbourne wrote: > Thiago Macieira > > > Another thing to be very, VERY careful is about nested function call > > > > chains, as in: > >if (foo(bar(), baz(quux()), variable, xyz()) == variable) > > > > Can you tell me if bar, baz, qu

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Edward Welbourne
Marc Mutz > The three clauses should stay three clauses if the action (their > then-block) is independent. If the then-block, as you seem to suggest, > is idenitical in tokens and semantics, then you *will* find a name to > describe it that doesn't just transliterate the original C++ code into > En

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Edward Welbourne
Thiago Macieira > Another thing to be very, VERY careful is about nested function call > chains, as in: > >if (foo(bar(), baz(quux()), variable, xyz()) == variable) > > Can you tell me if bar, baz, quux, or xyz modify variable? If so, what > is the call order? If any of bar, baz, quux or x

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Marc Mutz
On Friday 03 June 2016 14:50:08 Edward Welbourne wrote: > On Friday 03 June 2016 10:05:52 Edward Welbourne wrote: > >> if (somee.really(long.and.complicated, expression) || > >> another.such(that, makes, the.line.too.long) || and.then.some.more()) > > Marc Mutz responded: > > To be perfectly b

Re: [Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Thiago Macieira
On sexta-feira, 3 de junho de 2016 12:50:08 BRT Edward Welbourne wrote: > > To be perfectly blunt: such expressions shouldn't be > > allowed. Period. Neither with nor without line breaks. Such monsters > > should be subjected to Extract Method with extreme prejudice. > > I'm fascinated - and we're

[Development] when to Extract Method (was Re: commas in ctor-init-lists)

2016-06-03 Thread Edward Welbourne
On Friday 03 June 2016 10:05:52 Edward Welbourne wrote: >> if (somee.really(long.and.complicated, expression) || another.such(that, >> makes, the.line.too.long) || and.then.some.more()) Marc Mutz responded: > To be perfectly blunt: such expressions shouldn't be > allowed. Period. Neither with