Editing class method sources in single place

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

Re: Editing class method sources in single place

Jason Johnson-5
On Jan 31, 2008 12:27 PM, Blake <[hidden email]> wrote:
>
> Squeak isn't source file based, and I doubt any form of presentation could
> make it so. (Though, I guess maybe if you had the Smalltalk OS, it would
> probably host something like a source-file based scripting system. Or
> something.<s>)

I was just pointing out the kind of requests that happen from people
coming from other languages and not "integrating".  I remember
recently seeing someone request that Smalltalk drop the "image idea"
and switch to source files so it would be more "friendly to newbies".

> But the "root of the problem" is visual as well as tactile. It's all very
> well to have all the source code available all the time, but much of the
> time, I don't want to have to care. And the remainder of the time, I don't
> want to see all of it, all the time. I want to see what =I= am working on.
> More importantly, when I'm teaching, I want students to see =THEIR= code
> most of the time: I'd like to be able set it up so that the debugger
> wouldn't go in to the base classes unless asked, because that stuff can be
> very confusing to a beginner.
>
> One of the most important lessons in programming is that, when you're
> programming and there's a bug, it's in your own code. Not in the library,
> not in the compiler, not in the operating system. (If that's not the case,
> you need a new library/compiler/OS.) I love the encouragement to explore
> in Smalltalk--I just want to be able to turn it off sometimes.

Agreed.

> I recall a study (by IBM, I think) where the amount of code one could see
> at once was postiively related to productivity.

I don't understand this.  Are you saying that having more source code
on the screen increased productivity?  That may be but if so a simple
"show me all the methods in the class" isn't going to work.

For example (sorry to keep going back to this), I'm working on a C#
project now that is relatively old and has a lot of lines of code in
it.  Of course the way that IDE works is the standard "show everything
in a flat file" way.  So one big problem for me is all this
distracting code in my view (i.e. code that is not part of the
functionality I'm working on in that moment).  The problem is simply
that this view is static.  The files are written as:

1. private/protected variables
2. constructors
3. private/protected methods
4. event related
5. properties

So that view is good for figuring out where functionality is in a new
class.  But when I want to work on the functionality of one specific
button the view is all wrong.  I want to see the above mentioned items
that are related to this specific button and nothing else.  What I do
right now is click the minus on the unrelated methods to shorten them
down to one line, but it's still clutter I have to wade through.

> (And yet, I'm the only
> coder I know with a propensity for conserving vertical space.) I do know
> that if I'm in method A and it calls method B, and method B is right
> there?

I wonder about doing a tooltip style pop up on mouse over of the B
method call. :)

>I'm golden. As a corrolary to "the problem is in your code",
> there's also, "the problem is mostly in the code you just changed". I
> could see a browser where the methods highlighted their latest changes,
> like a mini-diff--something also good for pedagogical purposes.

Interesting ideas.

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

timrowledge
In reply to this post by FDominicus

On 31-Jan-08, at 9:38 AM, Friedrich Dominicus wrote:

>  In any other langauge I can write
>
>
> function a
>
> ...
>
>
> function b
>
> ....
>
> But I can not in Squeak I have to accept generate a new template an
> possible put the stuff in categories from which I never know which
> methods belong to which category (a bit too pointed) etc.
This turns out to be incorrect. Have another browser open. Leave the  
one with partially written code and go to this other browser.  
Investigate other methods or even start writing your 'function b'.  
Open yet another browser and do it all again.
If categories bother you just leave everything in a single category.  
You'll soon learn how helpful they can be once you have a couple of  
dozen methods in your class.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
A flash of light, a cloud of dust, and...  What was the question?



Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Jason Johnson-5
In reply to this post by FDominicus
On Jan 31, 2008 6:38 PM, Friedrich Dominicus
<[hidden email]> wrote:
> "Jason Johnson" <[hidden email]> writes:
>
> Well searching through it to find some stuff is not that fast, I have
> not idea on how to limit it to just the class I'm working in e.g.

What I mean was, "compared to IDE's of other languages".  That is, I
can open 10 browsers on one project I'm working on and it's no
problem.  10 Eclipse, IntelliJ, Visual Studio or what ever is
unthinkable.

> And how do you do that, you use the mouse and go forth and back and
> how to you find your browsers?

I do.  No point in moving faster then I can think.  But seriously,
there are hot keys to switch between browsers and I naturally place
them some order that makes sense to me.

> In any other langauge I can write
>
> function a
>
> ...
>
>
> function b
>
> ....
>
> But I can not in Squeak I have to accept generate a new template an
> possible put the stuff in categories from which I never know which
> methods belong to which category (a bit too pointed) etc.

You should get the book "Smalltalk best practice patterns".  It
explains which categories methods should go in.  Now I just have to go
back and recategorize everything I did wrong before I got that book.
:)

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

FDominicus
In reply to this post by timrowledge
tim Rowledge <[hidden email]> writes:

> This turns out to be incorrect. Have another browser open. Leave the
> one with partially written code and go to this other browser.
That's exactly not what I want. I do not want to have a tons of
browser open just to realize that I do not know which one to choose next.
> Investigate other methods or even start writing your 'function b'.
> Open yet another browser and do it all again.
> If categories bother you just leave everything in a single category.
> You'll soon learn how helpful they can be once you have a couple of
> dozen methods in your class.
Well if it's clear in which category to put the stuff then I agree,
but that's not that clear ot me always and then I'm searching for a
method from which I "expect" it to be foo but unfotunatly it's in
bar....

I don't want to change your way of doing things. But I'm not willing
to just adopt to this way. I conceil I'm corrupted by (X)Emacs (it's
among other a decent editor) Smalltalks Editors could gain much by
just beeing a bit more Emacsish ....

Regards
Friedrich

--
Q-Software Solutions GmbH; Sitz: Bruchsal; Registergericht: Mannheim
Registriernummer: HRB232138; Geschaeftsfuehrer: Friedrich Dominicus

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Sophie424
In reply to this post by Colin Putney
"Colin Putney" <[hidden email]> wrote

>> Absolutely, thank you. Even better would be to have all the torn-off
>> bits
>> available in one "working context" (such as a window) that you can
>> minimize,
>> maximize, close, etc. as one unit. Traditional file-based split editor
>> windows are not the only alternative to N open browsers.
>
> It sounds to me like you're talking about being able to drag and drop
> from one browser to another. Is that right?

Not quite, just an actual grouped "working context" I can manipulate (e.g. a
window) that treats as a group all the snippets/slices I want present for my
current task.

Perhaps drag and drop across browsers might be one way to do this, if the
"group" is realized by multiple top-level browser windows (non-ideal imho).
Better if smaller browser windows (such as the "tear-offs" or split
panels/columns/rows) are contained within a "working context" window.

- Sophie




Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by Jason Johnson-5
On Thu, 31 Jan 2008 09:49:25 -0800, Jason Johnson  
<[hidden email]> wrote:

> What I mean was, "compared to IDE's of other languages".  That is, I
> can open 10 browsers on one project I'm working on and it's no
> problem.  10 Eclipse, IntelliJ, Visual Studio or what ever is
> unthinkable.

The comparison is not entirely apt. Each Eclipse, IntelliJ, Visual Studio  
is a complete environment. It would be like opening an entirely new  
Image+VM, which you don't do in Smalltalk either. It's actually more  
do-able (and I've done it occasionally) in these other tools because of  
the source-file-based set-up.

The equivalent of the browser in these environments is the editing window  
(with associated browsing tools). And, of course, one has many of those  
open at once--though not as many as browsers in Smalltalk since one window  
is good for an entire class, at least. ;-)

        ===Blake===

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Brian Brown-2
In reply to this post by Bert Freudenberg

On Jan 31, 2008, at 4:59 AM, Bert Freudenberg wrote:

> I'm not entirely sure how my name got dragged into this conversation  
> - but I do agree with the rest of your post. Setting up a context  
> that lets you focus on what you're currently working on is helpful.  
> There should be a browser that just shows your "working set", like a  
> couple of packages that make up your application. I used such a  
> browser framework 10 years ago (Application Management Browser IIRC)  
> and it worked nicely, basically each tool had a little checkbox  
> switching the filter to your current app on and off. Very handy.


A lot of this conversation smacks of Ned Konz's Starbrowser - it's on  
squeakmap, but I don't think it will run on newer stuff than 3.7  
without some love.

Anyway, it allowed you to create arbitrary contexts for methods,  
classes etc. Very useful... I should try to get it working again. I  
haven't seen Ned around here for eons, so I wonder if he still does  
squeaking...


Here are a couple of screenshots, one showing a bare method that has  
been dragged onto the tree at left and another showing a class on the  
left with category and method browser on on the right.

http://www.techgame.net/~brian/sb1.png
http://www.techgame.net/~brian/sb2.png


These are from a 3.7b-5868 image in early 2004.

Brian



Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by Jason Johnson-5
On Thu, 31 Jan 2008 09:43:24 -0800, Jason Johnson  
<[hidden email]> wrote:

> I was just pointing out the kind of requests that happen from people
> coming from other languages and not "integrating".  I remember
> recently seeing someone request that Smalltalk drop the "image idea"
> and switch to source files so it would be more "friendly to newbies".

Well, yes, that's called "Ruby". ;-)

>> I recall a study (by IBM, I think) where the amount of code one could  
>> see at once was postiively related to productivity.
>
> I don't understand this.  Are you saying that having more source code
> on the screen increased productivity?

Yes. The tracks faster than the fingers, basically. I've been known to use  
miniscule fonts at 1600x1200 for precisely that reason. (There are limits,  
unfortunately.)

> That may be but if so a simple
> "show me all the methods in the class" isn't going to work.

That was never my suggestion. In fact, the set of code items in question  
is going to be split among classes, and isn't necessarily going to embrace  
entire classes. I suspect variants in here--some folks are going to favor  
a LIFO type stack, while others might prefer an alphabetic arrangement.

> So that view is good for figuring out where functionality is in a new
> class.  But when I want to work on the functionality of one specific
> button the view is all wrong.  I want to see the above mentioned items
> that are related to this specific button and nothing else.  What I do
> right now is click the minus on the unrelated methods to shorten them
> down to one line, but it's still clutter I have to wade through.

That's where Smalltalk, being a non-source-file-based system can shine.  
Since order is not significant (and it IS in C# and other projects), you  
can arbitrarily designate what is shown and in what order, without the  
clunkiness of hiding chunks of code (which is how the modern IDEs handle  
clutter).

>> (And yet, I'm the only
>> coder I know with a propensity for conserving vertical space.) I do know
>> that if I'm in method A and it calls method B, and method B is right
>> there?
>
> I wonder about doing a tooltip style pop up on mouse over of the B
> method call. :)

Would require going to the mouse and waiting for the tooltip to pop-up.  
We're talking fractions of a second here. Another study I recall reading  
was the effect of lag on programmer producivity. A half-second was all it  
took to break concentration. At 2 seconds, the programmer has left the  
building.<s>

>> I'm golden. As a corrolary to "the problem is in your code",
>> there's also, "the problem is mostly in the code you just changed". I
>> could see a browser where the methods highlighted their latest changes,
>> like a mini-diff--something also good for pedagogical purposes.
>
> Interesting ideas.

Now...off to implementation.... Heh.

        ===Blake===


Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by Brian Brown-2
On Thu, 31 Jan 2008 13:41:49 -0800, Brian Brown <[hidden email]> wrote:

> A lot of this conversation smacks of Ned Konz's Starbrowser - it's on  
> squeakmap, but I don't think it will run on newer stuff than 3.7 without  
> some love.

The layout's pretty nice. Do those arrows mean you can traverse code like  
a stack?

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by Blake-5
On Thu, 31 Jan 2008 13:51:08 -0800, Blake <[hidden email]> wrote:

> Yes. The tracks faster than the fingers, basically. I've been known to  
> use miniscule fonts at 1600x1200 for precisely that reason. (There are  
> limits, unfortunately.)

Sorry, that's: "The eye tracks faster than the fingers".

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

timrowledge
In reply to this post by FDominicus

On 31-Jan-08, at 10:00 AM, Friedrich Dominicus wrote:
> Smalltalks Editors could gain much by
> just beeing a bit more Emacsish ....
NNnnnnooooooooooooooooooooooooooooooooo
<runs away, very fast>

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
"Bother" said Pooh, as his rucksack opened whilst skydiving



Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Sophie424
In reply to this post by Jon Hylands
"Jon Hylands" <[hidden email]> wrote in message
> we added a drop-down combo box above the class
> categories, which allowed you to choose the "current" change set
> for that browser.

Could that be generalized to a set of Pluggable Selection Criteria?

- Sophie




Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by timrowledge
On Thu, 31 Jan 2008 14:25:47 -0800, tim Rowledge <[hidden email]> wrote:

>
> On 31-Jan-08, at 10:00 AM, Friedrich Dominicus wrote:
>> Smalltalks Editors could gain much by
>> just beeing a bit more Emacsish ....
> NNnnnnooooooooooooooooooooooooooooooooo
> <runs away, very fast>
>

Oh, a vi fan, eh?

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

timrowledge

On 31-Jan-08, at 4:14 PM, Blake wrote:

> On Thu, 31 Jan 2008 14:25:47 -0800, tim Rowledge <[hidden email]>  
> wrote:
>
>>
>> On 31-Jan-08, at 10:00 AM, Friedrich Dominicus wrote:
>>> Smalltalks Editors could gain much by
>>> just beeing a bit more Emacsish ....
>> NNnnnnooooooooooooooooooooooooooooooooo
>> <runs away, very fast>
>>
>
> Oh, a vi fan, eh?
Aaaaaarrrrrgggghhhh!

No. No way. No how. I like my ParagraphEditor thank you very much. If  
I *have* to use a not-Smalltalk text editor then I prefer StrongEd  
(google it) and I can tolerate TextWrangler - just barely.

tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Liability: a valuable political skill



Reply | Threaded
Open this post in threaded view
|

RE: Editing class method sources in single place

Sebastian Sastre-2
In reply to this post by timrowledge
> On 31-Jan-08, at 10:00 AM, Friedrich Dominicus wrote:
> > Smalltalks Editors could gain much by
> > just beeing a bit more Emacsish ....
> NNnnnnooooooooooooooooooooooooooooooooo
> <runs away, very fast>
>
> tim
> --

+1 here.

Why anyone would wish to go backwards todays when user experience is
starting to gett the place it allways deserved?

The tool formats the worker who uses it with time. So it influences the
product the worker makes. I don't wish Emacs experiences nor even near them.
Not for me, not for my end users, nor other programers. Think in better
things: heuristic and intuitive tools from UI to function. Can't try harder
but forget investing in cryptic unhuman UI's for the good of all our brains.

Cheers,

Sebastian


Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by timrowledge
On Thu, 31 Jan 2008 16:19:51 -0800, tim Rowledge <[hidden email]> wrote:

>>> NNnnnnooooooooooooooooooooooooooooooooo
>>> <runs away, very fast>
>>>
>>
>> Oh, a vi fan, eh?
> Aaaaaarrrrrgggghhhh!
>
> No. No way. No how.

Hee hee. We used to use SPF....


Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

timrowledge

On 31-Jan-08, at 5:21 PM, Blake wrote:

> On Thu, 31 Jan 2008 16:19:51 -0800, tim Rowledge <[hidden email]>  
> wrote:
>
>>>> NNnnnnooooooooooooooooooooooooooooooooo
>>>> <runs away, very fast>
>>>>
>>>
>>> Oh, a vi fan, eh?
>> Aaaaaarrrrrgggghhhh!
>>
>> No. No way. No how.
>
> Hee hee. We used to use SPF....
.. and I wrote a thesis for part of my first degree using TECO on a  
Tek thermal printer terminal. But I wouldn't recommend it to anyone  
wanting to actually enjoy the creative process.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Long computations that yield zero are probably all for naught.



Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Blake-5
In reply to this post by Sebastian Sastre-2
On Thu, 31 Jan 2008 17:18:10 -0800, Sebastian Sastre  
<[hidden email]> wrote:

>> On 31-Jan-08, at 10:00 AM, Friedrich Dominicus wrote:
>> > Smalltalks Editors could gain much by
>> > just beeing a bit more Emacsish ....
>> NNnnnnooooooooooooooooooooooooooooooooo
>> <runs away, very fast>
>>
>> tim
>> --
>
> +1 here.
>
> Why anyone would wish to go backwards todays when user experience is
> starting to gett the place it allways deserved?

Fredrich may not have been joking but I most certainly was.

Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Sophie424
In reply to this post by Brian Brown-2
"Brian Brown" <[hidden email]> wrote

> A lot of this conversation smacks of Ned Konz's Starbrowser - it's on
> squeakmap, but I don't think it will run on newer stuff than 3.7  without
> some love.

Yes!!

Some more screenshots of its VW predecessor at
http://homepages.ulb.ac.be/~rowuyts/StarBrowser/screenshots.html
and its design at
http://homepages.ulb.ac.be/~rowuyts/StarBrowser/index.html

It seems to establish working contexts nicely, with a lot of extensibility
on what services to use on a selected element (including groups or
classifications) in that context.

It does not include any example of viewing a group of methods
simultaneously, but the UML diagram certainly simultaneously shows all
classes in the Soul* classification, so it would probably fit into the
framework.

- Sophie




Reply | Threaded
Open this post in threaded view
|

Re: Editing class method sources in single place

Jason Johnson-5
In reply to this post by Blake-5
On Jan 31, 2008 10:51 PM, Blake <[hidden email]> wrote:
>
> That was never my suggestion. In fact, the set of code items in question
> is going to be split among classes, and isn't necessarily going to embrace
> entire classes. I suspect variants in here--some folks are going to favor
> a LIFO type stack, while others might prefer an alphabetic arrangement.

In that case, it sounds like we're on the same page.  I'm all for
improvement.  I just hate oversimplified solutions that may actually
make things worse (which doesn't sound like what you're suggesting).

> That's where Smalltalk, being a non-source-file-based system can shine.

Agreed.
> Would require going to the mouse and waiting for the tooltip to pop-up.
> We're talking fractions of a second here. Another study I recall reading
> was the effect of lag on programmer producivity. A half-second was all it
> took to break concentration. At 2 seconds, the programmer has left the
> building.<s>

Fair point.  What about having a sort of "context view" off to the
side that shows all the methods referenced in by the current method?
You could even have a setting to say how far out to fan (i.e. 2 levels
shows all methods used in the current method, and all their methods).
Of course we would first need a way to filter what would show up in
such a context window, so we don't get flooded by non-project code.

> Now...off to implementation.... Heh.

Are you really implementing?  I suppose you could use some of that
nice free labor (students) to get something developed. :)

1234