Blog

Humane assessment mentioned on productdevelopmentsuccess.com

Humane assessment was just featured in a short article entitled "Tooling the software engineering decision making process" on productdevelopmentsuccess.com.

Posted by Tudor Girba at 24 March 2015, 11:05 am link
|

Spotting objects from GTInspector

GTInspector enables fine-grained interaction with objects, but it is less tuned to quick searching within the context of the object. At the same time, GTSpotter allows you to quickly search for objects.

It is only natural to link the two. We already have a way to get from GTSpotter to GTInspector as the default action in GTSpotter is to inspect. For example, suppose you inspect a directory.

Playground-folder.png

While, the inspector already allows you to navigate through folders, it is often more convenient to dive through the file system with GTSpotter. To achieve this, you would need to jump from inspector to spotter.

In our example, as the FileReference class already offers spotter extensions, the inspector offers a magnifier glass icon on the top right. Clicking that icon triggers an instance of GTSpotter that is scoped to our FileReference object.

Spotter-folder.png

From here, GTSpotter works as expected with full diving and previewing possibilities.

Spotter-dive.png

As the default action is inspection, pressing Enter on a file or directory opens an inspector on that object.

Inspector-file.png

The integration is far from perfect. For example, at the end of the interaction you end up with two windows (one for the initial Playground, and one for the Inspector) without any casual connection between the two. Nevertheless, this is a cheap extension that allows you to leverage the power of GTSpotter for any object.

Posted by Tudor Girba at 16 March 2015, 9:05 am with tags tooling, moose, pharo, analysis link
|

Searching the file system with GTSpotter

When we introduced GTSpotter, searching for files was one of the featured use cases. In this post, we take a closer look at how GTSpotter makes reaching out to various parts of the file system seamlessly integrated in Pharo.

Diving into folders

The first prerequisite for dealing with the file system is that of navigating through it. The diving mechanism of GTSpotter lends itself nicely for this purpose.

For example, searching in the current folder allows you to find a folder of interest. The preview to the right shows the contents.

Relativepath.png

Diving into it (using Cmd+Shift+Right), reveals the contents in the main window and enables further navigation.

Folder-dive.png

Previewing files

The GTSpotter preview obviously allows you to take a peek not only in the contents of a folder, but also into the contents of files. For example, a text file will be shown as text.

Preview-text.png

Or a Pharo script file will be shown with proper syntax highlighting.

Preview-st.png

Relative and absolute paths

While the diving mechanism allows you to scope our search for a folder, it is also possible to enter a full path directly in the top search. Previously, we saw how starting the search with ./ triggers a search in the working directory. Adding another separator, like seen below, allows you to search through nested folders without diving.

Relativepath-withdive.png

And this works with arbitrary amount of nesting.

Deep-path.png

Of course, searching can also be triggered by the full path. This is particularly convenient when pasting a full path copied from somewhere else.

Fullpath.png

While the examples shown here work with Unix-like paths, when on Windows, GTSpotter will deal equally well with Windows paths such as .example or c:example.

Diving into zip files

One particular situation that often breaks the flow of navigation in file system tools is that of dealing with archives. Pharo comes with an off-the-shelf library that maps Zip files onto file systems, and GTSpotter takes advantage of that. For example, when selecting a Zip file, the preview shows the contents.

Zipfile.png

Diving into the file, opens the Zip archive virtually and shows its contents as if it were a plain folder. Diving and previewing works as expected.

Inside-zip-preview.png

And this includes diving into zip files nested in other zip files.

Deep-zip-file.png

Summary

GTSpotter makes the file system easily browse-able from inside a Pharo image. Combine this with the detailed interactions offered by the GTInspector and you will transform Pharo into a powerful file system manipulation environment.

Posted by Tudor Girba at 11 March 2015, 10:43 pm link
|

Boosting GTSpotter with preview capabilities

GTSpotter is a novel search interface for spotting objects that we introduced a short while ago. It is part of the Glamorous Toolkit and it is now also available by default in the latest Pharo 4.0.

You trigger it with Shift+Enter and you search. For example, GTSpotter allows you to search through the file system. It looks like this:

Spotter-folder-nopreview.png

Pressing Enter inspects the file. However, before pressing Enter it would be mighty useful to take a peak into that file, would it not? To this end, we introduced the Preview capability. Pressing Cmd+P toggles the preview. As we are looking at an st file, we even get code highlighting.

Spotter-st-preview.png

The preview of a picture file shows the picture.

Spotter-pngfile-preview.png

And for a folder it shows its contents.

Spotter-foldercontents-preview.png

Obviously, these previews are not hardcoded in a central place. Instead, like in the case of the GTInspector, each object can decide how to be previewed. By default, the preview consists of the basic object structure.

Spotter-globalvar-defaultpreview.png

By adding dedicated extension methods in desired classes allows you to customize the preview. For example, the below code shows how the source code preview of a CompiledMethod is being defined:

CompiledMethod>>spotterPreviewCodeIn: aComposite
     <spotterPreview: 10>
     aComposite pharoMethod
          title: [ self gtDisplayString ];
          display: [:compiledMethod |
               ' ', compiledMethod getSource];
          smalltalkClass: #methodClass;
          entity: self

Spotter-compiledmethod-code-preview.png

Combining the preview ability with the diving option described in the previous post, opens new possibilities for GTSpotter. For example, besides fast file browsing, GTSpotter now also can replace the myriads of windows produced by Implementors/Senders/References. For example, in the picture below, searching for do: provides the list of implementors, and diving into a method shows more implementors and senders.

Spotter-implementors-preview.png

Let’s take another example: an often occurring need consists in finding previous loading scripts. Combining the search through the history of GTPlayground pages with the preview of a page provides a quick and convenient solution.

Spotter-playground-preview.png

Adding preview increases dramatically the usefulness of the interface. It is now up to you to fine tune its behavior to fit your workflows.

Posted by Tudor Girba at 2 February 2015, 7:50 pm with tags tooling, moose, pharo, analysis link
|

Improving the print-it support in GTPlayground

Print it is one of the actions that exists since ancient times in Smalltalk environments. A while ago, we enhanced the GTPlayground with a Print It action that does not affect the existing code. Unlike in the classic behavior in which the printout gets inserted in the code editor, the improved version pops it up in a separate floating morph.

While this worked fine for most coding cases, every once in a while people reported the need to paste the printout in the text editor - hence the exact opposite the new solution tried to mitigate. To accommodate this use case Andrei and I made it so that you can now simply press Enter while the popping morph shows the printout and the text gets inserted in the editor.

But, there are two tiny details that come with the new version.

Editor.png

When no text is selected and you print, like in any Smalltalk environment, the whole like will be evaluated and printed. However, unlike other environments, the line will only be highlighted. This is a new mechanism that we introduced and that applies to any other commands as well (like evaluating or inspecting), and it is useful to provide a visual feedback to the user of what was actually executed. As opposed to selection the highlight has no influence on editing - in fact, it disappears as soon as you type anything.

Highlight.png

When a selection does exist, the highlight is added on top. With this mechanism, when existing the popper widget via Esc or Backspace, only the highlight gets erased, and the exact editor state is restored to how it was before printing.

The other tiny detail is that when you press Enter, the text gets pasted as a comment. In this way, the syntax highlight does not get affected.

Comment.png

It is interesting to notice how many variations there can be even in a small feature like the one mentioned above. Just because a certain solution resisted for decades, like in the case of print it, it does not mean it is the only one or even the best one. For this reason, it is our duty to explore variations and guide the search by having the developer experience in mind.

Posted by Tudor Girba at 17 January 2015, 10:50 pm with tags tooling, moose, pharo, analysis link
|
<< 1 2 3 4 5 6 7 8 9 10 >>