How often should a uninitializedvariable warning be shown?

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

How often should a uninitializedvariable warning be shown?

Stephan Eggermont-3
Does it make sense to warn more than once for each variable?

Stephan

distibutionMapOn: a
                a roassal2
                        title: 'Distribution map';
                        painting: [:view2 |
                "Simple example of a distribution map.
                Green methods are short. Orange are long. Red are very long"
                        | view classes d packages  |
                        self halt.
                        packages := self forumPackages.
                        classes := OrderedCollection new.
                        packages do: [ :p | classes addAll: p classes ].
                        d := IdentityDictionary new.
                        classes do: [:aClass | aClass methods do: [:m | d at: m put: m getSource lineCount ] ].

                        view shape rectangle withoutBorder.
                        view nodes: classes forEach: [ :each |
                                view shape label.
                                view node: each.
                                view node: each forIt: [
                                        view interaction  action: #browse.
                                        view shape rectangle size: 8;
                                                if: [:m | (d at: m) < 5 ] fillColor: Color green;
                                                if: [:m | (d at: m) >= 5 and: [ (d at: m) < 25 ] ] fillColor: Color orange;
                                                if: [:m | (d at: m) >= 25 ] fillColor: Color red.
                                        view nodes: (each methods sortedAs: [:m | (d at: m) ]).
                                        view gridLayout gapSize: 1 ].
                                        view verticalLineLayout ].
       
                        view gridLayout]
Reply | Threaded
Open this post in threaded view
|

Re: How often should a uninitializedvariable warning be shown?

kilon.alios
maybe pop up a dialog with the choice for the user to suppress any other warnings of same kind. 

On Mon, Sep 15, 2014 at 4:28 PM, Stephan Eggermont <[hidden email]> wrote:
Does it make sense to warn more than once for each variable?

Stephan

distibutionMapOn: a
                a roassal2
                        title: 'Distribution map';
                        painting: [:view2 |
                "Simple example of a distribution map.
                Green methods are short. Orange are long. Red are very long"
                        | view classes d packages  |
                        self halt.
                        packages := self forumPackages.
                        classes := OrderedCollection new.
                        packages do: [ :p | classes addAll: p classes ].
                        d := IdentityDictionary new.
                        classes do: [:aClass | aClass methods do: [:m | d at: m put: m getSource lineCount ] ].

                        view shape rectangle withoutBorder.
                        view nodes: classes forEach: [ :each |
                                view shape label.
                                view node: each.
                                view node: each forIt: [
                                        view interaction  action: #browse.
                                        view shape rectangle size: 8;
                                                if: [:m | (d at: m) < 5 ] fillColor: Color green;
                                                if: [:m | (d at: m) >= 5 and: [ (d at: m) < 25 ] ] fillColor: Color orange;
                                                if: [:m | (d at: m) >= 25 ] fillColor: Color red.
                                        view nodes: (each methods sortedAs: [:m | (d at: m) ]).
                                        view gridLayout gapSize: 1 ].
                                        view verticalLineLayout ].

                        view gridLayout]

Reply | Threaded
Open this post in threaded view
|

Re: How often should a uninitializedvariable warning be shown?

Esteban A. Maringolo
Not strictly related, but I'd love to have notifications about syntax
errors without modifying the code.
It gets really nasty when there is a missing square bracket or parenthesis.

:)


Esteban A. Maringolo


2014-09-15 11:47 GMT-03:00 kilon alios <[hidden email]>:

> maybe pop up a dialog with the choice for the user to suppress any other
> warnings of same kind.
>
> On Mon, Sep 15, 2014 at 4:28 PM, Stephan Eggermont <[hidden email]> wrote:
>>
>> Does it make sense to warn more than once for each variable?
>>
>> Stephan
>>
>> distibutionMapOn: a
>>                 a roassal2
>>                         title: 'Distribution map';
>>                         painting: [:view2 |
>>                 "Simple example of a distribution map.
>>                 Green methods are short. Orange are long. Red are very
>> long"
>>                         | view classes d packages  |
>>                         self halt.
>>                         packages := self forumPackages.
>>                         classes := OrderedCollection new.
>>                         packages do: [ :p | classes addAll: p classes ].
>>                         d := IdentityDictionary new.
>>                         classes do: [:aClass | aClass methods do: [:m | d
>> at: m put: m getSource lineCount ] ].
>>
>>                         view shape rectangle withoutBorder.
>>                         view nodes: classes forEach: [ :each |
>>                                 view shape label.
>>                                 view node: each.
>>                                 view node: each forIt: [
>>                                         view interaction  action: #browse.
>>                                         view shape rectangle size: 8;
>>                                                 if: [:m | (d at: m) < 5 ]
>> fillColor: Color green;
>>                                                 if: [:m | (d at: m) >= 5
>> and: [ (d at: m) < 25 ] ] fillColor: Color orange;
>>                                                 if: [:m | (d at: m) >= 25
>> ] fillColor: Color red.
>>                                         view nodes: (each methods
>> sortedAs: [:m | (d at: m) ]).
>>                                         view gridLayout gapSize: 1 ].
>>                                         view verticalLineLayout ].
>>
>>                         view gridLayout]
>
>

Reply | Threaded
Open this post in threaded view
|

Re: How often should a uninitializedvariable warning be shown?

stepharo

On 15/9/14 17:17, Esteban A. Maringolo wrote:
> Not strictly related, but I'd love to have notifications about syntax
> errors without modifying the code.
> It gets really nasty when there is a missing square bracket or parenthesis.

me too we will get there.

>
> :)
>
>
> Esteban A. Maringolo
>
>
> 2014-09-15 11:47 GMT-03:00 kilon alios <[hidden email]>:
>> maybe pop up a dialog with the choice for the user to suppress any other
>> warnings of same kind.
>>
>> On Mon, Sep 15, 2014 at 4:28 PM, Stephan Eggermont <[hidden email]> wrote:
>>> Does it make sense to warn more than once for each variable?
>>>
>>> Stephan
>>>
>>> distibutionMapOn: a
>>>                  a roassal2
>>>                          title: 'Distribution map';
>>>                          painting: [:view2 |
>>>                  "Simple example of a distribution map.
>>>                  Green methods are short. Orange are long. Red are very
>>> long"
>>>                          | view classes d packages  |
>>>                          self halt.
>>>                          packages := self forumPackages.
>>>                          classes := OrderedCollection new.
>>>                          packages do: [ :p | classes addAll: p classes ].
>>>                          d := IdentityDictionary new.
>>>                          classes do: [:aClass | aClass methods do: [:m | d
>>> at: m put: m getSource lineCount ] ].
>>>
>>>                          view shape rectangle withoutBorder.
>>>                          view nodes: classes forEach: [ :each |
>>>                                  view shape label.
>>>                                  view node: each.
>>>                                  view node: each forIt: [
>>>                                          view interaction  action: #browse.
>>>                                          view shape rectangle size: 8;
>>>                                                  if: [:m | (d at: m) < 5 ]
>>> fillColor: Color green;
>>>                                                  if: [:m | (d at: m) >= 5
>>> and: [ (d at: m) < 25 ] ] fillColor: Color orange;
>>>                                                  if: [:m | (d at: m) >= 25
>>> ] fillColor: Color red.
>>>                                          view nodes: (each methods
>>> sortedAs: [:m | (d at: m) ]).
>>>                                          view gridLayout gapSize: 1 ].
>>>                                          view verticalLineLayout ].
>>>
>>>                          view gridLayout]
>>
>


Reply | Threaded
Open this post in threaded view
|

Re: How often should a uninitializedvariable warning be shown?

Tudor Girba-2

On Mon, Sep 15, 2014 at 9:48 PM, stepharo <[hidden email]> wrote:

On 15/9/14 17:17, Esteban A. Maringolo wrote:
Not strictly related, but I'd love to have notifications about syntax
errors without modifying the code.
It gets really nasty when there is a missing square bracket or parenthesis.

me too we will get there.



:)


Esteban A. Maringolo


2014-09-15 11:47 GMT-03:00 kilon alios <[hidden email]>:
maybe pop up a dialog with the choice for the user to suppress any other
warnings of same kind.

On Mon, Sep 15, 2014 at 4:28 PM, Stephan Eggermont <[hidden email]> wrote:
Does it make sense to warn more than once for each variable?

Stephan

distibutionMapOn: a
                 a roassal2
                         title: 'Distribution map';
                         painting: [:view2 |
                 "Simple example of a distribution map.
                 Green methods are short. Orange are long. Red are very
long"
                         | view classes d packages  |
                         self halt.
                         packages := self forumPackages.
                         classes := OrderedCollection new.
                         packages do: [ :p | classes addAll: p classes ].
                         d := IdentityDictionary new.
                         classes do: [:aClass | aClass methods do: [:m | d
at: m put: m getSource lineCount ] ].

                         view shape rectangle withoutBorder.
                         view nodes: classes forEach: [ :each |
                                 view shape label.
                                 view node: each.
                                 view node: each forIt: [
                                         view interaction  action: #browse.
                                         view shape rectangle size: 8;
                                                 if: [:m | (d at: m) < 5 ]
fillColor: Color green;
                                                 if: [:m | (d at: m) >= 5
and: [ (d at: m) < 25 ] ] fillColor: Color orange;
                                                 if: [:m | (d at: m) >= 25
] fillColor: Color red.
                                         view nodes: (each methods
sortedAs: [:m | (d at: m) ]).
                                         view gridLayout gapSize: 1 ].
                                         view verticalLineLayout ].

                         view gridLayout]







--

"Every thing has its own flow"
Reply | Threaded
Open this post in threaded view
|

Re: How often should a uninitializedvariable warning be shown?

Esteban A. Maringolo
2014-09-15 17:29 GMT-03:00 Tudor Girba <[hidden email]>:
> You mean like this:
> http://www.humane-assessment.com/blog/rethinking-compilation-notifications-in-pharo/
> ?

I was thinking in how Dolphin does it: http://i.imgur.com/jiyY3IO.png
However the Moose solution would avoid the current issues as you
clearly describe them in the blog post. :)


Esteban A. Maringolo