8 comments
Comment actions Permalink

Hi... What is the subject of dicussion? Sorry, but at times I don't
understand the input you're trying to gather...

Thanks, Amir


"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:2013972.1133273778435.JavaMail.javamailuser@localhost...

State of request #9204- Code Reformatting Request: ternary to if/else
has changed to "To be discussed". If you want to comment on it please do
not reply to this message but add comment to the request's thread instead
at http://www.intellij.net/tracker/resharper/viewSCR?publicId=9204



0
Comment actions Permalink

Hello Amir,

why this should be a formatting option? I'd say that such a transformation
could be a context action.
The differences between ternary expression and IF statement are too serious
for me to consider usage of one or another
just as a coding style issue. Not sure about C#, but in case of C++ this
could affect the generated assembly
code in a non-trivial way.

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hi... What is the subject of dicussion? Sorry, but at times I don't
understand the input you're trying to gather...

Thanks, Amir

"Valentin Kipiatkov" <valentin@intellij.com> wrote in message
news:2013972.1133273778435.JavaMail.javamailuser@localhost...

>> State of request #9204- Code Reformatting Request: ternary to if/else
>> has changed to "To be discussed". If you want to comment on it please
>> do
>> not reply to this message but add comment to the request's thread
>> instead
>> at http://www.intellij.net/tracker/resharper/viewSCR?publicId=9204


0
Comment actions Permalink

I agree completely. The request was posted before the concpet of context
actions was introduced...

"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d9bbd798c7c34185e89917@news.intellij.net...

Hello Amir,

>

why this should be a formatting option? I'd say that such a transformation
could be a context action.
The differences between ternary expression and IF statement are too
serious for me to consider usage of one or another
just as a coding style issue. Not sure about C#, but in case of C++ this
could affect the generated assembly
code in a non-trivial way.



0
Comment actions Permalink

Hello Amir,

Where is the rule that refactorings are only about coding style?

Surely refactorings are about changing the code without changing the meaning
and functionality. This 'could' probably be taken to the limit that the compiled
code should be equivalent, but I really think not - pushing up/down methods
and extracting superclass and many other refactorings certainly do not leave
the compiled code the same - and would certainly affect performance too!

I, for one, think that anywhere within a language where there are similarities
in language expressions there is a great opportunity for a simple refactoring.
Agreed that many if/else blocks are quite large (read: in need of refactoring
maybe) but quite often they are small and might actually be more readable
in a ternary version (and vice versa) - I see the use of that and extract
method/field together to provide the developer the tool to refactor between
equivalent code.

Ronnie

I agree completely. The request was posted before the concpet of
context actions was introduced...

"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d9bbd798c7c34185e89917@news.intellij.net...

>> Hello Amir,
>>
>> why this should be a formatting option? I'd say that such a
>> transformation
>> could be a context action.
>> The differences between ternary expression and IF statement are too
>> serious for me to consider usage of one or another
>> just as a coding style issue. Not sure about C#, but in case of C++
>> this
>> could affect the generated assembly
>> code in a non-trivial way.


0
Comment actions Permalink

Hello Ronnie,

I agree with you but how does that relate to the topic of the thread? My
point was
that the conversion in question should not be a formatting / code style
option. It's totally
OK for it to be a simple refactoring or, in out terms, a context action.


Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

Hello Amir,

Where is the rule that refactorings are only about coding style?

Surely refactorings are about changing the code without changing the
meaning and functionality. This 'could' probably be taken to the limit
that the compiled code should be equivalent, but I really think not -
pushing up/down methods and extracting superclass and many other
refactorings certainly do not leave the compiled code the same - and
would certainly affect performance too!

I, for one, think that anywhere within a language where there are
similarities in language expressions there is a great opportunity for
a simple refactoring. Agreed that many if/else blocks are quite large
(read: in need of refactoring maybe) but quite often they are small
and might actually be more readable in a ternary version (and vice
versa) - I see the use of that and extract method/field together to
provide the developer the tool to refactor between equivalent code.

Ronnie

>> I agree completely. The request was posted before the concpet of
>> context actions was introduced...
>>
>> "Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in
>> message news:c8a894d9bbd798c7c34185e89917@news.intellij.net...
>>
>>> Hello Amir,
>>>
>>> why this should be a formatting option? I'd say that such a
>>> transformation
>>> could be a context action.
>>> The differences between ternary expression and IF statement are too
>>> serious for me to consider usage of one or another
>>> just as a coding style issue. Not sure about C#, but in case of C++
>>> this
>>> could affect the generated assembly
>>> code in a non-trivial way.


0
Comment actions Permalink

Yup... It's just a matter of where to put it...

Reformatting is refactoring.
Context actions are refactorings.
Quick fixes on warnings are refactoring.
etc...

So you are correct Ronnie, we all are... :)


"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d9bdb308c7c473d1687a55@news.intellij.net...

Hello Ronnie,

>

I agree with you but how does that relate to the topic of the thread? My
point was
that the conversion in question should not be a formatting / code style
option. It's totally
OK for it to be a simple refactoring or, in out terms, a context action.

>
>

Regards,
Dmitry Shaporenkov
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

>
>> Hello Amir,
>>
>> Where is the rule that refactorings are only about coding style?
>>
>> Surely refactorings are about changing the code without changing the
>> meaning and functionality. This 'could' probably be taken to the limit
>> that the compiled code should be equivalent, but I really think not -
>> pushing up/down methods and extracting superclass and many other
>> refactorings certainly do not leave the compiled code the same - and
>> would certainly affect performance too!
>>
>> I, for one, think that anywhere within a language where there are
>> similarities in language expressions there is a great opportunity for
>> a simple refactoring. Agreed that many if/else blocks are quite large
>> (read: in need of refactoring maybe) but quite often they are small
>> and might actually be more readable in a ternary version (and vice
>> versa) - I see the use of that and extract method/field together to
>> provide the developer the tool to refactor between equivalent code.
>>
>> Ronnie
>>
>>> I agree completely. The request was posted before the concpet of
>>> context actions was introduced...
>>>
>>> "Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in
>>> message news:c8a894d9bbd798c7c34185e89917@news.intellij.net...
>>>
>>>> Hello Amir,
>>>>
>>>> why this should be a formatting option? I'd say that such a
>>>> transformation
>>>> could be a context action.
>>>> The differences between ternary expression and IF statement are too
>>>> serious for me to consider usage of one or another
>>>> just as a coding style issue. Not sure about C#, but in case of C++
>>>> this
>>>> could affect the generated assembly
>>>> code in a non-trivial way.
>



0
Comment actions Permalink

Hello Amir,

Sorry - I guess I agree then....

Ronnie

Yup... It's just a matter of where to put it...

Reformatting is refactoring.
Context actions are refactorings.
Quick fixes on warnings are refactoring.
etc...
So you are correct Ronnie, we all are... :)

"Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
news:c8a894d9bdb308c7c473d1687a55@news.intellij.net...

>> Hello Ronnie,
>>
>> I agree with you but how does that relate to the topic of the thread?
>> My
>> point was
>> that the conversion in question should not be a _formatting / code
>> style_
>> option. It's totally
>> OK for it to be a simple refactoring or, in out terms, a context
>> action.
>> Regards,
>> Dmitry Shaporenkov
>> JetBrains, Inc
>> http://www.jetbrains.com
>> "Develop with pleasure!"
>>> Hello Amir,
>>>
>>> Where is the rule that refactorings are only about coding style?
>>>
>>> Surely refactorings are about changing the code without changing the
>>> meaning and functionality. This 'could' probably be taken to the
>>> limit that the compiled code should be equivalent, but I really
>>> think not - pushing up/down methods and extracting superclass and
>>> many other refactorings certainly do not leave the compiled code the
>>> same - and would certainly affect performance too!
>>>
>>> I, for one, think that anywhere within a language where there are
>>> similarities in language expressions there is a great opportunity
>>> for a simple refactoring. Agreed that many if/else blocks are quite
>>> large (read: in need of refactoring maybe) but quite often they are
>>> small and might actually be more readable in a ternary version (and
>>> vice versa) - I see the use of that and extract method/field
>>> together to provide the developer the tool to refactor between
>>> equivalent code.
>>>
>>> Ronnie
>>>
>>>> I agree completely. The request was posted before the concpet of
>>>> context actions was introduced...
>>>>
>>>> "Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in
>>>> message news:c8a894d9bbd798c7c34185e89917@news.intellij.net...
>>>>
>>>>> Hello Amir,
>>>>>
>>>>> why this should be a formatting option? I'd say that such a
>>>>> transformation
>>>>> could be a context action.
>>>>> The differences between ternary expression and IF statement are
>>>>> too
>>>>> serious for me to consider usage of one or another
>>>>> just as a coding style issue. Not sure about C#, but in case of
>>>>> C++
>>>>> this
>>>>> could affect the generated assembly
>>>>> code in a non-trivial way.


0
Comment actions Permalink

Thanks Ronnie... :)

"Ronnie Barker" <ronnie@freenet.co.uk> wrote in message
news:b5214411e1728c7c4d581e6db74@news.jetbrains.com...

Hello Amir,

>

Sorry - I guess I agree then....

>

Ronnie

>
>> Yup... It's just a matter of where to put it...
>>
>> Reformatting is refactoring.
>> Context actions are refactorings.
>> Quick fixes on warnings are refactoring.
>> etc...
>> So you are correct Ronnie, we all are... :)
>>
>> "Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in message
>> news:c8a894d9bdb308c7c473d1687a55@news.intellij.net...
>>
>>> Hello Ronnie,
>>>
>>> I agree with you but how does that relate to the topic of the thread?
>>> My
>>> point was
>>> that the conversion in question should not be a _formatting / code
>>> style_
>>> option. It's totally
>>> OK for it to be a simple refactoring or, in out terms, a context
>>> action.
>>> Regards,
>>> Dmitry Shaporenkov
>>> JetBrains, Inc
>>> http://www.jetbrains.com
>>> "Develop with pleasure!"
>>>> Hello Amir,
>>>>
>>>> Where is the rule that refactorings are only about coding style?
>>>>
>>>> Surely refactorings are about changing the code without changing the
>>>> meaning and functionality. This 'could' probably be taken to the
>>>> limit that the compiled code should be equivalent, but I really
>>>> think not - pushing up/down methods and extracting superclass and
>>>> many other refactorings certainly do not leave the compiled code the
>>>> same - and would certainly affect performance too!
>>>>
>>>> I, for one, think that anywhere within a language where there are
>>>> similarities in language expressions there is a great opportunity
>>>> for a simple refactoring. Agreed that many if/else blocks are quite
>>>> large (read: in need of refactoring maybe) but quite often they are
>>>> small and might actually be more readable in a ternary version (and
>>>> vice versa) - I see the use of that and extract method/field
>>>> together to provide the developer the tool to refactor between
>>>> equivalent code.
>>>>
>>>> Ronnie
>>>>
>>>>> I agree completely. The request was posted before the concpet of
>>>>> context actions was introduced...
>>>>>
>>>>> "Dmitry Shaporenkov (JetBrains)" <dsha@jetbrains.com> wrote in
>>>>> message news:c8a894d9bbd798c7c34185e89917@news.intellij.net...
>>>>>
>>>>>> Hello Amir,
>>>>>>
>>>>>> why this should be a formatting option? I'd say that such a
>>>>>> transformation
>>>>>> could be a context action.
>>>>>> The differences between ternary expression and IF statement are
>>>>>> too
>>>>>> serious for me to consider usage of one or another
>>>>>> just as a coding style issue. Not sure about C#, but in case of
>>>>>> C++
>>>>>> this
>>>>>> could affect the generated assembly
>>>>>> code in a non-trivial way.
>



0

Please sign in to leave a comment.