Quick change to True/False classes catches lots of errors ...

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

Quick change to True/False classes catches lots of errors ...

Dennis smith-4
We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

Reply | Threaded
Open this post in threaded view
|

Re: Quick change to True/False classes catches lots of errors ...

Boris Popov, DeepCove Labs (SNN)
Re: Quick change to True/False classes catches lots of errors ...

I believe there's a code critic rule that finds all these, no?

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Dennis Smith <[hidden email]>
To: VWNC,  <[hidden email]>
Sent: Tue Jun 19 07:43:42 2007
Subject: Quick change to True/False classes catches lots of errors ...

We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                                     +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada                           http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

Reply | Threaded
Open this post in threaded view
|

RE: Quick change to True/False classes catches lots of errors ...

Terry Raymond
In reply to this post by Dennis smith-4
Dennis

Did you compare the results to what the Code critic tests
find?

Running the same code critic test turns up only
Store.Pundle>>checkPrerequisite:name:version:

Terry
 
===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================

> -----Original Message-----
> From: Dennis Smith [mailto:[hidden email]]
> Sent: Tuesday, June 19, 2007 10:44 AM
> To: VWNC,
> Subject: Quick change to True/False classes catches lots of errors ...
>
> We make a few small changes to | and & methods in True and False,
> basically
> testing that the parameter is a boolean -- something like
>
> | aBoolean
>     aBoolean not.         "gives exception if its not boolean"
>     ^aBoolean
>
> This has caught many many errors in our own code and a number in VW
> (mostly in Store code), of the form
>
>     a == 1 | a == 2 ifTrue: [...]
>
> It is a minor (but very minor) performance hit -- but we only use it in
> development.
>
> --
> Dennis Smith                         +1 416.798.7948
> Cherniak Software Development Corporation   Fax: +1 416.798.0948
> 509-2001 Sheppard Avenue East        [hidden email]
> Toronto, ON M2J 4Z8              sip:[hidden email]
> Canada         http://www.CherniakSoftware.com
> Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

Reply | Threaded
Open this post in threaded view
|

Re: Quick change to True/False classes catches lots of errors ...

Dennis smith-4
In reply to this post by Boris Popov, DeepCove Labs (SNN)
Sure -- but you YOU going to run it on all the Store code to find its bugs???

Boris Popov wrote:
Re: Quick change to True/False classes catches lots of errors ...

I believe there's a code critic rule that finds all these, no?

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Dennis Smith [hidden email]
To: VWNC,  [hidden email]
Sent: Tue Jun 19 07:43:42 2007
Subject: Quick change to True/False classes catches lots of errors ...

We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                                     +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a class="moz-txt-link-freetext" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                           http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP


-- 
Dennis Smith                 		         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a class="moz-txt-link-freetext" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada			         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP
Reply | Threaded
Open this post in threaded view
|

RE: Quick change to True/False classes catches lots of errors ...

Terry Raymond
Re: Quick change to True/False classes catches lots of errors ...

Dennis

 

If you select just the boolean rule you can do a virgin image, with store,

in under a minute.

 

Terry

===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================


From: Dennis Smith [mailto:[hidden email]]
Sent: Tuesday, June 19, 2007 11:20 AM
To: vwnc >> "VWNC, "
Subject: Re: Quick change to True/False classes catches lots of errors ...

 

Sure -- but you YOU going to run it on all the Store code to find its bugs???

Boris Popov wrote:

I believe there's a code critic rule that finds all these, no?

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Dennis Smith [hidden email]
To: VWNC,  [hidden email]
Sent: Tue Jun 19 07:43:42 2007
Subject: Quick change to True/False classes catches lots of errors ...

We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                                     +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                           http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP



-- 
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a
href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP
Reply | Threaded
Open this post in threaded view
|

Re: Quick change to True/False classes catches lots of errors ...

Dennis smith-4
Great -- maybe cincom would like to run it before the next release??

Terry Raymond wrote:
Re: Quick change to True/False classes catches lots of errors ...

Dennis

 

If you select just the boolean rule you can do a virgin image, with store,

in under a minute.

 

Terry

===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================


From: Dennis Smith [[hidden email]]
Sent: Tuesday, June 19, 2007 11:20 AM
To: vwnc >> "VWNC, "
Subject: Re: Quick change to True/False classes catches lots of errors ...

 

Sure -- but you YOU going to run it on all the Store code to find its bugs???

Boris Popov wrote:

I believe there's a code critic rule that finds all these, no?

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Dennis Smith [hidden email]
To: VWNC,  [hidden email]
Sent: Tue Jun 19 07:43:42 2007
Subject: Quick change to True/False classes catches lots of errors ...

We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                                     +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a moz-do-not-send="true" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                           http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP



-- 
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a
 moz-do-not-send="true" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

-- 
Dennis Smith                 		         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a class="moz-txt-link-freetext" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada			         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP
Reply | Threaded
Open this post in threaded view
|

Re: Quick change to True/False classes catches lots of errors ...

Dennis smith-4
In reply to this post by Terry Raymond
I haven't looked yet -- but is it simple to access the code-critic directly and have it
look at a method?  That way I could have it look for a couple of things on text "accept" :)

Terry Raymond wrote:
Re: Quick change to True/False classes catches lots of errors ...

Dennis

 

If you select just the boolean rule you can do a virgin image, with store,

in under a minute.

 

Terry

===========================================================
Terry Raymond
Crafted Smalltalk
80 Lazywood Ln.
Tiverton, RI  02878
(401) 624-4517      [hidden email]
<http://www.craftedsmalltalk.com>
===========================================================


From: Dennis Smith [[hidden email]]
Sent: Tuesday, June 19, 2007 11:20 AM
To: vwnc >> "VWNC, "
Subject: Re: Quick change to True/False classes catches lots of errors ...

 

Sure -- but you YOU going to run it on all the Store code to find its bugs???

Boris Popov wrote:

I believe there's a code critic rule that finds all these, no?

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: Dennis Smith [hidden email]
To: VWNC,  [hidden email]
Sent: Tue Jun 19 07:43:42 2007
Subject: Quick change to True/False classes catches lots of errors ...

We make a few small changes to | and & methods in True and False, basically
testing that the parameter is a boolean -- something like

| aBoolean
    aBoolean not.         "gives exception if its not boolean"
    ^aBoolean

This has caught many many errors in our own code and a number in VW
(mostly in Store code), of the form

    a == 1 | a == 2 ifTrue: [...]

It is a minor (but very minor) performance hit -- but we only use it in
development.

--
Dennis Smith                                     +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a moz-do-not-send="true" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                           http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP



-- 
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a
 moz-do-not-send="true" href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada                         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

-- 
Dennis Smith                 		         +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              <a class="moz-txt-link-freetext"
 href="sip:dennis@CherniakSoftware.com">sip:dennis@...
Canada			         http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP