unnecessary =, == :)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

unnecessary =, == :)

Stéphane Ducasse
Check for a =, ==, ~=, or ~~ message being sent to true/false or with  
true/false as the argument. Many times these can be eliminated since  
their receivers are already booleans. For example, "anObject isFoo ==  
false" could be replaced with "anObject isFoo not" if isFoo always  
returns a boolean. Sometimes variables might refer to true, false, and  
something else, but this is considered bad style since the variable  
has multiple types.

Project>>#setChangeSet:
Project>>#isolationSet
Project>>#compileAll:from:
Project>>#writeFileNamed:fromDirectory:toServer:
Project>>#isolationHead
PNGReadWriter>>#debugging
ClockMorph>>#addCustomMenuItems:hand:
ClockMorph>>#step
ClockMorph>>#toggleShowingSeconds
ClockMorph>>#toggleShowing24hr
WorldState>>#interCyclePause:
Integer>>#quo:
Integer>>#digitSubtract:
SimpleServiceEntry>>#useLineAfter
MorphicUIManager>>#interactiveParserFor:
OBPluggableListMorph>>#mouseUp:
PianoRollScoreMorph>>#addCustomMenuItems:hand:
SystemDictionary>>#abandonSources
SystemDictionary>>#internalizeSources
SystemDictionary>>#internalizeChangeLog
SetTest>>#testRemoveIfAbsent
SimpleButtonDelayedMenuMorph>>#mouseUp:
Installer>>#validate
Installer>>#logErrorDuring:
SketchEditorMorph>>#verifyState:
SketchEditorMorph>>#deliverPainting:evt:
SketchMorph>>#useInterpolation:
Slider>>#descending
JoystickMorph>>#autoCenterString
JoystickMorph>>#button1
JoystickMorph>>#button2
SARInstaller>>#errorNoSuchMember:
MessageSet>>#growable
HandMorph>>#handleEvent:
HandMorph>>#fullDrawOn:
ImageSegment>>#declareAndPossiblyRename:
PluggableListMorphPlus>>#wantsDroppedMorph:event:
SUnitTest>>#testRanOnlyOnce
BitmapFillStyle>>#isTiled
InstallerMonticello>>#mcDetectFileBlock
FTPClient>>#login
Object>>#mustBeBooleanIn:
Object>>#'~='
Decompiler>>#pushConstant:
TextMorphForEditView>>#acceptOnCR
HostSystemMenusMenuItem>>#shift
FlapTab>>#inboard
FlapTab>>#flapShowing
FlapTab>>#tabSelected
PluggableTreeMorph>>#wantsDroppedNode:on:
DisplayScreen>>#deferUpdates:
OBSystemBrowser>>#defaultBackgroundColor
SmalltalkImage>>#setPlatformPreferences
SmalltalkImage>>#snapshot:andQuit:embedded:
URLMorph>>#mouseUp:
MultiNewParagraph>>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
Collection>>#reject:
TextDiffBuilder>>#hasMultipleMatches
TrueTest>>#testNot
TrueTest>>#testInMemory
TrueTest>>#testAND
MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
Process>>#terminate
ProtoObjectTest>>#testIsNil
SqueakPage>>#write
ColorPickerMorph>>#putUpFor:near:
FalseTest>>#testAnd
FalseTest>>#testOR
FalseTest>>#testNot
FalseTest>>#testAND
UpdatingStringMorph>>#growable
UpdatingStringMorph>>#autoAcceptOnFocusLoss
LanguageEditor>>#selectedTranslationsAt:put:
Socket>>#setOption:value:
MultiCompositionScanner>>#setFont
PositionableStream>>#unCommand
HTTPSocket>>#logToTranscript
Number>>#odd
OBHierarchyBrowser>>#defaultBackgroundColor
MorphExtension>>#isDefault
MorphExtension>>#sortedPropertyNames
MorphExtension>>#printOn:
MorphExtension>>#hasProperty:
ObjectOut>>#doesNotUnderstand:
PluggableTextMorph>>#hasEditingConflicts
PluggableTextMorph>>#accept
SimpleSliderMorph>>#truncate
OBProtocolBrowser>>#defaultBackgroundColor
SystemWindow>>#mustNotClose
SystemWindow>>#mouseDown:
RBReadBeforeWrittenTester>>#read
RBReadBeforeWrittenTester>>#processBlock:
RBReadBeforeWrittenTester>>#processStatementNode:
RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
GradientFillStyle>>#isRadialFill
RefactoryTyper>>#typeFor:
CompiledMethodTest>>#testValueWithReceiverArguments
OBLazyListMorph>>#handleMouseMove:
BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
BlockContextTest>>#testSupplySameAnswerToAllQuestions
BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
BlockContextTest>>#testSupplySpecificAnswerToQuestion
BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
ImageMorph>>#isOpaque:
ProjectSwikiServer>>#acceptsUploads
PolygonMorph>>#rotateTestFlip:
PolygonMorph>>#beStraightSegments
PolygonMorph>>#beSmoothCurve
BitBlt>>#drawFrom:to:withFirstPoint:
FileList>>#getSelectedDirectory
FileList>>#getSelectedFile
RBParser>>#patchLiteralMessage
OBMultipleSelectionColumn>>#listSelectionAt:put:
ServerDirectory>>#upLoadProject:members:retry:
MorphObjectOut>>#doesNotUnderstand:
HaloMorph>>#addHandles
ThumbnailImageMorph>>#togglePopupFeature
ThumbnailImageMorph>>#handlesMouseDown:
ThumbnailImageMorph>>#popupFeatureString
ContextPart>>#jump:if:
MCWorkingCopy>>#merge:
FileDoesNotExistException>>#readOnly
RBLiteralNodeTest>>#testValue
Prefer...

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Gary Chambers-4
PluggableTextMorph>>#accept (sadly required defence against text setters
that don't return a boolean)
SystemWindow>>#mouseDown: (removed offending line, now obsolete, apparently)

Regards, Gary

----- Original Message -----
From: "Stéphane Ducasse" <[hidden email]>
To: "Pharo Development" <[hidden email]>
Sent: Saturday, February 14, 2009 3:23 PM
Subject: [Pharo-project] unnecessary =, == :)


> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
> true/false as the argument. Many times these can be eliminated since
> their receivers are already booleans. For example, "anObject isFoo ==
> false" could be replaced with "anObject isFoo not" if isFoo always
> returns a boolean. Sometimes variables might refer to true, false, and
> something else, but this is considered bad style since the variable
> has multiple types.
>
> Project>>#setChangeSet:
> Project>>#isolationSet
> Project>>#compileAll:from:
> Project>>#writeFileNamed:fromDirectory:toServer:
> Project>>#isolationHead
> PNGReadWriter>>#debugging
> ClockMorph>>#addCustomMenuItems:hand:
> ClockMorph>>#step
> ClockMorph>>#toggleShowingSeconds
> ClockMorph>>#toggleShowing24hr
> WorldState>>#interCyclePause:
> Integer>>#quo:
> Integer>>#digitSubtract:
> SimpleServiceEntry>>#useLineAfter
> MorphicUIManager>>#interactiveParserFor:
> OBPluggableListMorph>>#mouseUp:
> PianoRollScoreMorph>>#addCustomMenuItems:hand:
> SystemDictionary>>#abandonSources
> SystemDictionary>>#internalizeSources
> SystemDictionary>>#internalizeChangeLog
> SetTest>>#testRemoveIfAbsent
> SimpleButtonDelayedMenuMorph>>#mouseUp:
> Installer>>#validate
> Installer>>#logErrorDuring:
> SketchEditorMorph>>#verifyState:
> SketchEditorMorph>>#deliverPainting:evt:
> SketchMorph>>#useInterpolation:
> Slider>>#descending
> JoystickMorph>>#autoCenterString
> JoystickMorph>>#button1
> JoystickMorph>>#button2
> SARInstaller>>#errorNoSuchMember:
> MessageSet>>#growable
> HandMorph>>#handleEvent:
> HandMorph>>#fullDrawOn:
> ImageSegment>>#declareAndPossiblyRename:
> PluggableListMorphPlus>>#wantsDroppedMorph:event:
> SUnitTest>>#testRanOnlyOnce
> BitmapFillStyle>>#isTiled
> InstallerMonticello>>#mcDetectFileBlock
> FTPClient>>#login
> Object>>#mustBeBooleanIn:
> Object>>#'~='
> Decompiler>>#pushConstant:
> TextMorphForEditView>>#acceptOnCR
> HostSystemMenusMenuItem>>#shift
> FlapTab>>#inboard
> FlapTab>>#flapShowing
> FlapTab>>#tabSelected
> PluggableTreeMorph>>#wantsDroppedNode:on:
> DisplayScreen>>#deferUpdates:
> OBSystemBrowser>>#defaultBackgroundColor
> SmalltalkImage>>#setPlatformPreferences
> SmalltalkImage>>#snapshot:andQuit:embedded:
> URLMorph>>#mouseUp:
> MultiNewParagraph>>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
> Collection>>#reject:
> TextDiffBuilder>>#hasMultipleMatches
> TrueTest>>#testNot
> TrueTest>>#testInMemory
> TrueTest>>#testAND
> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
> Process>>#terminate
> ProtoObjectTest>>#testIsNil
> SqueakPage>>#write
> ColorPickerMorph>>#putUpFor:near:
> FalseTest>>#testAnd
> FalseTest>>#testOR
> FalseTest>>#testNot
> FalseTest>>#testAND
> UpdatingStringMorph>>#growable
> UpdatingStringMorph>>#autoAcceptOnFocusLoss
> LanguageEditor>>#selectedTranslationsAt:put:
> Socket>>#setOption:value:
> MultiCompositionScanner>>#setFont
> PositionableStream>>#unCommand
> HTTPSocket>>#logToTranscript
> Number>>#odd
> OBHierarchyBrowser>>#defaultBackgroundColor
> MorphExtension>>#isDefault
> MorphExtension>>#sortedPropertyNames
> MorphExtension>>#printOn:
> MorphExtension>>#hasProperty:
> ObjectOut>>#doesNotUnderstand:
> PluggableTextMorph>>#hasEditingConflicts
> PluggableTextMorph>>#accept
> SimpleSliderMorph>>#truncate
> OBProtocolBrowser>>#defaultBackgroundColor
> SystemWindow>>#mustNotClose
> SystemWindow>>#mouseDown:
> RBReadBeforeWrittenTester>>#read
> RBReadBeforeWrittenTester>>#processBlock:
> RBReadBeforeWrittenTester>>#processStatementNode:
> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
> GradientFillStyle>>#isRadialFill
> RefactoryTyper>>#typeFor:
> CompiledMethodTest>>#testValueWithReceiverArguments
> OBLazyListMorph>>#handleMouseMove:
> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
> BlockContextTest>>#testSupplySameAnswerToAllQuestions
> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
> BlockContextTest>>#testSupplySpecificAnswerToQuestion
> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
> ImageMorph>>#isOpaque:
> ProjectSwikiServer>>#acceptsUploads
> PolygonMorph>>#rotateTestFlip:
> PolygonMorph>>#beStraightSegments
> PolygonMorph>>#beSmoothCurve
> BitBlt>>#drawFrom:to:withFirstPoint:
> FileList>>#getSelectedDirectory
> FileList>>#getSelectedFile
> RBParser>>#patchLiteralMessage
> OBMultipleSelectionColumn>>#listSelectionAt:put:
> ServerDirectory>>#upLoadProject:members:retry:
> MorphObjectOut>>#doesNotUnderstand:
> HaloMorph>>#addHandles
> ThumbnailImageMorph>>#togglePopupFeature
> ThumbnailImageMorph>>#handlesMouseDown:
> ThumbnailImageMorph>>#popupFeatureString
> ContextPart>>#jump:if:
> MCWorkingCopy>>#merge:
> FileDoesNotExistException>>#readOnly
> RBLiteralNodeTest>>#testValue
> Prefer...
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project 


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Gary Chambers-4
SystemWindow>>#mouseDown: (actually needed, on first call that property will
almost certainly be nil, set later in the method).

Regards, Gary


----- Original Message -----
From: "Gary Chambers" <[hidden email]>
To: <[hidden email]>
Sent: Saturday, February 14, 2009 5:12 PM
Subject: Re: [Pharo-project] unnecessary =, == :)


PluggableTextMorph>>#accept (sadly required defence against text setters
that don't return a boolean)
SystemWindow>>#mouseDown: (removed offending line, now obsolete, apparently)

Regards, Gary

----- Original Message -----
From: "Stéphane Ducasse" <[hidden email]>
To: "Pharo Development" <[hidden email]>
Sent: Saturday, February 14, 2009 3:23 PM
Subject: [Pharo-project] unnecessary =, == :)


> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
> true/false as the argument. Many times these can be eliminated since
> their receivers are already booleans. For example, "anObject isFoo ==
> false" could be replaced with "anObject isFoo not" if isFoo always
> returns a boolean. Sometimes variables might refer to true, false, and
> something else, but this is considered bad style since the variable
> has multiple types.
>
> Project>>#setChangeSet:
> Project>>#isolationSet
> Project>>#compileAll:from:
> Project>>#writeFileNamed:fromDirectory:toServer:
> Project>>#isolationHead
> PNGReadWriter>>#debugging
> ClockMorph>>#addCustomMenuItems:hand:
> ClockMorph>>#step
> ClockMorph>>#toggleShowingSeconds
> ClockMorph>>#toggleShowing24hr
> WorldState>>#interCyclePause:
> Integer>>#quo:
> Integer>>#digitSubtract:
> SimpleServiceEntry>>#useLineAfter
> MorphicUIManager>>#interactiveParserFor:
> OBPluggableListMorph>>#mouseUp:
> PianoRollScoreMorph>>#addCustomMenuItems:hand:
> SystemDictionary>>#abandonSources
> SystemDictionary>>#internalizeSources
> SystemDictionary>>#internalizeChangeLog
> SetTest>>#testRemoveIfAbsent
> SimpleButtonDelayedMenuMorph>>#mouseUp:
> Installer>>#validate
> Installer>>#logErrorDuring:
> SketchEditorMorph>>#verifyState:
> SketchEditorMorph>>#deliverPainting:evt:
> SketchMorph>>#useInterpolation:
> Slider>>#descending
> JoystickMorph>>#autoCenterString
> JoystickMorph>>#button1
> JoystickMorph>>#button2
> SARInstaller>>#errorNoSuchMember:
> MessageSet>>#growable
> HandMorph>>#handleEvent:
> HandMorph>>#fullDrawOn:
> ImageSegment>>#declareAndPossiblyRename:
> PluggableListMorphPlus>>#wantsDroppedMorph:event:
> SUnitTest>>#testRanOnlyOnce
> BitmapFillStyle>>#isTiled
> InstallerMonticello>>#mcDetectFileBlock
> FTPClient>>#login
> Object>>#mustBeBooleanIn:
> Object>>#'~='
> Decompiler>>#pushConstant:
> TextMorphForEditView>>#acceptOnCR
> HostSystemMenusMenuItem>>#shift
> FlapTab>>#inboard
> FlapTab>>#flapShowing
> FlapTab>>#tabSelected
> PluggableTreeMorph>>#wantsDroppedNode:on:
> DisplayScreen>>#deferUpdates:
> OBSystemBrowser>>#defaultBackgroundColor
> SmalltalkImage>>#setPlatformPreferences
> SmalltalkImage>>#snapshot:andQuit:embedded:
> URLMorph>>#mouseUp:
> MultiNewParagraph>>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
> Collection>>#reject:
> TextDiffBuilder>>#hasMultipleMatches
> TrueTest>>#testNot
> TrueTest>>#testInMemory
> TrueTest>>#testAND
> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
> Process>>#terminate
> ProtoObjectTest>>#testIsNil
> SqueakPage>>#write
> ColorPickerMorph>>#putUpFor:near:
> FalseTest>>#testAnd
> FalseTest>>#testOR
> FalseTest>>#testNot
> FalseTest>>#testAND
> UpdatingStringMorph>>#growable
> UpdatingStringMorph>>#autoAcceptOnFocusLoss
> LanguageEditor>>#selectedTranslationsAt:put:
> Socket>>#setOption:value:
> MultiCompositionScanner>>#setFont
> PositionableStream>>#unCommand
> HTTPSocket>>#logToTranscript
> Number>>#odd
> OBHierarchyBrowser>>#defaultBackgroundColor
> MorphExtension>>#isDefault
> MorphExtension>>#sortedPropertyNames
> MorphExtension>>#printOn:
> MorphExtension>>#hasProperty:
> ObjectOut>>#doesNotUnderstand:
> PluggableTextMorph>>#hasEditingConflicts
> PluggableTextMorph>>#accept
> SimpleSliderMorph>>#truncate
> OBProtocolBrowser>>#defaultBackgroundColor
> SystemWindow>>#mustNotClose
> SystemWindow>>#mouseDown:
> RBReadBeforeWrittenTester>>#read
> RBReadBeforeWrittenTester>>#processBlock:
> RBReadBeforeWrittenTester>>#processStatementNode:
> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
> GradientFillStyle>>#isRadialFill
> RefactoryTyper>>#typeFor:
> CompiledMethodTest>>#testValueWithReceiverArguments
> OBLazyListMorph>>#handleMouseMove:
> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
> BlockContextTest>>#testSupplySameAnswerToAllQuestions
> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
> BlockContextTest>>#testSupplySpecificAnswerToQuestion
> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
> ImageMorph>>#isOpaque:
> ProjectSwikiServer>>#acceptsUploads
> PolygonMorph>>#rotateTestFlip:
> PolygonMorph>>#beStraightSegments
> PolygonMorph>>#beSmoothCurve
> BitBlt>>#drawFrom:to:withFirstPoint:
> FileList>>#getSelectedDirectory
> FileList>>#getSelectedFile
> RBParser>>#patchLiteralMessage
> OBMultipleSelectionColumn>>#listSelectionAt:put:
> ServerDirectory>>#upLoadProject:members:retry:
> MorphObjectOut>>#doesNotUnderstand:
> HaloMorph>>#addHandles
> ThumbnailImageMorph>>#togglePopupFeature
> ThumbnailImageMorph>>#handlesMouseDown:
> ThumbnailImageMorph>>#popupFeatureString
> ContextPart>>#jump:if:
> MCWorkingCopy>>#merge:
> FileDoesNotExistException>>#readOnly
> RBLiteralNodeTest>>#testValue
> Prefer...
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project 


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Igor Stasenko
Sometimes i using ivars , which going to hold boolean value only , but
i leave it to be initialized later
so, a value of variable could be nil, true, false.
Accessor, however alway returns a boolean, but depending of default
value it could look like:
^ myvar == true

or
^ myvar == false



2009/2/14 Gary Chambers <[hidden email]>:

> SystemWindow>>#mouseDown: (actually needed, on first call that property will
> almost certainly be nil, set later in the method).
>
> Regards, Gary
>
>
> ----- Original Message -----
> From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, February 14, 2009 5:12 PM
> Subject: Re: [Pharo-project] unnecessary =, == :)
>
>
> PluggableTextMorph>>#accept (sadly required defence against text setters
> that don't return a boolean)
> SystemWindow>>#mouseDown: (removed offending line, now obsolete, apparently)
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Stéphane Ducasse" <[hidden email]>
> To: "Pharo Development" <[hidden email]>
> Sent: Saturday, February 14, 2009 3:23 PM
> Subject: [Pharo-project] unnecessary =, == :)
>
>
>> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
>> true/false as the argument. Many times these can be eliminated since
>> their receivers are already booleans. For example, "anObject isFoo ==
>> false" could be replaced with "anObject isFoo not" if isFoo always
>> returns a boolean. Sometimes variables might refer to true, false, and
>> something else, but this is considered bad style since the variable
>> has multiple types.
>>
>> Project>>#setChangeSet:
>> Project>>#isolationSet
>> Project>>#compileAll:from:
>> Project>>#writeFileNamed:fromDirectory:toServer:
>> Project>>#isolationHead
>> PNGReadWriter>>#debugging
>> ClockMorph>>#addCustomMenuItems:hand:
>> ClockMorph>>#step
>> ClockMorph>>#toggleShowingSeconds
>> ClockMorph>>#toggleShowing24hr
>> WorldState>>#interCyclePause:
>> Integer>>#quo:
>> Integer>>#digitSubtract:
>> SimpleServiceEntry>>#useLineAfter
>> MorphicUIManager>>#interactiveParserFor:
>> OBPluggableListMorph>>#mouseUp:
>> PianoRollScoreMorph>>#addCustomMenuItems:hand:
>> SystemDictionary>>#abandonSources
>> SystemDictionary>>#internalizeSources
>> SystemDictionary>>#internalizeChangeLog
>> SetTest>>#testRemoveIfAbsent
>> SimpleButtonDelayedMenuMorph>>#mouseUp:
>> Installer>>#validate
>> Installer>>#logErrorDuring:
>> SketchEditorMorph>>#verifyState:
>> SketchEditorMorph>>#deliverPainting:evt:
>> SketchMorph>>#useInterpolation:
>> Slider>>#descending
>> JoystickMorph>>#autoCenterString
>> JoystickMorph>>#button1
>> JoystickMorph>>#button2
>> SARInstaller>>#errorNoSuchMember:
>> MessageSet>>#growable
>> HandMorph>>#handleEvent:
>> HandMorph>>#fullDrawOn:
>> ImageSegment>>#declareAndPossiblyRename:
>> PluggableListMorphPlus>>#wantsDroppedMorph:event:
>> SUnitTest>>#testRanOnlyOnce
>> BitmapFillStyle>>#isTiled
>> InstallerMonticello>>#mcDetectFileBlock
>> FTPClient>>#login
>> Object>>#mustBeBooleanIn:
>> Object>>#'~='
>> Decompiler>>#pushConstant:
>> TextMorphForEditView>>#acceptOnCR
>> HostSystemMenusMenuItem>>#shift
>> FlapTab>>#inboard
>> FlapTab>>#flapShowing
>> FlapTab>>#tabSelected
>> PluggableTreeMorph>>#wantsDroppedNode:on:
>> DisplayScreen>>#deferUpdates:
>> OBSystemBrowser>>#defaultBackgroundColor
>> SmalltalkImage>>#setPlatformPreferences
>> SmalltalkImage>>#snapshot:andQuit:embedded:
>> URLMorph>>#mouseUp:
>> MultiNewParagraph>>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
>> Collection>>#reject:
>> TextDiffBuilder>>#hasMultipleMatches
>> TrueTest>>#testNot
>> TrueTest>>#testInMemory
>> TrueTest>>#testAND
>> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
>> Process>>#terminate
>> ProtoObjectTest>>#testIsNil
>> SqueakPage>>#write
>> ColorPickerMorph>>#putUpFor:near:
>> FalseTest>>#testAnd
>> FalseTest>>#testOR
>> FalseTest>>#testNot
>> FalseTest>>#testAND
>> UpdatingStringMorph>>#growable
>> UpdatingStringMorph>>#autoAcceptOnFocusLoss
>> LanguageEditor>>#selectedTranslationsAt:put:
>> Socket>>#setOption:value:
>> MultiCompositionScanner>>#setFont
>> PositionableStream>>#unCommand
>> HTTPSocket>>#logToTranscript
>> Number>>#odd
>> OBHierarchyBrowser>>#defaultBackgroundColor
>> MorphExtension>>#isDefault
>> MorphExtension>>#sortedPropertyNames
>> MorphExtension>>#printOn:
>> MorphExtension>>#hasProperty:
>> ObjectOut>>#doesNotUnderstand:
>> PluggableTextMorph>>#hasEditingConflicts
>> PluggableTextMorph>>#accept
>> SimpleSliderMorph>>#truncate
>> OBProtocolBrowser>>#defaultBackgroundColor
>> SystemWindow>>#mustNotClose
>> SystemWindow>>#mouseDown:
>> RBReadBeforeWrittenTester>>#read
>> RBReadBeforeWrittenTester>>#processBlock:
>> RBReadBeforeWrittenTester>>#processStatementNode:
>> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
>> GradientFillStyle>>#isRadialFill
>> RefactoryTyper>>#typeFor:
>> CompiledMethodTest>>#testValueWithReceiverArguments
>> OBLazyListMorph>>#handleMouseMove:
>> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
>> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
>> BlockContextTest>>#testSupplySameAnswerToAllQuestions
>> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
>> BlockContextTest>>#testSupplySpecificAnswerToQuestion
>> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
>> ImageMorph>>#isOpaque:
>> ProjectSwikiServer>>#acceptsUploads
>> PolygonMorph>>#rotateTestFlip:
>> PolygonMorph>>#beStraightSegments
>> PolygonMorph>>#beSmoothCurve
>> BitBlt>>#drawFrom:to:withFirstPoint:
>> FileList>>#getSelectedDirectory
>> FileList>>#getSelectedFile
>> RBParser>>#patchLiteralMessage
>> OBMultipleSelectionColumn>>#listSelectionAt:put:
>> ServerDirectory>>#upLoadProject:members:retry:
>> MorphObjectOut>>#doesNotUnderstand:
>> HaloMorph>>#addHandles
>> ThumbnailImageMorph>>#togglePopupFeature
>> ThumbnailImageMorph>>#handlesMouseDown:
>> ThumbnailImageMorph>>#popupFeatureString
>> ContextPart>>#jump:if:
>> MCWorkingCopy>>#merge:
>> FileDoesNotExistException>>#readOnly
>> RBLiteralNodeTest>>#testValue
>> Prefer...
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Stéphane Ducasse
In reply to this post by Gary Chambers-4
gary do you use
        <lint: 'Long methods' rationale: 'Rendering method' author: 'lr'>
to tag the method you checked?
http://code.google.com/p/pharo/wiki/SmallLintPharoFixing

Stef

On Feb 14, 2009, at 6:14 PM, Gary Chambers wrote:

> SystemWindow>>#mouseDown: (actually needed, on first call that  
> property will
> almost certainly be nil, set later in the method).
>
> Regards, Gary
>
>
> ----- Original Message -----
> From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, February 14, 2009 5:12 PM
> Subject: Re: [Pharo-project] unnecessary =, == :)
>
>
> PluggableTextMorph>>#accept (sadly required defence against text  
> setters
> that don't return a boolean)
> SystemWindow>>#mouseDown: (removed offending line, now obsolete,  
> apparently)
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Stéphane Ducasse" <[hidden email]>
> To: "Pharo Development" <[hidden email]>
> Sent: Saturday, February 14, 2009 3:23 PM
> Subject: [Pharo-project] unnecessary =, == :)
>
>
>> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
>> true/false as the argument. Many times these can be eliminated since
>> their receivers are already booleans. For example, "anObject isFoo ==
>> false" could be replaced with "anObject isFoo not" if isFoo always
>> returns a boolean. Sometimes variables might refer to true, false,  
>> and
>> something else, but this is considered bad style since the variable
>> has multiple types.
>>
>> Project>>#setChangeSet:
>> Project>>#isolationSet
>> Project>>#compileAll:from:
>> Project>>#writeFileNamed:fromDirectory:toServer:
>> Project>>#isolationHead
>> PNGReadWriter>>#debugging
>> ClockMorph>>#addCustomMenuItems:hand:
>> ClockMorph>>#step
>> ClockMorph>>#toggleShowingSeconds
>> ClockMorph>>#toggleShowing24hr
>> WorldState>>#interCyclePause:
>> Integer>>#quo:
>> Integer>>#digitSubtract:
>> SimpleServiceEntry>>#useLineAfter
>> MorphicUIManager>>#interactiveParserFor:
>> OBPluggableListMorph>>#mouseUp:
>> PianoRollScoreMorph>>#addCustomMenuItems:hand:
>> SystemDictionary>>#abandonSources
>> SystemDictionary>>#internalizeSources
>> SystemDictionary>>#internalizeChangeLog
>> SetTest>>#testRemoveIfAbsent
>> SimpleButtonDelayedMenuMorph>>#mouseUp:
>> Installer>>#validate
>> Installer>>#logErrorDuring:
>> SketchEditorMorph>>#verifyState:
>> SketchEditorMorph>>#deliverPainting:evt:
>> SketchMorph>>#useInterpolation:
>> Slider>>#descending
>> JoystickMorph>>#autoCenterString
>> JoystickMorph>>#button1
>> JoystickMorph>>#button2
>> SARInstaller>>#errorNoSuchMember:
>> MessageSet>>#growable
>> HandMorph>>#handleEvent:
>> HandMorph>>#fullDrawOn:
>> ImageSegment>>#declareAndPossiblyRename:
>> PluggableListMorphPlus>>#wantsDroppedMorph:event:
>> SUnitTest>>#testRanOnlyOnce
>> BitmapFillStyle>>#isTiled
>> InstallerMonticello>>#mcDetectFileBlock
>> FTPClient>>#login
>> Object>>#mustBeBooleanIn:
>> Object>>#'~='
>> Decompiler>>#pushConstant:
>> TextMorphForEditView>>#acceptOnCR
>> HostSystemMenusMenuItem>>#shift
>> FlapTab>>#inboard
>> FlapTab>>#flapShowing
>> FlapTab>>#tabSelected
>> PluggableTreeMorph>>#wantsDroppedNode:on:
>> DisplayScreen>>#deferUpdates:
>> OBSystemBrowser>>#defaultBackgroundColor
>> SmalltalkImage>>#setPlatformPreferences
>> SmalltalkImage>>#snapshot:andQuit:embedded:
>> URLMorph>>#mouseUp:
>> MultiNewParagraph
>> >>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
>> Collection>>#reject:
>> TextDiffBuilder>>#hasMultipleMatches
>> TrueTest>>#testNot
>> TrueTest>>#testInMemory
>> TrueTest>>#testAND
>> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
>> Process>>#terminate
>> ProtoObjectTest>>#testIsNil
>> SqueakPage>>#write
>> ColorPickerMorph>>#putUpFor:near:
>> FalseTest>>#testAnd
>> FalseTest>>#testOR
>> FalseTest>>#testNot
>> FalseTest>>#testAND
>> UpdatingStringMorph>>#growable
>> UpdatingStringMorph>>#autoAcceptOnFocusLoss
>> LanguageEditor>>#selectedTranslationsAt:put:
>> Socket>>#setOption:value:
>> MultiCompositionScanner>>#setFont
>> PositionableStream>>#unCommand
>> HTTPSocket>>#logToTranscript
>> Number>>#odd
>> OBHierarchyBrowser>>#defaultBackgroundColor
>> MorphExtension>>#isDefault
>> MorphExtension>>#sortedPropertyNames
>> MorphExtension>>#printOn:
>> MorphExtension>>#hasProperty:
>> ObjectOut>>#doesNotUnderstand:
>> PluggableTextMorph>>#hasEditingConflicts
>> PluggableTextMorph>>#accept
>> SimpleSliderMorph>>#truncate
>> OBProtocolBrowser>>#defaultBackgroundColor
>> SystemWindow>>#mustNotClose
>> SystemWindow>>#mouseDown:
>> RBReadBeforeWrittenTester>>#read
>> RBReadBeforeWrittenTester>>#processBlock:
>> RBReadBeforeWrittenTester>>#processStatementNode:
>> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
>> GradientFillStyle>>#isRadialFill
>> RefactoryTyper>>#typeFor:
>> CompiledMethodTest>>#testValueWithReceiverArguments
>> OBLazyListMorph>>#handleMouseMove:
>> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
>> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
>> BlockContextTest>>#testSupplySameAnswerToAllQuestions
>> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
>> BlockContextTest>>#testSupplySpecificAnswerToQuestion
>> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
>> ImageMorph>>#isOpaque:
>> ProjectSwikiServer>>#acceptsUploads
>> PolygonMorph>>#rotateTestFlip:
>> PolygonMorph>>#beStraightSegments
>> PolygonMorph>>#beSmoothCurve
>> BitBlt>>#drawFrom:to:withFirstPoint:
>> FileList>>#getSelectedDirectory
>> FileList>>#getSelectedFile
>> RBParser>>#patchLiteralMessage
>> OBMultipleSelectionColumn>>#listSelectionAt:put:
>> ServerDirectory>>#upLoadProject:members:retry:
>> MorphObjectOut>>#doesNotUnderstand:
>> HaloMorph>>#addHandles
>> ThumbnailImageMorph>>#togglePopupFeature
>> ThumbnailImageMorph>>#handlesMouseDown:
>> ThumbnailImageMorph>>#popupFeatureString
>> ContextPart>>#jump:if:
>> MCWorkingCopy>>#merge:
>> FileDoesNotExistException>>#readOnly
>> RBLiteralNodeTest>>#testValue
>> Prefer...
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Stéphane Ducasse
In reply to this post by Igor Stasenko
yes
this is why we cannot do that automatically and this is also why we  
should tag the method with pragma

http://code.google.com/p/pharo/wiki/SmallLintPharoFixing

so that SmallLint will not report them again and again

Stef

> Sometimes i using ivars , which going to hold boolean value only , but
> i leave it to be initialized later
> so, a value of variable could be nil, true, false.
> Accessor, however alway returns a boolean, but depending of default
> value it could look like:
> ^ myvar == true
>
> or
> ^ myvar == false
>
>
>
> 2009/2/14 Gary Chambers <[hidden email]>:
>> SystemWindow>>#mouseDown: (actually needed, on first call that  
>> property will
>> almost certainly be nil, set later in the method).
>>
>> Regards, Gary
>>
>>
>> ----- Original Message -----
>> From: "Gary Chambers" <[hidden email]>
>> To: <[hidden email]>
>> Sent: Saturday, February 14, 2009 5:12 PM
>> Subject: Re: [Pharo-project] unnecessary =, == :)
>>
>>
>> PluggableTextMorph>>#accept (sadly required defence against text  
>> setters
>> that don't return a boolean)
>> SystemWindow>>#mouseDown: (removed offending line, now obsolete,  
>> apparently)
>>
>> Regards, Gary
>>
>> ----- Original Message -----
>> From: "Stéphane Ducasse" <[hidden email]>
>> To: "Pharo Development" <[hidden email]>
>> Sent: Saturday, February 14, 2009 3:23 PM
>> Subject: [Pharo-project] unnecessary =, == :)
>>
>>
>>> Check for a =, ==, ~=, or ~~ message being sent to true/false or  
>>> with
>>> true/false as the argument. Many times these can be eliminated since
>>> their receivers are already booleans. For example, "anObject isFoo  
>>> ==
>>> false" could be replaced with "anObject isFoo not" if isFoo always
>>> returns a boolean. Sometimes variables might refer to true, false,  
>>> and
>>> something else, but this is considered bad style since the variable
>>> has multiple types.
>>>
>>> Project>>#setChangeSet:
>>> Project>>#isolationSet
>>> Project>>#compileAll:from:
>>> Project>>#writeFileNamed:fromDirectory:toServer:
>>> Project>>#isolationHead
>>> PNGReadWriter>>#debugging
>>> ClockMorph>>#addCustomMenuItems:hand:
>>> ClockMorph>>#step
>>> ClockMorph>>#toggleShowingSeconds
>>> ClockMorph>>#toggleShowing24hr
>>> WorldState>>#interCyclePause:
>>> Integer>>#quo:
>>> Integer>>#digitSubtract:
>>> SimpleServiceEntry>>#useLineAfter
>>> MorphicUIManager>>#interactiveParserFor:
>>> OBPluggableListMorph>>#mouseUp:
>>> PianoRollScoreMorph>>#addCustomMenuItems:hand:
>>> SystemDictionary>>#abandonSources
>>> SystemDictionary>>#internalizeSources
>>> SystemDictionary>>#internalizeChangeLog
>>> SetTest>>#testRemoveIfAbsent
>>> SimpleButtonDelayedMenuMorph>>#mouseUp:
>>> Installer>>#validate
>>> Installer>>#logErrorDuring:
>>> SketchEditorMorph>>#verifyState:
>>> SketchEditorMorph>>#deliverPainting:evt:
>>> SketchMorph>>#useInterpolation:
>>> Slider>>#descending
>>> JoystickMorph>>#autoCenterString
>>> JoystickMorph>>#button1
>>> JoystickMorph>>#button2
>>> SARInstaller>>#errorNoSuchMember:
>>> MessageSet>>#growable
>>> HandMorph>>#handleEvent:
>>> HandMorph>>#fullDrawOn:
>>> ImageSegment>>#declareAndPossiblyRename:
>>> PluggableListMorphPlus>>#wantsDroppedMorph:event:
>>> SUnitTest>>#testRanOnlyOnce
>>> BitmapFillStyle>>#isTiled
>>> InstallerMonticello>>#mcDetectFileBlock
>>> FTPClient>>#login
>>> Object>>#mustBeBooleanIn:
>>> Object>>#'~='
>>> Decompiler>>#pushConstant:
>>> TextMorphForEditView>>#acceptOnCR
>>> HostSystemMenusMenuItem>>#shift
>>> FlapTab>>#inboard
>>> FlapTab>>#flapShowing
>>> FlapTab>>#tabSelected
>>> PluggableTreeMorph>>#wantsDroppedNode:on:
>>> DisplayScreen>>#deferUpdates:
>>> OBSystemBrowser>>#defaultBackgroundColor
>>> SmalltalkImage>>#setPlatformPreferences
>>> SmalltalkImage>>#snapshot:andQuit:embedded:
>>> URLMorph>>#mouseUp:
>>> MultiNewParagraph
>>> >>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
>>> Collection>>#reject:
>>> TextDiffBuilder>>#hasMultipleMatches
>>> TrueTest>>#testNot
>>> TrueTest>>#testInMemory
>>> TrueTest>>#testAND
>>> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
>>> Process>>#terminate
>>> ProtoObjectTest>>#testIsNil
>>> SqueakPage>>#write
>>> ColorPickerMorph>>#putUpFor:near:
>>> FalseTest>>#testAnd
>>> FalseTest>>#testOR
>>> FalseTest>>#testNot
>>> FalseTest>>#testAND
>>> UpdatingStringMorph>>#growable
>>> UpdatingStringMorph>>#autoAcceptOnFocusLoss
>>> LanguageEditor>>#selectedTranslationsAt:put:
>>> Socket>>#setOption:value:
>>> MultiCompositionScanner>>#setFont
>>> PositionableStream>>#unCommand
>>> HTTPSocket>>#logToTranscript
>>> Number>>#odd
>>> OBHierarchyBrowser>>#defaultBackgroundColor
>>> MorphExtension>>#isDefault
>>> MorphExtension>>#sortedPropertyNames
>>> MorphExtension>>#printOn:
>>> MorphExtension>>#hasProperty:
>>> ObjectOut>>#doesNotUnderstand:
>>> PluggableTextMorph>>#hasEditingConflicts
>>> PluggableTextMorph>>#accept
>>> SimpleSliderMorph>>#truncate
>>> OBProtocolBrowser>>#defaultBackgroundColor
>>> SystemWindow>>#mustNotClose
>>> SystemWindow>>#mouseDown:
>>> RBReadBeforeWrittenTester>>#read
>>> RBReadBeforeWrittenTester>>#processBlock:
>>> RBReadBeforeWrittenTester>>#processStatementNode:
>>> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
>>> GradientFillStyle>>#isRadialFill
>>> RefactoryTyper>>#typeFor:
>>> CompiledMethodTest>>#testValueWithReceiverArguments
>>> OBLazyListMorph>>#handleMouseMove:
>>> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
>>> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
>>> BlockContextTest>>#testSupplySameAnswerToAllQuestions
>>> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
>>> BlockContextTest>>#testSupplySpecificAnswerToQuestion
>>> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
>>> ImageMorph>>#isOpaque:
>>> ProjectSwikiServer>>#acceptsUploads
>>> PolygonMorph>>#rotateTestFlip:
>>> PolygonMorph>>#beStraightSegments
>>> PolygonMorph>>#beSmoothCurve
>>> BitBlt>>#drawFrom:to:withFirstPoint:
>>> FileList>>#getSelectedDirectory
>>> FileList>>#getSelectedFile
>>> RBParser>>#patchLiteralMessage
>>> OBMultipleSelectionColumn>>#listSelectionAt:put:
>>> ServerDirectory>>#upLoadProject:members:retry:
>>> MorphObjectOut>>#doesNotUnderstand:
>>> HaloMorph>>#addHandles
>>> ThumbnailImageMorph>>#togglePopupFeature
>>> ThumbnailImageMorph>>#handlesMouseDown:
>>> ThumbnailImageMorph>>#popupFeatureString
>>> ContextPart>>#jump:if:
>>> MCWorkingCopy>>#merge:
>>> FileDoesNotExistException>>#readOnly
>>> RBLiteralNodeTest>>#testValue
>>> Prefer...
>>>
>>> _______________________________________________
>>> Pharo-project mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Gary Chambers-4
In reply to this post by Stéphane Ducasse
Not yet... was unaware of that.

Regards, Gary

----- Original Message -----
From: "Stéphane Ducasse" <[hidden email]>
To: <[hidden email]>
Sent: Sunday, February 15, 2009 2:36 PM
Subject: Re: [Pharo-project] unnecessary =, == :)


gary do you use
<lint: 'Long methods' rationale: 'Rendering method' author: 'lr'>
to tag the method you checked?
http://code.google.com/p/pharo/wiki/SmallLintPharoFixing

Stef

On Feb 14, 2009, at 6:14 PM, Gary Chambers wrote:

> SystemWindow>>#mouseDown: (actually needed, on first call that
> property will
> almost certainly be nil, set later in the method).
>
> Regards, Gary
>
>
> ----- Original Message -----
> From: "Gary Chambers" <[hidden email]>
> To: <[hidden email]>
> Sent: Saturday, February 14, 2009 5:12 PM
> Subject: Re: [Pharo-project] unnecessary =, == :)
>
>
> PluggableTextMorph>>#accept (sadly required defence against text
> setters
> that don't return a boolean)
> SystemWindow>>#mouseDown: (removed offending line, now obsolete,
> apparently)
>
> Regards, Gary
>
> ----- Original Message -----
> From: "Stéphane Ducasse" <[hidden email]>
> To: "Pharo Development" <[hidden email]>
> Sent: Saturday, February 14, 2009 3:23 PM
> Subject: [Pharo-project] unnecessary =, == :)
>
>
>> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
>> true/false as the argument. Many times these can be eliminated since
>> their receivers are already booleans. For example, "anObject isFoo ==
>> false" could be replaced with "anObject isFoo not" if isFoo always
>> returns a boolean. Sometimes variables might refer to true, false,
>> and
>> something else, but this is considered bad style since the variable
>> has multiple types.
>>
>> Project>>#setChangeSet:
>> Project>>#isolationSet
>> Project>>#compileAll:from:
>> Project>>#writeFileNamed:fromDirectory:toServer:
>> Project>>#isolationHead
>> PNGReadWriter>>#debugging
>> ClockMorph>>#addCustomMenuItems:hand:
>> ClockMorph>>#step
>> ClockMorph>>#toggleShowingSeconds
>> ClockMorph>>#toggleShowing24hr
>> WorldState>>#interCyclePause:
>> Integer>>#quo:
>> Integer>>#digitSubtract:
>> SimpleServiceEntry>>#useLineAfter
>> MorphicUIManager>>#interactiveParserFor:
>> OBPluggableListMorph>>#mouseUp:
>> PianoRollScoreMorph>>#addCustomMenuItems:hand:
>> SystemDictionary>>#abandonSources
>> SystemDictionary>>#internalizeSources
>> SystemDictionary>>#internalizeChangeLog
>> SetTest>>#testRemoveIfAbsent
>> SimpleButtonDelayedMenuMorph>>#mouseUp:
>> Installer>>#validate
>> Installer>>#logErrorDuring:
>> SketchEditorMorph>>#verifyState:
>> SketchEditorMorph>>#deliverPainting:evt:
>> SketchMorph>>#useInterpolation:
>> Slider>>#descending
>> JoystickMorph>>#autoCenterString
>> JoystickMorph>>#button1
>> JoystickMorph>>#button2
>> SARInstaller>>#errorNoSuchMember:
>> MessageSet>>#growable
>> HandMorph>>#handleEvent:
>> HandMorph>>#fullDrawOn:
>> ImageSegment>>#declareAndPossiblyRename:
>> PluggableListMorphPlus>>#wantsDroppedMorph:event:
>> SUnitTest>>#testRanOnlyOnce
>> BitmapFillStyle>>#isTiled
>> InstallerMonticello>>#mcDetectFileBlock
>> FTPClient>>#login
>> Object>>#mustBeBooleanIn:
>> Object>>#'~='
>> Decompiler>>#pushConstant:
>> TextMorphForEditView>>#acceptOnCR
>> HostSystemMenusMenuItem>>#shift
>> FlapTab>>#inboard
>> FlapTab>>#flapShowing
>> FlapTab>>#tabSelected
>> PluggableTreeMorph>>#wantsDroppedNode:on:
>> DisplayScreen>>#deferUpdates:
>> OBSystemBrowser>>#defaultBackgroundColor
>> SmalltalkImage>>#setPlatformPreferences
>> SmalltalkImage>>#snapshot:andQuit:embedded:
>> URLMorph>>#mouseUp:
>> MultiNewParagraph
>> >>#multiComposeLinesFrom:to:delta:into:priorLines:atY:
>> Collection>>#reject:
>> TextDiffBuilder>>#hasMultipleMatches
>> TrueTest>>#testNot
>> TrueTest>>#testInMemory
>> TrueTest>>#testAND
>> MCFileBasedRepository>>#possiblyNewerVersionsOfAnyOf:
>> Process>>#terminate
>> ProtoObjectTest>>#testIsNil
>> SqueakPage>>#write
>> ColorPickerMorph>>#putUpFor:near:
>> FalseTest>>#testAnd
>> FalseTest>>#testOR
>> FalseTest>>#testNot
>> FalseTest>>#testAND
>> UpdatingStringMorph>>#growable
>> UpdatingStringMorph>>#autoAcceptOnFocusLoss
>> LanguageEditor>>#selectedTranslationsAt:put:
>> Socket>>#setOption:value:
>> MultiCompositionScanner>>#setFont
>> PositionableStream>>#unCommand
>> HTTPSocket>>#logToTranscript
>> Number>>#odd
>> OBHierarchyBrowser>>#defaultBackgroundColor
>> MorphExtension>>#isDefault
>> MorphExtension>>#sortedPropertyNames
>> MorphExtension>>#printOn:
>> MorphExtension>>#hasProperty:
>> ObjectOut>>#doesNotUnderstand:
>> PluggableTextMorph>>#hasEditingConflicts
>> PluggableTextMorph>>#accept
>> SimpleSliderMorph>>#truncate
>> OBProtocolBrowser>>#defaultBackgroundColor
>> SystemWindow>>#mustNotClose
>> SystemWindow>>#mouseDown:
>> RBReadBeforeWrittenTester>>#read
>> RBReadBeforeWrittenTester>>#processBlock:
>> RBReadBeforeWrittenTester>>#processStatementNode:
>> RBReadBeforeWrittenTester>>#processIfTrueIfFalse:
>> GradientFillStyle>>#isRadialFill
>> RefactoryTyper>>#typeFor:
>> CompiledMethodTest>>#testValueWithReceiverArguments
>> OBLazyListMorph>>#handleMouseMove:
>> BlockContextTest>>#testSupplyAnswerThroughNestedBlocks
>> BlockContextTest>>#testSupplyAnswerUsingTraditionalMatchOfQuestion
>> BlockContextTest>>#testSupplySameAnswerToAllQuestions
>> BlockContextTest>>#testSupplyAnswerUsingOnlySubstringOfQuestion
>> BlockContextTest>>#testSupplySpecificAnswerToQuestion
>> BlockContextTest>>#testSupplyAnswerUsingRegexMatchOfQuestion
>> ImageMorph>>#isOpaque:
>> ProjectSwikiServer>>#acceptsUploads
>> PolygonMorph>>#rotateTestFlip:
>> PolygonMorph>>#beStraightSegments
>> PolygonMorph>>#beSmoothCurve
>> BitBlt>>#drawFrom:to:withFirstPoint:
>> FileList>>#getSelectedDirectory
>> FileList>>#getSelectedFile
>> RBParser>>#patchLiteralMessage
>> OBMultipleSelectionColumn>>#listSelectionAt:put:
>> ServerDirectory>>#upLoadProject:members:retry:
>> MorphObjectOut>>#doesNotUnderstand:
>> HaloMorph>>#addHandles
>> ThumbnailImageMorph>>#togglePopupFeature
>> ThumbnailImageMorph>>#handlesMouseDown:
>> ThumbnailImageMorph>>#popupFeatureString
>> ContextPart>>#jump:if:
>> MCWorkingCopy>>#merge:
>> FileDoesNotExistException>>#readOnly
>> RBLiteralNodeTest>>#testValue
>> Prefer...
>>
>> _______________________________________________
>> Pharo-project mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
> _______________________________________________
> Pharo-project mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project 


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: unnecessary =, == :)

Damien Cassou
In reply to this post by Stéphane Ducasse
On Sat, Feb 14, 2009 at 4:23 PM, Stéphane Ducasse
<[hidden email]> wrote:
> Check for a =, ==, ~=, or ~~ message being sent to true/false or with
> true/false as the argument. Many times these can be eliminated since
> their receivers are already booleans. For example, "anObject isFoo ==
> false" could be replaced with "anObject isFoo not" if isFoo always
> returns a boolean. Sometimes variables might refer to true, false, and
> something else, but this is considered bad style since the variable
> has multiple types.

Issue #577

--
Damien Cassou
http://damiencassou.seasidehosting.st

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project