<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tudor Girba on Medium]]></title>
        <description><![CDATA[Stories by Tudor Girba on Medium]]></description>
        <link>https://medium.com/@girba?source=rss-17bdde4363f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*fCp1Vi685hDYI9pq.jpg</url>
            <title>Stories by Tudor Girba on Medium</title>
            <link>https://medium.com/@girba?source=rss-17bdde4363f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 06:37:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@girba/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[#remote, #nomeetings, #noestimation, #nobacklog. #storytelling]]></title>
            <link>https://medium.com/feenk/remote-nomeetings-noestimation-nobacklog-storytelling-d0d1b3b7a2de?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0d1b3b7a2de</guid>
            <category><![CDATA[storytelling]]></category>
            <category><![CDATA[noestimates]]></category>
            <category><![CDATA[remote]]></category>
            <category><![CDATA[no-meeting]]></category>
            <category><![CDATA[nobacklog]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Fri, 15 May 2020 12:56:45 GMT</pubDate>
            <atom:updated>2026-03-27T13:35:43.159Z</atom:updated>
            <cc:license>https://creativecommons.org/licenses/by-nd/4.0/</cc:license>
            <content:encoded><![CDATA[<h3>#remote, #nomeetings, #noestimates, #nobacklog. #storytelling</h3><h4>How we work at feenk</h4><p>As I am writing this, billions of people are urged to socially distance themselves from others. Temporary hospitals are erected. Medical personnel face deadly situations without proper equipment. Factories change to produce ventilators. As physical places shut down, the economy takes a hard hit, too. Unemployment sky rockets. Production drops. People worry. And rightfully so.</p><p>We are all asked to do our part and stay home. But, some of us are more privileged than others: we can work and produce value while being at home. This article is addressed to them. <em>In particular, to those creating software-based solutions.</em></p><p>Many people are experiencing working from home full time for the first time. And for many, it’s not a pleasant transition. Routines are shattered. Frustration grows. Productivity seems to go down.</p><p>It does not have to be like this. Well, let’s not talk about productivity right now. We are not going through a normal situation. It’s already a stressful time. At the very least, work should not make it more stressful. Still, we should be able to produce some value. And, perhaps, in the process, we can also bring some joy into our lives.</p><p>To help with this conversation, I’d like to offer our experience at <a href="https://feenk.com">feenk</a> as a case study. Ever since we started in 2015, we work in a rather peculiar way: we work exclusively remotely, we work when it fits, we have no scheduled meetings, we do not rely on estimations, we have no centrally ordered backlog, and we guide our effort through the stories we tell each other.</p><p>According to the typical organizational and development process literature this sounds like we should not be able to produce anything of meaning. Whether we do or not, we leave it up to you to decide.</p><p><em>Perhaps a bit of background. We are a consulting company, but we work internally as a research lab. Our goal is to make the internals of systems explainable. We do this by rethinking the development experience:</em></p><ul><li><em>we invented moldable development, a new approach to programming that makes the system explainable through custom tools, and</em></li><li><em>we develop </em><a href="https://gtoolkit.com"><em>Glamorous Toolkit</em></a><em>, the environment that makes moldable development practical.</em></li></ul><p>Let’s assume you consider what we produce as being not entirely meaningless. I am not suggesting you necessarily do what we do, but at the very least our experience could be considered as a case study to unearth assumptions that should not be cast in stone.</p><h3>Humans first</h3><p>People that work are not resources. They are humans. We see well-being having priority over work. We apply this as a matter of principle, not as a result of a crisis.</p><p>What does that mean? For one, well-being is personal. If we follow this to its natural conclusion, it means that it is the organization that should adapt to the individual, not the other way around. Every individual has contextual needs starting with availability. A person with family and kids will have different needs than a single person that wants to travel the world. Neither is better. They are just different.</p><p>We accept our friends to be different and those relationships are better and stronger for it. Why should this not apply for the people we want to work with?</p><p>Moreover, the individual needs likely vary in time. For example, for many of us, the individual needs during this pandemic are significantly different than they were a mere couple of months ago. Just consider the sudden transition to homeschooling that many families have to go through. This is dramatically disruptive. It’s likely that people no longer have long contiguous blocks of time to allocate to work.</p><p>We are humans first, workers second. Work should be embedded in the current reality of life, and only the individual knows how that should happen best. There are exceptions, of course. Right now, medical and support personnel throughout the world will have little choice but to work in terrible circumstances. But, those are exceptions. The majority of us can still choose.</p><p>This is particularly relevant when you set out to do work that has never been done before. When you want to create, it’s best to be in a position to be able to create. Yes, some external pressure can sometimes work, but not for an extended period of time, and not when it’s not voluntarily accepted. In general, creativity requires lateral thinking, and anxiety tends to inhibit it.</p><p>When we can work in our terms, we have more chances to enjoy our work. When we can decide what is important, we are more likely to explore a step further than usual, and by doing so, we increase the chance of uncovering value that otherwise would remain hidden.</p><p>As we like what we do, we sometimes tend to work more than we should. This is a tendency we actively try to counter balance. While we do not want to control how much people work, we do try to keep track of when people are explicitly on holidays. The contract stipulates a minimum amount of mandatory holidays. People are encouraged to take more than that, but at least the minimum must be taken. This seems to work reasonably well, but we likely still can improve in this regard.</p><h3>Remote. No prescheduled synchronization</h3><p>We regard the organization as a distributed system made of collaborative actors. There are multiple ways to design such a system. We chose the view that relies on asynchronous communication and on eventual consistency. This implies that the organization should not rely on any prescheduled synchronization mechanisms.</p><p>The most obvious is to not have to be in a certain place. We work remotely. We are currently a team of 11 spread over 5 countries in 3 continents. While some of us actually live in the same city, we do not meet in person to work. We do meet occasionally on company trips, conferences, or visits to our customers (during the COVID-19 crisis, we cancelled all of those). Still, our functioning does not depend on anyone being in a certain place.</p><p>Another synchronization mechanism is the work schedule. If everything is asynchronous by default, it does not quite matter when one works. This turns out to be rather convenient when someone is on a different timezone, and it goes hand in hand with having no scheduled meetings, too. A scheduled meeting requires someone to be available at a certain time, which is at odds with the asynchronous work principle. So, we have no such meetings for any of our internal work. That means we have no standup, no fix planning session. The only scheduled meetings we have is when we have to comply with an external factor, such as a customer, but we fight hard to not have many of those.</p><p>A meeting is a way to bring different parties into sync. However, when we rely on eventual consistency, we do not have to have everyone be on the same page all the time. We can be out of sync for a while and we are fine with that.</p><p>Yet another mechanism that induces synchronization is the ordered backlog. An ordered backlog implies that there is a single queue of work. So, we do not have one of those. We do have <a href="https://github.com/feenkcom/gtoolkit">an issue tracker</a>, but it is not ordered. In fact, everyone in the team can do what they want at any time.</p><p>That sounds like chaos. So, let’s look at what we put in place.</p><h3>Organizing communication around conversations instead of topics</h3><p>We do not schedule meetings, but we still meet. In fact, we like to pair often. Only we do it when it fits everyone involved. How do we do that? We simply ask. If I want to pair with someone, I’ll ask kindly if they are available. If they are available, we pair. If not, we do not.</p><p>Our communication setup is simple. Almost simplistic. We mostly use a chat tool, but more relevant is how we use it. The vast majority of communication (&gt;90% of messages) are exchanged on public channels. The channels do not denote topics, but are named after pairs of people, such as #personA-personB. The goal is to connect people first and have work follow the connection, rather than the other way around. We find that this works reasonably well in our case, in particular given that the same persons often end up tackling rather distinct problems.</p><p>As all these channels are open, they can be seen by anyone and they can also be contributed to by anyone. It is not unusual for a conversation to start with two people and then have one or two join for a short while with various inputs.</p><p>A worry is that this leads to too much noise. That can happen. There are days of agitation when everything seems to be moving at once, but in most days, it is manageable. One interesting side-effect of having everything in the open is that there is less anxiety of missing out.</p><p>Beside chatting and pairing, we also communicate through narratives and through code. When we want to convey a larger wish, we might describe it in a longer internal blog post. But, when we want to convey what is in the system, we make it the job of the system to carry that narrative forward, in an executable manner.</p><h3>Compacting communication</h3><p>Remote communication does not have a good reputation. We hear people complain about the quality of connections, or about the lack of physical feedback during calls. This can happen when we assume that we need to replicate the same communication the happens when co-located. That’s a misguided comparison. Remote work is another new medium that offers other opportunities.</p><p>First, the lead time: How long does it last between the moment you want to do something and the moment you actually get to do it? If for talking with someone, I need to move to a room, there is a delay involved. If to move to that room, I first have to book it, there is another delay involved. These can take many minutes. In a remote environment, it can take seconds. This matters because shorter lead times can enable finer grained communication.</p><p>When remotely, we can pair for just a few minutes meaningfully, something that is not so convenient when co-located. This is just one example. Look for the shift in costs, and adjust accordingly.</p><p>There is at least one more thing to consider when it comes to communication costs. If we get the cost of communication down, say an order of magnitude, you get access to a whole new set of options.</p><p>Consider this conversation sample.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B58fuLDm5r1DW-pQA6tWnw.png" /><figcaption>An excerpt of a condensed conversation.</figcaption></figure><p>Orange has a question. Blue answers in brief plain text. Orange answers back with a picture showing the inheritance tree of the class that Blue pointed out, essentially saying that the indication does not seem to map to the system. This is not unusual. These back and forth are often necessary, but can be quite expensive. Blue then sends a script with a picture that exemplifies the message concretely. Orange commits the code a couple of minutes later without asking any further questions.</p><p>Being able to show what you mean in a way that the other can immediately relate to without much further explanation can bring the cost of communication down significantly. When the cost is large, we might want to have synchronization points with status/planning meetings and with associated ceremonies. But, if you can convey the same problem in depth through a picture that you can put together in a few minutes and have the person on the other side say “ahh, yes, I see it”, you have new options.</p><p>We explicitly and continuously optimize our communication cost. It is not always as easy, but when it does happen (and our chat is full of pictures we send back and forth) we literally rejoice. It’s a thing we aim for. In our case, constructing concise narratives about a system is at the core of moldable development and is enhanced by our development environment.</p><h3>Distributed backlog</h3><p>Theory says that we should be doing the most important work first. That might work well in a factory. Or when everything else is equal. But, in creative work we see two problems with it.</p><p>First, someone would have to define what important is. Second, someone would have to order the items linearly. That’s not trivial in a space that was not tackled before. We often hear that the ordering is the prerogative of the business. But, how often does it happen for the business people to order the backlog only to find the technical tasks be pushed at the bottom of the list?</p><p>Over the years, we have experienced many times how seemingly unimportant issues unravel opportunities that would have otherwise be missed. In our team, there is no one that tells others what to do. Anyone can choose what they want to work on.</p><p>If we look at the core of it, a backlog holds a set of wishes. Some of those wishes come from some existing pains. Others might come from dreams of new possibilities. And they might come at various levels of abstractions.</p><p>When you set out to create a new kind of value, one that a customer cannot yet quite define, all you are left with is an inner compass. Only when you work as a team on a large enough problem, there are potentially many compasses, each working in a certain area.</p><p>Software is multi-dimensional. Flattening all those dimensions in a single list is rather limiting, and we choose to not do that.</p><h3>Planning around goals. No estimations. No handovers</h3><p>Because nobody tells anyone what to do, nobody can expect that someome does something specific either. In practice, they do listen to one another and they do coordinate.</p><p>To coordinate, we do employ some informal planning. Our planning happens in pairs or small groups, and might take minutes. And we might do it multiple times a day, or just a few times a week.</p><p>We never plan too specific tasks. We mostly agree on the goal and on how to describe a problem. And we think of the demo we want to show at the end.</p><p>We might engage in some short term estimations mostly to evaluate whether we want to go one way or another, but nothing else depends on that estimation. There are no promises. There are no handovers. We do not have to wait for others to finish something. If it’s not finished we might continue it, or we might go a different route.</p><p>We should also mention the issue of trust. When people choose when and how to work, we must trust them. We might disagree with the path or outcome, but all debates should happen from a trust perspective. Trust is essential and it goes both ways: When we trust the source of feedback, we are less likely to perceive it as personal and focus on improving the work.</p><h3>Throwing code away</h3><p>When we describe what we do, we hear often that given that there is no upfront coordination, it might happen that there will be overlap in what different people work on. In practice, it happens very rarely. In most cases, people naturally work together.</p><p>Nevertheless, it can happen that two people work on the same thing at the same time, and we are more than fine with it. That’s because we throw away most of the code we write. If we do not like the story we can tell with the code, we throw it away. Even if it works. It’s rather liberating, really.</p><p>Just consider the alternative: if you never throw away code that works, it means that you got it right the first time. That’s unlikely. We find that we need some 3–5 variations of the same thing to reach a reasonably satisfying solution.</p><p>So, having two competing solutions is actually positive because it means we can learn faster. Throwing code away is only a waste when you think of programming as a process of construction. Instead, we regard programming as capturing our ideas in a larger, coherent, but yet-to-be-defined puzzle. In this context multiple perspectives are essential and throwing code away is almost mandatory.</p><h3>Trunk-based development. Continuous delivery</h3><p>We do synchronize eventually. In code, directly on trunk. We do not use development branches or pull requests, and we do not require code reviews. We simply commit, integrate and deploy intensely.</p><p>We might review code during pairing, or we might do it after a commit while working on the code. When we do find something we do not like, we transform it into automatic detections either in the form of tests, when the problem is decomposable functionally, or of structural checks, when the problem is better suited for some static analysis. In other words, we use reviewing for exploratory purposes, but the regression checking is always the job of the machine.</p><p>From a technical perspective, this way of working enables <a href="https://continuousdelivery.com">continuous delivery</a>. The largest cost in software development is integration and we want to see problems as soon as possible. This constraints how we work and naturally pushes us to modularize our work both internally and from a user perspective.</p><p>From an organizational perspective, a pull request that requires a review is a synchronization point. It often builds a queue and one’s work waits for someone else. We want to avoid relying on synchronization mechanisms that are not necessary.</p><p>And, there is another perspective to it. We look at the systems we construct not as something we implement, but something that expresses our understanding of the problem. Each of us has an individual understanding from our own perspective. Given the multi-dimensional nature of software, it is not reasonable to expect a complete understanding to fit in a single head. We need to externalize it and the code is the ultimate place in which we get to synchronize our perspectives. When a mismatch occurs, we see it as an opportunity to learn from and adjust our understanding. This synchronization mechanism is mandatory, and we want to get to this point in the fastest possible way.</p><h3>Storytelling</h3><p>Storytelling glues our development together. When we want to convince a colleague about a particular direction, we tell a story. When we design, we think of the story the system will tell. When we document our system, we make the system show the story. And we release only when we deem that the story is beautiful.</p><p>Stories come in many shapes. A document can tell a story. A blog post can tell a story. A comment to an issue can tell a story. A tweet can tell a story, too. Each medium enables different kinds of stories.</p><p>We utilize all of these, but we spend most of our time inside software systems. That is a medium that lends itself to new opportunities. Most of our stories are executable and visual and are created and delivered right in the development environment. We want our system to tell a story. And we want these stories to be told at all level of abstractions.</p><p>Let’s look at some examples. We start from a single object. In this case, we see <a href="https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920">a price object</a> constructed by the code on the left being inspected through a custom view on the right. The view tells a story of how the object is formed in a way that a non-technical person can relate to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IqW_9MRLR2Sc1tWPNi9R5Q.png" /></figure><p>Once we can show individual objects in interesting ways, we can weave these representations into larger narratives. For example, take a look below at an example of how we went about <a href="https://medium.com/feenk/the-making-of-circular-treemap-in-glamorous-toolkit-9a6881beea37">documenting the implementation of an algorithm</a>: the environment allows us to explore the detection of a neighbor in a circular treemap through views specific for the different steps in the algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oozg_KFfCBlZLFrV_4ScrA.png" /><figcaption>Investigating an algorithm through the lens of custom views.</figcaption></figure><p>And here is another similar example documenting another algorithm. This time, we assemble the object views into a larger narrative presented in a live document.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1022/1*eiW4xjxpUFzdX7NCcT5vTg.gif" /><figcaption>Describing an algorithm in a live document.</figcaption></figure><p>We went through thousands of scenarios like these, and we learnt that every piece of our systems hides at least one exciting story, regardless of how technical and dry appears at first sight. But, these stories are more than just excitement. They are engineering tools, too, as they enable us to reason with ease about otherwise impenetrable problems.</p><p>Just consider this <a href="https://medium.com/feenk/debugging-a-keystroke-problem-4c1e8cd6a865">story of a bug</a>, a highly technical low-level bug, about how when pressing certain keys on a real keyboard (bottom left) we get a wrong signal internally (top right). The video depicts rather literally how we approached the debugging of the problem. We built a whole tool just to be able to reproduce this problem in a way that was pleasant for our brain. This then allowed us to tackle the problem effectively. And then, perhaps unexpectedly, it ended up as a tweet and became a marketing tool, too.</p><h3>feenk on Twitter</h3><p>When #gtoolkit is embedded in the intertwined logic of Morphic, pressing character [ works fine, but pressing Shift+[ is translated into Shift+LeftArrow. How do we know? Take a look. Having bugs is annoying, but working on them does not have to be. https://t.co/fhhqWbhf3T</p><p>A good story can make us both be productive and smile at the same time. It can be both an engineering tool and a marketing tool at the same time.</p><p>Storytelling is a powerful skill. Like any skill, it can be learnt. We make it a focus to train it, and we optimize all our work around it. By doing so, we find that most other things are secondary.</p><h3>No “I am sorry”. Just “thank you”</h3><p>We do have one rule though: we can only say “I am sorry” if we hurt someone, but we can say “thank you” as many times as we want.</p><p>We trust each other to do the best we can, and we assume mistakes are normal, be it in code or otherwise. As such, making a mistake should be associated with focusing on finding a solution, and not with being sorry for what could have been different.</p><p>At the same time, whenever we do get something we enjoy, we like to celebrate it. We noticed that a “thank you” does wonders, so we use that abundantly.</p><h3>Parting remarks</h3><p>This article does not put forward a recipe. It also does not describe an ideal solution. This is merely our story with its specific caveats.</p><p>As we develop the tools we use, we are our first customers, and this puts us in the strong position of understanding the domain rather deeply.</p><p>We are not a large team. Although we were told before that this approach will not work beyond a handful of people, 11 people still does not constitute a large team. Then again, many larger companies are made up of teams around this size.</p><p>We work for the long term. We never promise a specific outcome until it’s done. As such, we do not have to run after promises. Others might not be in this position, although we do believe that one should avoid depending on promises, especially in our field and especially when the promises are not made by the team.</p><p>In any case, this approach worked for us and for our values. We wanted to have a resilient organization that can mold around the individual. We did not follow a rule book. We borrowed some pieces from others, such as <a href="https://basecamp.com/books/remote">working remotely</a> or <a href="https://www.goodreads.com/book/show/3423629-the-customer-comes-second">focusing on the team members first</a>, but we wrote our book the way it worked for us.</p><p>Resilience is hard to judge in normal conditions. In fact, resilience comes at an apparent cost whose utility is not obvious in normal times. Resilience pays off when you meet an unusual event. The current crisis is such an event. We noticed that while there were many changes for the individuals, there was little change for the organization. And we learnt that even in these times, there needs not be a tradeoff between individual well-being and group productive work.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0d1b3b7a2de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/remote-nomeetings-noestimation-nobacklog-storytelling-d0d1b3b7a2de">#remote, #nomeetings, #noestimation, #nobacklog. #storytelling</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why the governor of New Jersey calls for COBOL programmers]]></title>
            <link>https://medium.com/feenk/why-the-governor-of-new-jersey-calls-for-cobol-programmers-a6c24fbe1093?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6c24fbe1093</guid>
            <category><![CDATA[moldable-development]]></category>
            <category><![CDATA[software-environmentalism]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Fri, 10 Apr 2020 20:33:29 GMT</pubDate>
            <atom:updated>2020-04-10T21:14:12.529Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Why the governor of New Jersey is calling for COBOL programmers</strong></h3><h4>A software environmentalism story</h4><p>A few days ago, <a href="https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html">the governor of New Jersey called explicitly for COBOL programmers</a> to help with the development of the unemployment system during the COVID-19 crisis:</p><h3>Jim Manico on Twitter</h3><p>The governor of New Jersey just put out the call on live TV that he is desperate for Cobol programmers right now.</p><p>This is how the software environmentalism crisis looks like.</p><p>In the software development industry, we focus almost exclusively on building systems. The conversations are dominated by new languages, new frameworks, new deployment options. And the body of software grows exponentially. At the same time, we are unable to remove old systems.</p><p>From this perspective, our software industry behaves not unlike the plastic industry: we focus on building without any regards to recyclability. That is not sustainable. And, given the breadth of software’s reach, it is not responsible either.</p><p>The call for COBOL programmers by the governor of New Jersey takes people by surprise, including the governor himself who said that “<a href="https://nymag.com/intelligencer/2020/04/what-is-cobol-what-does-it-have-to-do-with-the-coronavirus.html">There’ll be lots of postmortems and one of them on our list will be how did we get here where we literally needed COBOL programmers.</a>”</p><p>And the apparent sudden growth of the #COBOL tag popularity is reason for surprise as well:</p><h3>michael_nielsen on Twitter</h3><p>Unexpected</p><p>After all, we associate a popular tag to be trendy, and COBOL is certainly not considered cool. But, COBOL is merely a symptom. The underlying problem is systemic. COBOL is not a problem per se. The problem is that we associate COBOL with extinction, while it is still one of the most used programming languages in the world.</p><p>We might think that changing a system is just a matter of will. Interestingly, in the case of the New Jersey unemployment system, there were many signs. For example, take a look at this one:</p><h3>Joseph Steinberg on Twitter</h3><p>COVID-19 Response: New Jersey Urgently Needs COBOL Programmers (Yes, You Read That Correctly) https://t.co/irjdR8eyCc #COBOL #NewJersey #Covid_19 #COVID #CoronavirusUSA #Coronavirustruth #News #NJ #USA #TechNews #CyberSecurity #InfoSec #Unemployment #CoronavirusPandemic #NYC</p><p>I would be surprised if the people that manage this essential system did not know that depending on a technology considered outdated poses a great risk. I’d also be surprised if they didn’t try to address it, and fail for one reason or another.</p><p>In fact, I am seeing this with every company we interact with. Everyone seems to have at least one large skeleton in a closet right at the core of the business that they simply cannot get rid of.</p><p>When I ask people at various conferences if their company relies on at least one mainframe system, the large majority does. This is not a local problem. It’s a systemic one that requires a systematic rethinking of our work.</p><p>We need to change the narrative. Recyclability must be embedded into how we build our systems.</p><p>The term “software” was born to contrast “hardware”. At that time, hardware was as large as a building and software was easy to replace. We now live in a different world: hardware fits in my pocket, while we are drowning in software we cannot move.</p><p>When developing systems, people often focus on current or immediate functionality. That is shortsighted and dangerous. Functionality is indeed a business asset, but the ability to adapt to changes in the surrounding environment depends on the non-functional parts. The New Jersey unemployment system did its job just fine until recently. Its functionality did not deteriorate. It was the environment that changed and this made the system is no longer adequate. It now needs to be recycled to match the new reality.</p><p>To recycle a system implies taking it apart and refurbishing it for other purposes. However, before we can take it apart, we first have to understand the parts.</p><p>Interestingly, the activity of understanding a system happens to be the single largest expense we have, with developers alone spending 50% or more of their time reading code. Yet, nobody talks about how this time is spent. That’s the first thing we should change.</p><p>We need to start talking about how we read code. Better yet, how to not read code.</p><p>Developers read code because they want to understand enough to know what to do next. This is called decision making. Given that we spend most of our energy doing that, it would be more interesting to define our work as being primarily a decision making one rather than construction one.</p><p>As the goal is decision making, reading is just the strategy through which we extract information out of our system. It also happens to be the most manual and error prone strategy.</p><p>When I ask technical people whether they have pictures about their systems, everyone says yes. But, when I ask whether they believe those pictures are 100% accurate, most people say no. That’s because the pictures were created manually.</p><h3>Tudor Girba on Twitter</h3><p>Do you have pictures about the inner workings or structure of your existing software system? If yes, how are they constructed?</p><p>A picture or report about a system exhibits either a wish (when the picture depicts a plan) or a belief (when the picture depicts what we think the system is). Both are essential for humans, but neither should be used as basis for decision making.</p><p>Decision making is hard enough as it is. Often uncertainties in the environment require probabilistic thinking. However, the reality of our own system should not be a probability. The reality of our system must become a certainty.</p><p>The sheer size of our systems far exceeds the ability of humans to grasp without summarization. A picture does tell a thousand words, but those words must be accurate.</p><p>Now, accurate pictures are still not enough. For a picture to be effective, it must be specific to the question we want to answer.</p><p>Software systems are likely the most complicated structures we have ever created as humans. To this end, it is impossible to predict specific questions. We can predict classes of questions but not specific ones.</p><p>That is why pictures have to be created after the question was made explicit. To make this happen the ability to craft a picture must reside inside the team. Given its impact, this ability is not merely a technical one. It has high level business strategic importance.</p><p>A good picture or narrative can make humans grasp a data problem orders of magnitude faster than without one. A decade ago this was less obvious, but by now we have ample evidence from all the efforts around data science and the impact it has on business decisions.</p><p>As everything about our systems is data, including code, the same principle applies to software development, too. We just have to think of our job through this new lens. And the good news is that this is less difficult than expected.</p><p>Just think of this: most systems take data, model it, manipulate it and present it to users that make decisions fast without ever seeing the raw data. So, we, software people, possess this magic skill of transforming data into information to speed up decision making. The skill is already present inside our teams. We just have to apply it to our own work!</p><p>Every time developers read, they imply that the only way to answer the question is manually going through raw data. However, through our work and that of others, we showed that most software assessment is rather decomposable as a search or visualization problem.</p><p>That might sound academic, but it’s really not. Consider this: when a developer address a data problem in the database, she first writes a query. When the same developer addresses a problem in code, she starts scrolling. Both are data problems. Only the mental models are different.</p><p>How do we change this?</p><p>We should listen to what Marshall McLuhan and John Culkin told us many decades ago about the nature of our tools. We should observe that there is a deep correlation between the interface of our tools, and the mental models they induce. A database tool has a big query box at the top. People query. A typical development environment has a giant text editor at the center. People scroll and read.</p><p>We shape our tools, and thereafter our tools shape us. We should carefully choose the characteristics of our tools because they dictate how we think. Our tools, and not only our languages, are essential. The stakes are too high to disregard this.</p><p>How would this look like in practice? Consider a case study of reasoning about evaluating @Deprecated classes in a Java system. In our experiments, we ask developers to estimate the time it would take to go over a given system to find which deprecated classes they can remove and what to do with the ones that cannot be removed right now. For that specific system, comprising of 2500 classes of which 25 are deprecated, the average estimation is 4h, the minimum being 2h.</p><p>We picked this problem because this is a rather basic evolutionary problem about which developers often learn in introductory courses. This should be a highly optimized problem that we could not optimize meaningfully any further.</p><p>We show how the same problem can be addressed better and more accurately in a matter of minutes. Minutes. Literally.</p><p>Here is a description of how that works:</p><p><a href="https://medium.com/feenk/evaluating-deprecated-classes-in-java-systems-with-glamorous-toolkit-842e76a0afe2">Evaluating @Deprecated classes in Java systems with Glamorous Toolkit</a></p><p>This is an order of magnitude difference when dealing with a simple scenario. The difference is correlated with the nature of the tools. We built a new kind of an environment precisely so that we can think differently. And this difference only grows as the problems get larger.</p><p>But, the tool is not the interesting part. The specific tool used is relevant to show what is possible. The most interesting part is that people can understand what the tool conceptually does in minutes, even when they’ve never done any software analysis before! There is no conceptual learning curve because developers have already done the same thing many times, only on other data. This ability is essential and it is reusable.</p><p>Tools are essential in software development. The key characteristic is that they should be customizable inexpensively while working on the problem. They should be moldable.</p><p>Every time you replace manual work with automation, the real value is extracted when you change the business processes. The same applies here. We have seen historically that when tests became code, we shifted towards various forms of test-driven development. When infrastructure became code, we reshaped companies around DevOps.</p><p>Tools must become code, too. And this leads to moldable development, a way of guiding development through the lenses of custom tools.</p><p>This article is already way too long. Does it cover the whole space? No. Do we have all the answers? Certainly not. But, we do have the beginning of the conversation. And this is a conversation we must have.</p><p>Our kids will only know a world based on software. We already messed up the real world for them, and that is certainly something we must address. Still, while addressing the real world, we should not create a larger problem.</p><p>The New Jersey unemployment system is but a case that happened to gain media attention. But, the problem is systemic. We are drowning in systems we cannot move.</p><p>The software world is in a crisis of environmental proportions, too. But, that is addressable. And like with the real world problem, we must see it for what it is and make it an explicit subject of conversation.</p><p><em>This article is based on a Twitter thread I wrote not long ago:</em></p><h3>Tudor Girba on Twitter</h3><p>The governor of New Jersey called explicitly for COBOL programmers to help with the development of the unemployment system: https://t.co/7MVEhynS7k This is how the software environmentalism crisis looks like. An explanatory thread. 1/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6c24fbe1093" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/why-the-governor-of-new-jersey-calls-for-cobol-programmers-a6c24fbe1093">Why the governor of New Jersey calls for COBOL programmers</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Visualizing a Postgres database from  the inspector]]></title>
            <link>https://medium.com/feenk/visualizing-a-postgres-database-from-the-inspector-3e922e8f4670?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e922e8f4670</guid>
            <category><![CDATA[gtoolkit]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[moldable-development]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Wed, 04 Mar 2020 22:48:34 GMT</pubDate>
            <atom:updated>2020-03-04T22:48:34.906Z</atom:updated>
            <content:encoded><![CDATA[<h3>Visualizing a Postgres database from the inspector</h3><h4>A story of moldable development</h4><p>Databases are pervasive in software development, but more often than not, exploring databases is perceived to be different than typical development and it happens outside of the development environment. We think that this is not reasonable and that it should change.</p><p>A while ago we showed how we can accommodate a <a href="https://medium.com/feenk/working-with-postgres-from-the-development-environment-3efee0f8fe90?source=friends_link&amp;sk=1b077d5a695bf2972009e5d6efd77a2d">database exploration</a> right into the Glamorous Toolkit inspection workflow. This also shows nicely that working with the database is not special in any way.</p><p>So what?</p><p>Let’s take the case we used previously with a database including cities with populations and life expectancies around the world. Let’s say we want to learn in which continents are the largest cities and how are their life expectancies.</p><p>First, we put the data together. We open a connection directly from the Playground and then shoot an SQL query at it.</p><pre>select <br> city.countrycode,<br> city.name as city,<br> city.population ,<br> country.lifeexpectancy as life,<br> country.continent <br>  from city left join country<br>  on city.countrycode=country.code</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NX61tEqUF4wmiFOiKUGIqg.png" /><figcaption>Opening a connection to the database and evaluating the SQL query gets us a result that looks like a table.</figcaption></figure><p>So, there. Now, we have a result that is shown like a table. But, for our purpose, a table is not a great representation. We’d need some visualization. Now, granted there are quite a few ways to visualize this data, but let’s say that we are developers and want to stick to basics. A bar chart would do. So, we open a Playground in the context of the result and here we go:</p><pre>countries := self recordsAsDictionaries <br> sorted: [ :x :y | (x at: #population) &gt; (y at: #population) ].<br>data := GtPlotterDataGroup new values: countries.<br>data := <strong>data labelled: [ :each | each at: #city ]</strong>.<br>data := data colored: [:each | Color black ].<br>GtPlotterHorizontalBarChart new<br> barLabelWidth: 185;<br> barWidthScale: (GtPlotterLinearScale new <br>  domainFrom: 0 to: (countries max: [:each| each at: #population]));<br> <strong>barWidthData: [ :each | each at: #population ];</strong><br> barHeightScale: (GtPlotterLinearScale new <br>  rangeFrom: 0 to: 20;<br>  domainFrom: 0 to: (countries max: [:each| each at: #life ]));<br> <strong>barHeightData: [ :each | each at: #life ]</strong>;<br> amountOfTicks: 2;<br> with: data.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YUQ0PHmEqtIt2eiJ7mQpLQ.png" /><figcaption>The database query result can be manipulated through the same tools as any other object in the system.</figcaption></figure><p>Not bad. But, our geography is not that great. So, not to appear ignorant we color the bars distinctly for each continent.</p><pre>countries := self recordsAsDictionaries <br> sorted: [ :x :y | (x at: #population) &gt; (y at: #population) ].<br><strong>colors := {&#39;Asia&#39; -&gt; &#39;cf7b5d&#39; . &#39;Europe&#39; -&gt; &#39;ff1c55&#39; . &#39;North America&#39; -&gt; &#39;3a9371&#39; . &#39;South America&#39; -&gt; &#39;75eab6&#39; . &#39;Africa&#39; -&gt; &#39;bae342&#39; . &#39;Oceania&#39; -&gt; &#39;aaaaaa&#39;} asDictionary.</strong><br>data := GtPlotterDataGroup new values: countries.<br>data := data labelled: [:each | each at: #city ].<br>data := <strong>data colored: [:each | (colors at: (each at: #continent)) asHexColor alpha: 0.5]</strong>.<br>GtPlotterHorizontalBarChart new<br> barLabelWidth: 185;<br> barWidthScale: (GtPlotterLinearScale new <br>  domainFrom: 0 to: (countries max: [:each| each at: #population]));<br> barWidthData: [ :each | each at: #population ];<br> barHeightScale: (GtPlotterLinearScale new <br>  rangeFrom: 0 to: 20;<br>  domainFrom: 0 to: (countries max: [:each| each at: #life]));<br> barHeightData: [:each | each at: #life ];<br> amountOfTicks: 2;<br> with: data.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CNcalBazuqf3mkoRcvmI2Q.png" /><figcaption>Tweaking the visualization in place.</figcaption></figure><p>Much better!</p><p>The whole process can be measured in minutes. Ok, you might say, but you can use a notebook for this. Or a dedicated data manipulation environment. Indeed, you can. Still, we show that we can bring the data exploration experience to the regular development, rather than having to switch to where the experience is. In our case, it all happens in the same environment, with the same workflow, and relying on the same muscle memory.</p><p>This is a typical example of moldable development and reinforces the idea that a one time investment in learning how to think through moldable tools can then be applied over and over in many different contexts.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e922e8f4670" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/visualizing-a-postgres-database-from-the-inspector-3e922e8f4670">Visualizing a Postgres database from  the inspector</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Moldability starts with the frame]]></title>
            <link>https://medium.com/feenk/moldability-starts-with-the-frame-ac9f3d837422?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9f3d837422</guid>
            <category><![CDATA[development-tools]]></category>
            <category><![CDATA[glamorous-toolkit]]></category>
            <category><![CDATA[moldable-development]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Sun, 16 Feb 2020 17:17:37 GMT</pubDate>
            <atom:updated>2020-02-20T17:57:09.249Z</atom:updated>
            <content:encoded><![CDATA[<p>To get to moldable content, the frame must not imply a specific structure for the content.</p><p>We got to the current tab-based design of <a href="https://gtoolkit.com">Glamorous Toolkit</a> mostly due to the problem of not being able to close a Spotter in a borderless window. In the meantime, we no longer have the Spotter issue, but we still kept the tabs because we realized that we created a frame that knows almost nothing.</p><p>It essentially knows a home tab that we can easily mold, a menu that we can make moldable, and a way to search that is already moldable. This is it. No elaborate global menus. No hardcoded views. We can do this because the actions are bundled with the context in which they apply.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HTLy2Kom0LShut_baVmYEQ.png" /><figcaption>The home tab from Glamorous Toolkit.</figcaption></figure><p>There are certainly things we should improve. For example, a transcript or an inspector over a beacon, the object logging engine, do not work well in a separate tab. But, overall, it’s remarkable in how simple it can be.</p><p>Even if not intended from the beginning, the frame design looks not much different from that of a web browser. As many people are able to work with a web browser, this opens all sorts of possibilities, in particular in the areas of education and integrating the work of non-technical people.</p><p>Just take a look at this live document:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPhXbN7wJSr_NdM6VpqQxw.png" /></figure><p>or this live slideshow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0j9-9QaGxt1fClKjO4W7rg.png" /></figure><p>or many other forms this environment can be molded into:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U0_rfUjHP6NL9pcAXnmXrw.png" /></figure><p>I find this exciting. What do you think?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9f3d837422" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/moldability-starts-with-the-frame-ac9f3d837422">Moldability starts with the frame</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Identifying a drawing performance problem]]></title>
            <link>https://medium.com/feenk/identifying-a-drawing-performance-problem-5042c40e4457?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5042c40e4457</guid>
            <category><![CDATA[gtoolkit]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[development-tools]]></category>
            <category><![CDATA[moldable-development]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Thu, 13 Feb 2020 10:02:16 GMT</pubDate>
            <atom:updated>2020-02-13T10:02:16.621Z</atom:updated>
            <content:encoded><![CDATA[<h4>A story of moldable development</h4><p>We worked on a way to explain that the need for moldability is pervasive in software development, and we came up with this treemap showing all classes from Glamorous Toolkit grouped in packaged and highlighting in blue the classes that define at least one custom view, and in green those that define examples.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WtFaGr1_2LNt3Yk_IP5Ow.png" /><figcaption>A treemap.</figcaption></figure><p>This worked nicely. However, we noticed that the user interface got significantly slower when the treemap was displayed. Indeed, a treemap entails potentially many elements, so we expected it to be slow to show the first time, but we did not expect it to slow the whole interface after it was displayed. At further inspection, we learnt that the reason was that caching was not enabled. This was particularly relevant when we were in the Inspector. To remedy this problem, we made the whole inspector page cache its contents and things improved considerably.</p><p>Of course, we were not quite happy yet. We wanted to also see how the change looks on the inside. So, we extended the children view of an element with previews. In the picture below we see an inspector showing the live preview of another inspector open on a treemap. On the right, we see the same inspected inspector, only this time showing the children view: indeed the element GtInspectorPageElement has the cache enabled.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jphjPdHeMjNH63QMKBpmyw.png" /><figcaption>On the left we have an inspector showing the live preview of another inspector displaying a treemap. On the right we see the same inspected inspector, but this time looking at the children view.</figcaption></figure><p>So, now we could see the effect we added in code, and this felt much better. And, just like children in a candy store, we even extended the preview with a drop down that can see the actual size of the element in the tree.</p><h3>feenk on Twitter</h3><p>Debugging a #UI often requires one to explore the rendering tree. To support this, the #gtoolkit inspector offers a children view for an element. Until now, it was a little dull as it was just showing a tree widget. So, we decided to enhance it with previews. #MoldableDevelopment https://t.co/FnJiDJmmXb</p><p>And as we were playing with the new shiny toy, we noticed something intriguing. The inspector has the ability of expanding a pane to occupy the entire space (as opposed to only have the pane occupy half the space, as in the first screenshot). This is accommodated through an overlay element that we over-impose over the whole scene.</p><p>When we looked closer at the maximized pane in the inspector (notice below that the button on the top left is expanded: it shows a — instead of a + like above), we saw that while the GtInspectorPageElement did have the cache enabled, the actual treemap was not under it, but next to it in the rendering tree. In other words, the cache would not apply to the case when the pane would be maximized.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSXi69D06df3a2Rg0R4uMA.png" /><figcaption>When an inspector pane is maximized, the way we enabled the cache does not cover it.</figcaption></figure><p>This serendipity would simply not be possible without the explicit work on custom tools. And it would not be possible without the playfulness that these custom tools enable.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5042c40e4457" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/identifying-a-drawing-performance-problem-5042c40e4457">Identifying a drawing performance problem</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[One rendering tree]]></title>
            <link>https://medium.com/feenk/one-rendering-tree-918eae49bcff?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/918eae49bcff</guid>
            <category><![CDATA[gtoolkit]]></category>
            <category><![CDATA[graphical-user-interface]]></category>
            <category><![CDATA[development-environment]]></category>
            <category><![CDATA[moldable-development]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Fri, 07 Feb 2020 17:54:51 GMT</pubDate>
            <atom:updated>2020-02-08T12:04:50.286Z</atom:updated>
            <content:encoded><![CDATA[<h4>A peek behind the graphical stack of Glamorous Toolkit</h4><p>When one looks at <a href="https://gtoolkit.com">Glamorous Toolkit</a>, it’s the shiny interfaces that capture the attention. It’s less apparent that we chose to build our own graphical stack. Building a graphical stack is not a straightforward decision. It is rather costly, especially for a small team, and it comes with high risks and uncertain payoffs. We went this route by going backwards: we imagined a few interfaces, asked ourselves how we’d implement that and the answer was that we need a new stack. So, we built one. Looking back, it was a good decision.</p><p>Given that we only had a rough idea of where we would like to go, we chose to guide our development through a set of principles. The most important of these principles is that we wanted our graphical scenes to rely on one single rendering tree at all times. There were others, such as no full modality, but the one single rendering tree proved to be the essential one.</p><blockquote>A short history. The graphical stack is called Bloc. The project was initially started by Alain Plantec and Stéphane Ducasse. Glenn Cavarle was also a major contributor until 2017. From our team at feenk, Aliaksei Syrel and Tudor Girba joined the project around 2015, and later on other people from our team also started to contribute.</blockquote><blockquote>During its 5+ years history, Bloc was completely rewritten multiple times. Bloc’s original goal was to replace Morphic, the classic graphical engine from Squeak and Pharo, with a vector-based one. Since 2015, the goal evolved to support a broader ambition of offering a live environment that would enable new kind of user interfaces. In particular, our team’s goal was to invest and make it the future infrastructure of Glamorous Toolkit.</blockquote><blockquote>In this article, we talk about the current Bloc incarnation that enables Glamorous Toolkit.</blockquote><h3>What does one rendering tree mean?</h3><p>Take a look at this picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_F-gKbNcoJLpLVdgEZ1BQ.png" /><figcaption>A scene in Glamorous Toolkit showing dependencies between examples.</figcaption></figure><p>We see multiple widgets. There is highlighted code. The larger panes are connected via thick lines and are arranged as a graph. There are lines that start from inside the text editor. Some panes hold <a href="https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920">example code</a>, and others hold inspectors on the resulting objects. And they are all live. We can scroll, type, change views. This is possible because all visual elements are part of one large scene that is internally organized as a tree.<em> A single rendering tree.</em></p><p>To reach one rendering tree at all times, we had to overcome two — well, there were more, but let’s just focus on these — distinct design problems:</p><ul><li>make graph layouts be regular layouts, and</li><li>make a scalable text editor out of small elements.</li></ul><h4>Graph layouts as regular layouts</h4><p>Glamorous Toolkit is a development environment. Nowadays, the typical environment is made of panes and widgets. Yet, a significant set of problems in software development are representable through visualizations. As this is an important class of representations, it follows that it should be directly supported in the environment. After all, the I in IDE stands for integrated.</p><p>Granted, we are not the first to think of adding visualizations in the development environment. However, typically these visualizations are confined in a canvas with a world of their own. What’s the problem with this? Well, the user interface framework has a tree, and somewhere in that tree, there is a canvas, and in that canvas … well, there is another world, with another tree. That these are different worlds, and different worlds means we cannot combine them easily. We do not want different worlds. We want just one. A seamless one.</p><p>So, the question is how can we support both typical widgets and visualizations within the same graphical infrastructure?</p><p>As much of software is representable as a graph, supporting graph visualizations was on top of our list. Graphs are formed of nodes and edges. In particular, to lay a graph out we need to traverse its nodes following edges. To this end, the nodes should know about the connected edges. Yet, we wanted to make any widget be able to be a node in a graph scene. So, how should we do this without hardcoding the knowledge about edges in all elements?</p><p>Let’s look at an example. In the code below, we display all classes from the SequenceableCollection hierarchy as text elements arranged in a grid layout.</p><pre>root := BlElement new constraintsDo: [:c | <br> c horizontal fitContent. <br> c vertical fitContent].<br>SequenceableCollection<br>  withDeep: #subclasses <br>  do: [ :class | <br>   root addChild: (BlTextElement new<br>    text: class name asRopedText glamorousRegularFont;<br>    background: Color white;<br>    look: BrShadowLook new;<br>    padding: (BlInsets all: 5);<br>    margin: (BlInsets all: 5)) ].<br>root layout: (BlGridLayout new columnCount: 5).<br>root children do: [ :element |<br> <strong>element constraints grid horizontal alignCenter ].</strong><br>root asPannableElement</pre><p>The result looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p4eJ5IeVdDm1CbGZ0NyqXA.png" /><figcaption>The classes from the SequenceableCollection hierarchy shown as text elements aligned through a grid layout.</figcaption></figure><p>It’s nothing fancy. Just a set of elements arranged with a layout. An interesting part is that for each children we specify element constraints grid horizontal alignCenter, a constraint specific for the GridLayout that instructs the layout to center-align the elements horizontally. In fact, every layout can react to dedicated constraints defined on a per-element basis. Nothing new here.</p><p>So, what happens if we want to arrange the same elements in a tree layout? The tree layout needs to know about the edges between our elements, so we simply represent these edges as constraints. Take a look:</p><pre>root := BlElement new constraintsDo: [:c | <br> c horizontal fitContent. <br> c vertical fitContent].<br>classToElement := Dictionary new.<br>ArrayedCollection <br> withDeep: #subclasses<br> do: [ :class | <br>  element := BlTextElement new<br>   text: class name asRopedText glamorousRegularFont;<br>   background: Color white;<br>   look: BrShadowLook new;<br>   padding: (BlInsets all: 5);<br>   margin: (BlInsets all: 5).<br>  root addChild: element.<br>  classToElement at: class put: element ]<br> relationDo: [ :superclass :subclass |<br>  <strong>| edge |<br>  edge := GtGraphEdge new <br>   from: (classToElement at: superclass)<br>   to: (classToElement at: subclass).</strong><br>  <strong>(classToElement at: superclass) <br>   constraints graph addConnectedEdge: edge.<br>  (classToElement at: subclass) <br>   constraints graph addConnectedEdge: edge</strong> ].<br>root layout: GtGraphHorizontalTreeLayout new.<br>root asPannableElement</pre><p>And the result is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3GgHrqkMqm9hSR8E89eLBA.png" /><figcaption>The classes from SequenceableCollection shown as text elements arranged through a tree layout. Notice how the elements are arranged in a tree without requiring a visual line between the nodes.</figcaption></figure><p>The magic happens in how we add GtGraphEdge to the corresponding elements. Certainly, this example is rather manual, but it depicts the idea that the tree layout is represented in the same way as the grid layout, or any other layout for that matter. That is reasonably interesting.</p><p>Ok, so graph layouts are regular layouts. So what? Well, this means that the graphical engine is already a visualization engine, too. We do need dedicated layouts, but all other pieces are reusable, and more importantly, combinable. Contrast this with a typical HTML + SVG type of solution. While we can show visualizations in SVG, we cannot easily combine and connect them with the surrounding HTML world.</p><h4>A moldable editor made of elements</h4><p>The picture below shows two inspectors opened on the same editor object: on the left, we see the contents of the editor from a user perspective; on the right, we see the internal structure of the elements tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oP5IbigBAQ7gb8uP8AMYiA.png" /><figcaption>The element tree behind a text editor. The words, whitespaces, cursor or arbitrary elements are part of the same tree.</figcaption></figure><p>There are a few of things to notice here. Each word and each space are elements. The red rectangle is part of the same tree. And, the cursor itself is part of the same tree, as well. As the entire editor is made of elements, the arrangement of these elements is expressed by a layout. A flow layout, in our case.</p><p>This organization offers a high degree of flexibility. One immediate application is that of adornments, dynamic artifacts that can appear in the text. In our example, the word “moldable” is colored in blue and uses a monospace font. Nowadays, these are typical abilities in a text editor, and they are supported through text attributes. In our case, the code looks like this:</p><pre>(text from: 5 to: 12)<br>  attributes: {<br>    <strong>BlFontFamilyAttribute</strong> named: &#39;Source Code Pro&#39;.<br>    <strong>BlTextForegroundAttribute</strong> paint: Color blue }</pre><p>Less obvious is that our editor treats the red rectangle as a text attribute, too:</p><pre>(text from: 39 to: 39)<br>  attributes: { <br>    <strong>BrTextAdornmentDynamicAttribute</strong> new <br>      beAppend;<br>      stencil: [ <br>        BlElement new <br>          size: 70 @ 50; <br>          margin: (BlInsets all: 5);<br>          background: Color red ] }</pre><p>We call these adornments, and they are just a specific kind of text attributes.</p><p>Armed with this, we can start playing with the text styler. A styler relies on a little process that goes through the text and augments it with various attributes. As adornments are attributes, the styler can augment the text with arbitrary visual elements, too. Let’s take a look.</p><p>Here we see a Coder editor opened on a Pharo method. The interesting thing about this is that all messages sent to self get a little triangle next to them. These triangles are added by the syntax highlighting, dynamically, as you type. When expanded, another editor appears inline showing the corresponding method.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j8L8lXxvjAzX6b8M8JI66A.png" /><figcaption>Coder on a method with messages expanded in place.</figcaption></figure><h3>New kind of programming interfaces</h3><p>This infrastructure makes possible all sorts of new interfaces.</p><p>Let’s start with the unfolding code editor from above. This is interesting in a couple of ways. First, we now get an interface that allows us to read code as a contiguous narrative. This means that we no longer have to choose between short methods and more “readable” code (This debate typically becomes apparent when people familiar with C-like programming languages start learning another language and get confused by the myriad of tiny methods. No more.).</p><p>But, it gets even more interesting when we combine this ability with knowledge about specific parts of the system. For example, below you can see a Coder opened on the baseline for Glamorous Toolkit itself. What’s a baseline? It’s a configuration describing what a project is made of and what its dependencies are, along the lines of Maven or npm. The baseline is written through a fluent interface provided by the Metacello library. As with any configuration, it relies on strings for pointing to the contained packages and the dependent projects. In our case, if the dependent project is already available in the image, we show a triangle that, when expanded, reveals the baseline of the respective project. This is a simple thing, but it simplifies creating these baselines significantly without requiring one to learn a new tool.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-Uj5f_tNoIgRb8Wr2Y_hg.png" /><figcaption>Coder on the baseline of Glamorous Toolkit showing some of the dependent projects expanded.</figcaption></figure><p>The expansion adornments also paved the way to reinventing documentation. For example, below we see a snippet from the Glamorous Toolkit documentation. The document contains text and a graph showing all dependencies of Glamorous Toolkit extracted automatically from the baseline. The more interesting part is that the graph is embedded in the document through a markup instruction. Furthermore, the markup appears only when the cursor gets closer to it. Essentially, we get a new class of editors that is in between editor+view and a WYSWIG (what you see is what you get) interface. We get the power of programmability through markups while still retaining direct manipulation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1Ck5kt6vbZLDaiIM-Z6UhQ.gif" /><figcaption>Documenter showing a document containing a diagram that is created dynamically based on a markup. The document relies on a markup that appears only when the cursor is nearby.</figcaption></figure><p>One more example is an interface for supporting explanations. In this case, the editor on the left has terms that are marked with special attributes through which we get elements that are inserted in the text and that are linked with the markers on the right when hovering over them. For this to work, the explanation word, the target anchor and the line must reside in the same rendering tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0hxAJnDdIIJSiI71GZ-ZA.gif" /><figcaption>A live explanation. The terms from the editor on the left are linked to the visual items on the right.</figcaption></figure><p>The same mechanism can be used to explain snippets of code. Here, the method on the right famously utilizes the entire syntax of Pharo. On the left, we have an explanation that links to the various parts. Interesting in this case is that the adornments in the code snippet are added through syntax highlighting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K4aowB6bQmjSrCq2yI62-Q.gif" /><figcaption>A live explanation of code. The explanation lines provide a natural connection between the explanation and the corresponding code piece. Furthermore, the links change live as the code changes.</figcaption></figure><h3>The annotated tree</h3><p>One rendering tree allows us to combine arbitrary elements in a graphical scene. But, there is one more thing. A typical approach to graphical user interfaces is to rely on higher level models that generate the actual rendering tree. Often these higher level models can be complicated and come as a layer on top of the base tree. This then hinders the creation of fluid interfaces because the higher level of abstractions usually can do less than the lower level ones.</p><p>We wanted one single space. One rendering tree to rule them all. Now, of course, we also want to be able to compose elements at higher level of abstractions. To accommodate this, we turned the problem around: we made the basic elements annotatable with higher level constructs.</p><p>For example, below we see on the left a scene with an inspector embedding a visualization. On the right, we see the rendering tree of that scene. Hovering over elements shows that they are all part of the same tree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N7V2tWa5IAGKqrdo5FFdXA.gif" /><figcaption>The tree on the right shows how the highlighted element on the left fits into the rendering tree.</figcaption></figure><p>The tree on the right also reveals some nodes as labelled. In our case, the labels are phlow and graph. These are annotations. Phlow is the engine for defining inspector views and workflows, while the graph is … well, a graph. So, what can we do with this?</p><p>For example, given an element, we can ask it for element graph connectedEdges. graph is a tiny object that knows the element and essentially extends the interface of the element with higher level predicates. Similarly, phlow offers predicates distinguishing whether an element defines things like a view title or a view content.</p><p>Following this pattern, we always rely on one single tree and we make it the responsibility of various libraries to enrich that tree. The outcome is that we can combine arbitrary abstractions rather seamlessly. For example, in our case, the root of the visualization is annotated with both graph and phlow it is also the content of the view.</p><h3>Before we part</h3><p>In the age of 3D games, AR/VR and smart physical environments, it is perhaps strange to talk about a 2D graphical engine. Still, our audience is fairly rooted in sitting in front of a desktop and working with rather antiquated interfaces. Our audience are programmers, and our goal is to reimagine the development experience.</p><p>Indeed, in this day and age, the typical development experience is dominated by text. In the rare cases when text is augmented with visuals, that augmentation happens on the outskirts. That’s because the editor is too special a box. To break this, we set to make the text be made of tiny regular elements. Along the same line, we also wanted visualizations to be first class citizens. So, we had to accommodate those too, and naively perhaps, we formulated the one rendering tree principle that we wanted to stick with at all times.</p><p>Of course, having a rendering tree is not new. Of course, there are text editors that are made of nice small elements. Of course, extensive visualization engines do exist. Still, having them all together in one cohesive and reasonably performant infrastructure is new. At least to us.</p><p>But, we think the real challenge is only yet to come. We have built a vehicle, but we believe the challenge lies in the uncharted territory.</p><p>Just consider this example again. The visualization is not confined to a compartment in a bentobox-like interface. Instead, it is the visualization that defines the frame for the widgets. And while there are visual boundaries around the editors and inspectors, they remain exactly that: visual. The logical connections are not affected and can cross those boundaries to create a seamless scene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_F-gKbNcoJLpLVdgEZ1BQ.png" /><figcaption>The visualization defines the frame and embeds rich widgets that can be visually and logically connected.</figcaption></figure><p>This is not a small change. This is an entirely new kind of interface. And this is but one example. We are still learning how to think about designing interfaces in this world, but the adventure does appear to be exciting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=918eae49bcff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/one-rendering-tree-918eae49bcff">One rendering tree</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The making of circular treemap in Glamorous Toolkit]]></title>
            <link>https://medium.com/feenk/the-making-of-circular-treemap-in-glamorous-toolkit-9a6881beea37?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a6881beea37</guid>
            <category><![CDATA[data-visualization]]></category>
            <category><![CDATA[moldable-development]]></category>
            <category><![CDATA[gtoolkit]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Mon, 24 Jun 2019 21:39:28 GMT</pubDate>
            <atom:updated>2019-06-25T06:15:23.791Z</atom:updated>
            <content:encoded><![CDATA[<h4>A story of moldable development</h4><p>Nested data structures are ubiquitous in software. Packages, classes and methods are nested. Folders and files are nested. XML elements are nested. Treemaps are useful to highlight occurrences in such nested structures, and they should not miss from a development environment.</p><p>Glamorous Toolkit offers treemaps, too. This is a behind-the-scene story of how we constructed this algorithm. The story both sheds a light on how we approach moldable development when we develop Glamorous Toolkit, and it offers an insight on how and why we split the larger logic into smaller parts that can be used for other purposes as well.</p><p><em>An impatient reader might want to skim through the pictures and read the conclusion.</em></p><p>Let’s start from a concrete application of a circular treemap. Here is an inspector with a view highlighting some classes and packages from a Java system. The data comes from a Famix model that represents code written in various languages. The code to the right specifies the inspector view with the concrete visualization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WAj_WT5XDBmEgC4Ts4-zJg.png" /><figcaption>A circular treemap example embedded in the Inspector.</figcaption></figure><p>This treemap is implemented as an element stencil — a factory of elements — that allows us to specify several things:</p><ul><li>the traversal of the container nodes,</li><li>the computation of the leaf nodes,</li><li>the computation of the size of the leaf nodes,</li><li>the specification of the container ellipse element, and</li><li>the specification of the leaf ellipse element.</li></ul><p>Furthermore, each container applies a circle packing layout. The circle packing algorithm is based on <a href="https://dl.acm.org/citation.cfm?id=1124851">“Visualization of large hierarchical data by circle packing” by Wang etal</a>. This is a non-trivial layout whose computation relies on several sub-algorithms. Luckily, the paper nicely describes the different parts of the algorithm. Let’s dive a little to see what’s there.</p><p>Circle packing applied on a set of elements looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*59uqLqF6jbwypOmZjZll4g.png" /><figcaption>Using the circle packing layout.</figcaption></figure><p>To make this work, we first need to find the enclosure around given circles. We then need to identify where to add a new circle to a given enclosure. And for that, we need to compute the actual position of a new circle.</p><p>The paper comes with nice visual depictions describing the algorithm details. For example, here is a figure explaining how to calculate the outside chain of circles, called front-chain:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*H_C-UUM4VCmqyZMKZYHPDA.png" /><figcaption>A figure from <a href="https://dl.acm.org/citation.cfm?id=1124851">“Visualization of large hierarchical data by circle packing” by Wang etal</a> depicting the algorithm for determining the so called front-chain.</figcaption></figure><p>This algorithm is reasonably laborious and it is found inside the overall layout computation. While the paper does provide a description of the algorithm, translating it into code can still be tricky. To debug our way through the implementation, we wanted to bring the depiction from the paper into our environment. Certainly, this is what moldability should be about, and an inspector extension would be an ideal place to park this depiction.</p><p>To make this happen, we needed an explicit class. Thus, we reified the front-chain into its own dedicated class and a dozen lines later, the view materialized, too. Armed with this view, we could then step through the algorithm and see the result visually during debugging.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qgIiEundJ3ii0JF6M2IaFQ.png" /><figcaption>Visualizing the current front-chain in the current stage of the layout computation.</figcaption></figure><p>The two final pieces of the circle packing puzzle are finding the location of a new circle in the neighborhood of circles and determining the enclosure of given circles. Inspector extensions to the rescue! In this case, too, we first reify the neighborhood and the enclosure as first class entities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GCpUyR-gXQvLavND0R3niA.png" /><figcaption>Inspecting the neighborhood and the enclosure of given circles.</figcaption></figure><p>Taking a step back, there are a couple of things to notice. The algorithm has multiple layers of abstraction: At first, we have the recursive definition of the treemap. Then is the circle packing layout which, in its turn, is based on computing the enclosure of given circles, on identifying where to add a new circle, and on actually computing the location of the new circle. All these are separate pieces that can be used independently.</p><p>Having a multi-layered algorithm is not unusual. What is less usual is that all layers are exemplified and are inspectable through custom views. When following moldable development, these custom views are natural byproducts.</p><blockquote>The first rule of thumb is that if we need to look at the raw view of an object type more than three times, we are likely missing a custom view. So, we build one.</blockquote><blockquote>The second rule of thumb is that before solving a problem, we first depict it in a way that makes the solution evident.</blockquote><p>This process is orthogonal to the typical test or <a href="https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920">example-driven development</a>. For example, the circles enclosure is mainly a collection of circles. Yet, because we wanted to have a specific view, we ended up promoting it to a first class entity even though from a functional perspective, everything remained the same.</p><blockquote>Thinking of custom views exercises the design in a way that testing does not. While writing tests during development builds testability into the system, guiding the design through custom views builds explainability into the system.</blockquote><p>For example, while working on the algorithm, we had to deal with a bug when computing the enclosure of specific nodes. We noticed the issue in a larger treemap, and narrowed it down to a smaller case involving three nodes. The view below shows that the blue enclosure circle on the right is not the minimal circle we can draw.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cuZKd84ruo38e6hbnN6QCg.png" /><figcaption>The dedicated view reveals a bug: the enclosure (in blue) is not minimal.</figcaption></figure><p>The screenshot documented <a href="https://github.com/feenkcom/gtoolkit/issues/348">the bug report</a>. Having the view around helped us locate the problem quickly and write a failing example for it. The solution came soon afterwards.</p><p>It is hard to convey the impact on the development experience of these custom views. It’s not unlike the testing: you have to practice it to fully appreciate it; and the more you practice it, the more pleasant the experience becomes. Like with testing, it’s counter-intuitive: building a view is a meta step that apparently distracts from the direct task at hand. Yet, building that view helps us make explicit what is important to explain and this leads to better design.</p><p>Custom views also help us tell others what is important. There is great power in being able to convey a problem about a detail deep inside a system through a single picture that requires little explanation. The pictures from the paper were deemed meaningful for communication purposes. Like the drawings on the whiteboard these picture are important in that they capture an intent. Yet, these pictures should only be drawn manually when the system does not exist. When the system does exist, the picture should never be drawn by hand. The system should draw it for us.</p><blockquote>When a presentation is deemed meaningful by at least one person, it is the responsibility of the system to carry it forward. Only like this will our systems become explainable.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a6881beea37" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/the-making-of-circular-treemap-in-glamorous-toolkit-9a6881beea37">The making of circular treemap in Glamorous Toolkit</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Glamorous Toolkit v0.6.42]]></title>
            <link>https://medium.com/feenk/glamorous-toolkit-v0-6-42-35edb7f6d848?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/35edb7f6d848</guid>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[development-environment]]></category>
            <category><![CDATA[parsing]]></category>
            <category><![CDATA[gtoolkit]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Fri, 19 Apr 2019 05:55:55 GMT</pubDate>
            <atom:updated>2019-04-19T05:55:55.577Z</atom:updated>
            <content:encoded><![CDATA[<h4>New native windows backend. Class Coder. Extended parsing support.</h4><p><a href="https://gtoolkit.com">Glamorous Toolkit</a> v.0.6.42 brings with it a new native window backend for Mac, an initial Class Coder, extended parsing support, stability throughout the board and in particular in the debugging department, and a few other things.</p><h4>New native window support</h4><p>The initial native window support we announced two months ago felt great both due to separate windows and due to the retina display support. So, we went further and explored a new solution based on the <a href="https://github.com/tomaka/glutin">Glutin library</a>. Beside proving to be more stable, it also brings new abilities such as the possibility of having transparent windows.</p><h3>feenk on Twitter</h3><p>Is this #gtoolkit rendering in a transparent native window?</p><p>It currently works reliably on Mac.</p><h4>Coder</h4><p>For most of the existence of the Glamorous Toolkit project, the prominent part was the moldable way to view software. Over the past few months we worked intensively on applying the same principles on the way to create software, too. We call the overall project Coder.</p><p>Coder is made of multiple pieces, some of which have been seen before. At the core, we have the Source Coder, with several flavors including the Method Coder for editing a single method. These pieces can then be assembled in larger pieces such as a query tool:</p><p><a href="https://medium.com/feenk/pervasive-code-queries-in-the-ide-e0a23858e3a1">Pervasive code queries in the IDE</a></p><p>or a Class Coder. For example, below we see such a Coder opened on the GtMethodCoder class: on top you see a pane-based navigation view which can hidden or changed to a tree representation, and below we see a Class Coder for the selected class made of multiple Method Coders.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2OHPWty-86Gxa5T1nEWkBQ.png" /><figcaption>A Class Coder showing the pane-based navigation and nested methods.</figcaption></figure><p>As we are still in an alpha state, the concrete interface of the Coder is still under development, but this initial effort already shows that we are close to providing a complete development experience.</p><h4>Expanded parsing support</h4><p>Glamorous Toolkit ships with two distinct parsing technologies. Why? Because of two reasons. First, parsing needs are pervasive during development, and developers deserve more than just regex. Second, Glamorous Toolkit is a platform with which to construct system specific environments, and this also implies dealing with multiple languages.</p><p><a href="https://github.com/j-brant/SmaCC">SmaCC</a>, the Smalltalk Compiler-Compiler originally developed by <a href="http://refactoryworkers.com">John Brant</a>, received new browsing and debugging support. SmaCC relies on its own language to express the parser productions, and the productions can also be extended with Pharo code. To this end, we worked on producing an editing experience similar to the one of the Class Coder. This is quite relevant in that it shows we can now edit a second language with the same experience as the one for Pharo.</p><h3>feenk on Twitter</h3><p>Working on a coder dedicated for the SmaCC parsing framework. #gtoolkit</p><p>And, we went ahead and spent some time on making debugging SmaCC parsers more accessible … and fun. So, now you can test a specific production against a input string and see the matching productions unfolding live.</p><h3>feenk on Twitter</h3><p>When building a non-trivial parser, a good deal of time is spent on debugging. To make things smoother, you can now test a SmaCC production against a specific input and see the matching sub-productions live. #gtoolkit https://t.co/oqqVqQ6Bl4</p><p><a href="https://github.com/kursjan/petitparser2">PetitParser2</a>, developed by <a href="https://www.linkedin.com/in/jankurs/">Jan Kurš</a> , is the second parsing engine that we ship in Glamorous Toolkit (this is the second incarnation of the original PetitParser built by <a href="https://www.lukas-renggli.ch">Lukas Renggli</a>). Why two engines? They are simply useful in different contexts. While SmaCC provides support for creating static parsers, PetitParser offers the possibility of defining dynamic parsers.</p><p>In this case, too, we wanted to have explicit support in the development environment. As a parser is expressed as Pharo code, we molded Coder to adapt to the specifics of PetitParser. In particular, PP2CompositeNode, the typical root class to inherit from when defining a custom parser, defines a caching mechanism: a parser is created in a method, and automagically cached in an instance variable with the same name. In this way, the programmer only has to define a sub-parser in a method and refer to that sub-parser through the instance variable and the magic does the rest. So, Coder makes the references to those instance variables expand to reveal the implementing method:</p><h3>feenk on Twitter</h3><p>Editing code must be context sensitive. So, we made Coder moldable, too. Eg: when browsing a class defining a PetitParser parser, a reference to an instance variable unfolds the method with the same name. This happens only when working with the PetitParser engine. #gtoolkit</p><p>We also extended the inspector with dedicated views. For example, below we have a new browser of a parser that complements a graphical notation with quick navigation.</p><h3>feenk on Twitter</h3><p>Parsing is one of those areas that is met with respect ... if not downright fear. So, we thought of making it more playful. Here is an exploration of the structure of an expression grammar built with PetitParser2, one of the two parsing engines shipping with #gtoolkit. https://t.co/xkl4l2zoWt</p><h4>Profiling from Playground</h4><p>On another note, we also added an initial support for profiling code right in the Playground. It’s implemented as a set of inspector extensions over the existing MessageTally infrastructure.</p><h3>feenk on Twitter</h3><p>The #gtoolkit Playground allows you to profile the code right in place. Add to that a couple of inspector views and we get an interactive profiling tool seamlessly integrated in the environment.</p><h4>Improved text and documentation look</h4><p>We worked on the fonts we use and on how we use them.</p><h3>feenk on Twitter</h3><p>Working on better font handling in documents. #gtoolkit</p><p>And on refining Documenter. Because details matter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cWte46I5RORwONj2SG1DPw.png" /></figure><p>A more detailed list of changes can be found at: <a href="http://A more detailed list of changes can be found at: https://github.com/feenkcom/gtoolkit/milestone/4?closed=1">https://github.com/feenkcom/gtoolkit/milestone/4?closed=1</a></p><p>Have fun,</p><p><a href="https://feenk.com">The feenk team</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=35edb7f6d848" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/glamorous-toolkit-v0-6-42-35edb7f6d848">Glamorous Toolkit v0.6.42</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pervasive code queries in the IDE]]></title>
            <link>https://medium.com/feenk/pervasive-code-queries-in-the-ide-e0a23858e3a1?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/e0a23858e3a1</guid>
            <category><![CDATA[code-analysis]]></category>
            <category><![CDATA[gtoolkit]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[development-tools]]></category>
            <category><![CDATA[development-environment]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Wed, 06 Mar 2019 15:54:53 GMT</pubDate>
            <atom:updated>2019-03-06T15:54:53.094Z</atom:updated>
            <content:encoded><![CDATA[<h4>Elegant and accessible code queries with the Glamorous Toolkit</h4><p>Search is a pervasive need in software development. Yet, the typical IDE rarely goes beyond a regular expression queries. We must do better than that.</p><p>One of the design principles behind <a href="https://gtoolkit.com/#design">Glamorous Toolkit</a> is that search must be pervasive. It sounds grandiose, but once you setup to do it, it’s actually pretty straightforward.</p><p>Let’s start with an example: a search for all methods that are annotated with &lt;gtView&gt; and that reference the class GtMethodCoder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EGlhyypoO7S9PeparVUtYg.png" /></figure><p>How was this realized? On the left, we actually have a Playground with a code query:</p><pre>#gtView gtPragmas &amp; GtMethodCoder gtReferences</pre><p>Executing the query opens an inspector on the result of the query which, in this case, is an instance of GtSearchIntersectionFilter. The filter instance knows how to present itself through a view through which the inspector diligently shows method widgets. Beside showing the method code, these method widgets also know how to match the input query to the abstract syntax tree (AST) nodes to produce the orange highlighting.</p><p>That’s it. That’s the whole tool. In fact, it’s not a tool. It’s an idea molded systematically into the environment.</p><p>But, wait. There is more. The query language is not a special language either. It’s plain Pharo. This means we can also take the result of the first query and refine it with another one:</p><pre>self &amp; #gtSourceFor: gtImplementors</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugBYB3aLTCaCEz4n3iMqxQ.png" /></figure><p>Essentially, we have an explicit composition of filters. This approach makes the query “language” easily extensible. There already exists a number of predicates readily available.</p><p>The diagram below shows the class hierarchy for the current set of available filters. This is a visualization provided by Glamorous Toolkit live in the environment to help newcomers learn about the different filters they can use and how to extend the library with their own filters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rXTZK4ABOmJWqP6rP4Ae2Q.png" /><figcaption>The SearchFilter class hierarchy in Glamorous Toolkit. The diagram is offered live by Glamorous Toolkit to help newcomers understand and extend the filtering logic. As a side note, the embedded editors are actually live and can be used in place to modify the code.</figcaption></figure><p>The concrete visualization shows the implementation of the ImplementorsFilter. The matches: hook method checks that the queried object is a method, and includesMethod: checks whether the selector of the queries method matches the filter.</p><p>Ok, but wait. All these classes look like small command wrappers around the existing model provided by Pharo. Why the aggravation? Why not just use the Pharo directly?</p><p>The main reason is to gain declarativeness and the tool support that can come with it. For example, note how when we search, the concrete appearance in the code is highlighted, and how this works even when we have a composite query.</p><p>And it is possible to combine a declarative query with Pharo code. For example something like this:</p><pre>#gtExample gtPragmas select: [ :method | method package name beginsWith: &#39;GToolkit&#39;]</pre><p>This would provide all the example methods (Oh, what are examples? <a href="https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920">Check this introductory article out</a>) from packages starting with GToolkit. Such a query will not highlight the package name, but it has the advantage of offering quick prototyping.</p><p>Approached like this, search is not a feature. It’s a deep capability. Consequently, you should not judge it by measuring the directly supported use cases, but rather by the new kinds of scenarios that it enables.</p><p>Talking about scenarios, here is a short story.</p><p>In Pharo, there are a couple of special literals that are handled specially by the virtual machine. They are -1, 0, 1, 2, nil, true, and false. Not too long ago, we had to explore the impact of changing these. So, we queried for them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ty2VNCCQKZACuOK6wBYD4g.png" /></figure><p>It turns out that there are four places in the system that hardcode these values, and one of them does not do it as a literal array, but explicitly creates an array object. The query elegantly found and highlighted all of them.</p><p>So, in our environment, code search is available everywhere we can evaluate code. That is already something, but to make the story round we would need to complement it with the editing experience. And, indeed, the editors we see in the filter view are actually live editors!</p><p>With a simple twist, the Playground and the Inspector just became scoped code Editors. There are no tooling silos in a software environment.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0a23858e3a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/pervasive-code-queries-in-the-ide-e0a23858e3a1">Pervasive code queries in the IDE</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[An example of example-driven development]]></title>
            <link>https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920?source=rss-17bdde4363f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/4dea0d995920</guid>
            <category><![CDATA[tdd]]></category>
            <category><![CDATA[gtoolkit]]></category>
            <category><![CDATA[test-driven-development]]></category>
            <category><![CDATA[visualization]]></category>
            <category><![CDATA[moldable-development]]></category>
            <dc:creator><![CDATA[Tudor Girba]]></dc:creator>
            <pubDate>Thu, 14 Feb 2019 16:59:57 GMT</pubDate>
            <atom:updated>2019-02-14T17:00:38.456Z</atom:updated>
            <content:encoded><![CDATA[<p>This is an example of example-driven development using <a href="https://gtoolkit.com">Glamorous Toolkit</a>. The concrete code snippets are written in <a href="https://pharo.org">Pharo</a>.</p><h3>Examples vs. tests</h3><p>Example-driven development is somewhat similar to test-driven development, but it differs both in how examples are expressed and composed, and in how examples are utilized both for testing and for documentation purposes.</p><p>Let us start from a concrete scenario of modeling a price to fulfill these requirements:</p><pre>A price can be something like 100 EUR.<br>Prices can be added or multiplied.<br>A price can also be discounted either by a fix amount of money, or by a percentage.<br>All operations can be combined arbitrarily.<br>And for audit purposes, we want to track all operations that lead to a concrete amount of money.</pre><p>A possible design can look as follows. We have aPrice abstract concept that knows how to provide the price money, where money is an object that can hold something like 100 EUR . A ConcretePrice knows the concrete money, and this can be decorated in several ways, including PriceDiscountedByMoney, PriceDiscountedByPercentage, or even SummedPrice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dFCnWkUvyZGE4ZaLXQNOBQ.png" /><figcaption>A possible object-oriented design for prices.</figcaption></figure><p>A simple SUnit test could look like this:</p><pre>PriceTests&gt;&gt;testConcretePrice<br>  | price |<br>  price := 100 EUR asPrice.<br>  self assert: price = 100 EUR asPrice.</pre><p>In this case, 100 EUR is a Money object that can understand asPrice to return a ConcretePrice. A more complicated test could look as follows:</p><pre>PriceTests&gt;&gt;testDiscountedByMoney<br>  | price |<br>  price := 100 EUR asPrice discountedBy: 10 EUR.<br>  self assert: price = 90 EUR asPrice</pre><p>And yet more complicated:</p><pre>PriceTests&gt;&gt;testDiscountedByMoneyAndDiscountedByPercentage<br>  | price |<br>  price := (100 EUR asPrice discountedBy: 10 EUR) discountedBy: 10 percent.<br>  self assert: price = 81 EUR asPrice</pre><p>Ok, these are tests. In all three cases we setup an interesting object, we trigger a behavior, and we assert an expected outcome.</p><p>So, what’s an example then? An example is like a test, only it returns an object. You see, if we go through the trouble of creating an object, we might as well use that object for other purposes. So, our concrete price example would look like this:</p><pre>PriceExamples&gt;&gt;concretePrice<br>  <strong>&lt;gtExample&gt;</strong><br>  | price |<br>  price := 100 EUR asPrice.<br>  self assert: price = 100 EUR asPrice.<br>  <strong>^ price</strong></pre><p>The example method is annotated with &lt;gtExample&gt;, and it returns an interesting object, which in our case is price. And now we can build on top of this example:</p><pre>PriceExamples&gt;&gt;discountedByMoney<br> &lt;gtExample&gt;<br> | price discountedPrice |<br> price := <strong>self concretePrice</strong>.<br> discountedPrice := price discountedBy: 10 EUR.<br> self assert: discountedPrice = 90 EUR asPrice.<br> ^ discountedPrice</pre><p>and:</p><pre>PriceExamples&gt;&gt;discountedByMoneyAndDiscountedByPercentage<br> &lt;gtExample&gt;<br> | price discountedPrice |<br> price := <strong>self discountedByMoney</strong>.<br> discountedPrice := price discountedBy: 10 percent. <br> self assert: discountedPrice = 81 EUR asPrice.<br> ^ discountedPrice</pre><p>All in all, what we can express in tests we can also express through examples. Similar to tests, examples can be independently assertable. But, unlike tests, examples can be explicitly composed of arbitrary other examples, and the composition can be arbitrarily nested. One implication of this explicit composition is that we can order examples, and when multiple examples fail, we can point out to the most specific failure. For example, if in our case, the concretePrice example would fail, the other two examples would fail as well. However, when presenting the results, we can easily point to the root problem exposed in concretePrice.</p><blockquote>Similar to tests, examples can be independently assertable. But, unlike tests, examples can be composed of arbitrary other examples.</blockquote><h3>Beyond tests</h3><p>In a typical test-driven development scenario, a test is interesting as long as it fails. That can happen both at the beginning when we write first the test and there is no code, and when a regression occurs. As soon as the test succeeds, it is no longer utilized outside of checking for regressions.</p><blockquote>An example that passes its assertions represents a new opportunity for prototyping, for constructing new examples, for supporting software assessment or for documentation.</blockquote><h3>Enhancing examples through the development environment</h3><p>Let’s go back to our scenario, and let’s suppose that we do not know how the price logic is internally implemented. We can look at the code, but at the same time we can also look at examples of concrete objects.</p><p>First, if we look at the code of an example, the environment allows us to unfold the code of the other examples used so that we can understand how the larger object is statically created. In our case, we have the concretePrice that was first discountedByMoney and was finally discountedBy: 10 percent.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sbjNSx4eorA9inCcMVgthg.png" /><figcaption>The environment takes advantage of fine-grained example nesting and helps us understand how the larger example is statically composed out of the smaller ones.</figcaption></figure><p>Running the example, gives us the resulting PriceDiscountedByPercentage instance that we can inspect in details. We see that it relates to an original price of 90.00 EUR which, when inspected reveals that it is a PriceDiscountedByMoney instance with an original price of 100.00 EUR.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Br8zwwt4uL095_z7UwprRg.png" /><figcaption>Executing the example allows us to inspect the resulting object.</figcaption></figure><p>But, we can go a step further. Glamorous Toolkit is a moldable environment which means that any fact about our system can be represented in multiple ways. In our case, it would be great to see the nesting of the price operations and see the intermediate results as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vGzBJR-SxW25S1FNKR25uQ.png" /><figcaption>The Inspector offering a custom view for understanding how price operations are nested.</figcaption></figure><p>The view from above costed a few dozen lines of code. It’s like printing a string, only it‘s much richer. The power of this view comes precisely from being hand-crafted to reveal the specific design of our objects.</p><p>When combined with this view, the value of our example has soared because it is now directly useful as an assessment tool. For example, take a look at the example below showing a couple of other operations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owjdvs3i-OpkHCKFfemn7g.png" /><figcaption>Inspecting a complicated price involving multiple operations.</figcaption></figure><p>Could you get an idea of the inner workings of how the inspected price object is structured internally? How does it feel?</p><h3>Examples as exploration starting points</h3><p>Exploration and prototyping are forms of feedback. Existing examples provide basic pieces that can be assembled quickly into new ones. For example, below we see a Playground in which we take two existing example objects and create a new one that we can explore.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vr5CiHIboSUiGE5t1rqNCg.png" /><figcaption>Combining example objects into a new one in Playground and exploring the result in the Inspector.</figcaption></figure><h3>Examples as units of documentation</h3><p>Once we get inspector views that can tell interesting stories about our example objects, it’s only natural to want to combine those views into broader narratives. For example, below we can see a live document edited in Documenter in which we add live our discount example, and can trigger the preview right in place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6Jdas2jEMeVwZ3hfYFk6WQ.gif" /><figcaption>Adding an example to a live document created in Documenter.</figcaption></figure><p>There are at least two things we can take away from this. First, the cost of assembling interesting documentation is marginal once the examples exist. Second, as there is no copy pasting of code, the documentation is both testable and maintainable.</p><h3>Why call them examples</h3><p>Let’s look at this again:</p><pre>PriceExamples&gt;&gt;concretePrice<br>  <strong>&lt;gtExample&gt;</strong><br>  | price |<br>  price := 100 EUR asPrice.<br>  self assert: price = 100 EUR.<br>  <strong>^ price</strong></pre><p>On the one hand, executing the code gives us a valid object which acts as an example of all possible valid objects. One the other hand, the code itself exemplifies both how to construct the object, and what concrete contract that object adheres to. In other words, both the result and the code that produces the result can be seen as examples. Hence the name.</p><blockquote>Examples offer a simple and direct model of composition that lends itself well both for supporting testing and for enabling prototyping. And when combined with a moldable development environment, examples also serve as units of documentation.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dea0d995920" width="1" height="1" alt=""><hr><p><a href="https://medium.com/feenk/an-example-of-example-driven-development-4dea0d995920">An example of example-driven development</a> was originally published in <a href="https://medium.com/feenk">feenk</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>