Desktop Applications

Summarized using AI

The Return of Shoes

Steve Klabnik • August 11, 2011 • Earth

The video titled "The Return of Shoes" features a talk by Steve Klabnik at the LoneStarRuby Conf 2011, where he discusses the Ruby GUI toolkit, Shoes, originally created by _why the lucky stiff. Klabnik presents the talk in three parts, focusing on the significance of Shoes and its future in the Ruby community, while also sharing personal anecdotes about his journey with the project.

Key Points Discussed:
- Introduction to Shoes: Klabnik explains that Shoes is a unique GUI toolkit that is purely developed in Ruby, differentiating itself from others that rely on bindings to C-based libraries. It allows developers to create desktop applications with an easy-to-use syntax that leverages Ruby’s features.
- Ten Features of Shoes: He outlines the 'Ten Gifts of Shoes' which include fundamental elements like paragraphs (para), buttons, stacks, flows, and backgrounds. These features exemplify the simplicity and intuitiveness of the toolkit compared to traditional GUI systems.
- Technical Demonstration: Klabnik describes how to create a simple GUI application using Shoes, demonstrating how easy it is to implement actions like creating buttons, handling images, and defining application layouts via combinations of stacks and flows.
- Community and Contributions: Emphasizing the importance of community involvement, Klabnik shares his experiences in maintaining Shoes after _why’s departure, including the challenges he faced due to a lack of contributors. He highlights initiatives like Travis CI to facilitate better collaboration and continual integration in development.
- Reflections on _why: Klabnik reflects on _why's contributions and artistry in programming, describing Shoes as both an interface and a concept that transcends typical coding practices, promoting a connection to the Ruby community’s ethos.
- Future Vision and Challenges: He expresses hope for the future of Shoes, addressing issues like infrequent updates, compatibility with Ruby versions, and a desire for more Rubyists to engage with lower-level languages like C.
- Conclusion: Klabnik concludes by encouraging new developers in the Ruby community to explore Shoes and Hackity Hack, emphasizing the importance of a supportive and collaborative programming culture that celebrates contributions from all members.

Ultimately, Klabnik's talk endeavors to inspire continued engagement with Shoes and foster a healthy community atmosphere within the Ruby programming landscape, creating a space where beginners can thrive and veterans can share knowledge.

The Return of Shoes
Steve Klabnik • August 11, 2011 • Earth

Everyone talks about writing web applications with Ruby, but it's great for applications of any kind. Shoes is a project that was started by _why the lucky stiff, and when he left, a plucky community of developers kept it alive. If you've never worked with Shoes, it's the only Ruby GUI toolkit that is truly Ruby, and not just a binding to another project, like QT or tk. It uses Ruby-only features like blocks heavily, and works on all three platforms. In this talk, Steve will do a small introduction to developing desktop apps with Shoes, talk about the challenges of maintaining a large polyglot project with an absent creator, and where Shoes is going in the future, as well as how you can get involved.

Help us caption & translate this video!

http://amara.org/v/FG9i/

LoneStarRuby Conf 2011

00:00:20.240 Hey everybody, I'm Steve. This talk is called 'The Return of Shoes.' It's sort of a talk in three parts, and if you don't know me personally, I tend to wear my heart on my sleeve. This talk means a lot to me, and the end of it is a little personal, so I love you guys, but just get ready for that.
00:00:39.200 Shoes is a project, if you didn't know, that was originally written by _why the lucky stiff. When he left the Ruby community a couple of years ago, I wasn't sure if I was ready to help out with an open source project or not, so I decided to help out whoever picked Hackity Hack because I really believe in Hackity Hack's mission. I care a lot about Hackity Hack, which is the largest Shoes application used to teach new people how to program in Ruby.
00:01:08.240 Twelve hours went by, and while somebody said, 'I'll take over HBR,' 'Cot,' and work on Shoes, nobody stepped up for Hackity, and I decided that it was time to put my money where my mouth was. If I really did believe in it, I had to continue working on it. By extension, I'm now also basically the developer of Shoes, as I'm using it as my dependency. So I'm giving this talk because I love Shoes, and originally, I came to it through Hackity Hack.
00:01:31.600 While Hackity Hack is great and I believe in its social mission, I think that Shoes is really important for Ruby. I want to make sure everybody knows about Shoes, that it's still alive, and what's going on with this project. That's what I came to share with you guys today. The first part of this talk is a tech demo.
00:02:02.640 So what is Shoes? This presentation includes something that I shamelessly stole from _why's book on Shoes. It's called 'The Ten Gifts of Shoes.' This is a rundown of ten features of Shoes itself, and like I said, it's from _why's book. One of the difficulties about taking over someone else's project, especially after they've gone, is respecting their vision while also making it your own.
00:02:20.080 It took me a long time personally to be okay with using what _why built while also calling it my work, especially when emotionally investing myself in something he created. So just to clarify, all of these images are done by _why, not by me, but I thought it was appropriate to get that out of the way.
00:02:46.080 So, the ten features of Shoes: para, stacks and flows, buttons, images, edit line, links, backgrounds, URLs, and clear. This is the overview of the top ten things you need to know. Shoes is a GUI toolkit. The most basic thing is the paragraph. This small bit of code will actually create a window with that paragraph on it.
00:03:03.760 The reason I love Shoes specifically as a GUI toolkit is because it utilizes Ruby features differently. A lot of other GUI toolkits are stuck in designs from the '80s where they build Qt and GTK based on C, which means that many wrappers for those toolkits require you to program Qt Ruby like you would program Qt in C++. Shoes is the only GUI toolkit that truly adopts Ruby. It makes heavy use of blocks because blocks are callbacks, which is beneficial for UI code.
00:03:41.840 To create paragraphs is super simple; you just say 'para' with a string. Stacks and flows are how you do layout. A stack will make elements go from top to bottom, while flows will arrange them from left to right. By combining these two elements, you can build pretty much any kind of GUI you want. The original iteration of Shoes was an embedded version of Gecko, which means it feels pretty web-based, similar to how divs work. This helps you create GUIs in an easier way than primitive languages.
00:04:23.600 Buttons are fantastic too; you say 'button' and then pass in a title and block to define what happens when the button is clicked. This simplicity extends to showing alert boxes where you use 'alert' and give it a string. Images also work easily — you simply state 'image' with the path of the file and its position. Shoes allows you to display images from a URL or locally, aiming for simplicity.
00:05:00.800 To create a textbox, you say 'edit line' and then assign it to a variable that you can manipulate later. You can even link images to actions, such as opening browsers. One of the amazing features of Shoes is working with backgrounds — you can make backgrounds with colors, gradients, or pictures. To create a gradient, you simply pass a list of hex colors; it’s that straightforward.
00:05:54.080 When I was doing some Qt work recently, I found that creating a gradient in Shoes only took a single line, whereas in Qt Ruby, it required over 26 lines of code. There, you have to instantiate a gradient object and specify all kinds of parameters. Shoes aims to be simple, allowing you to focus on what you need to achieve.
00:06:43.360 Another innovative concept in Shoes is the use of URLs, enabling mapping named paths to screens. For instance, a small Shoes application could display lists of books, and navigation works by clicking links that direct you to different URLs. This makes it simple, borrowing web concepts into desktop applications.
00:07:01.440 The final feature I want to highlight is 'clear,' which allows for manipulating objects in a jQuery-like fashion, enabling you to add or replace things within a stack or a flow. Additionally, Shoes builds natively on the tools and GUI elements for each platform. For example, on macOS, you get native widgets, on Windows, you receive native Windows widgets, and on Linux, you have GTK, which is as native as it gets.
00:07:52.000 As an example of a more feature-complete Shoes app, there's a project called Shoes Contrib, where people share small Shoes projects. We created a file browser to enable users to browse and run little sub-Shoes programs within the project. It incorporates a stack and a flow, where you can select a category, and a list populates based on that choice while updating dynamically.
00:08:28.080 I can show you a live demonstration of this in action. Here’s the browser running. You can pick categories like 'Art' and see visual modifications right in the application. This shows how Shoes is all about simplicity and ease of use while maintaining the native experience across platforms.
00:09:13.840 So now you know what Shoes is about. It’s the first GUI toolkit I didn’t hate using. All the challenges typically found in GUI development are minimized with Shoes. It comes with its own set of unique challenges too, as learning to do things in this new way means adopting different design patterns.
00:09:43.680 What's truly awesome about Shoes, in addition to what I showed you, is that it’s the first GUI toolkit I've used that doesn’t suck. It's fun to use and it's simple, which makes it very much aligned with what you would expect from Ruby compared to other languages.
00:10:07.440 The beautiful thing about Shoes is that it’s an interface and not an implementation. One of the main contributors to Shoes has been spending the last year writing 'Green Shoes,' a re-implementation of the Shoes API in pure Ruby that binds directly to libgtk. The value in Shoes is not just the code _why wrote — it's also about the interface.
00:10:52.960 We’re working on multiple backends for Shoes, each with slightly different features. For instance, Green Shoes has some capabilities that Red Shoes, the classic implementation, does not have and vice versa, but both provide that same core interface. This allows you to move applications easily between different versions.
00:11:37.760 Shoes runs cross-platform: on Mac, Windows, and Linux, providing excellent packaging support. It allows for building executable files for all three operating systems without hassle. You simply tell it to package your Shoes app, and it does the rest.
00:12:14.080 However, there are a few downsides to Shoes as well. Despite all the great features, I'm essentially the only person who has been developing Shoes for the last two years. While another core team member has been focusing on Green Shoes, the rest of the community has largely stopped contributing.
00:12:49.440 This lack of contributors leads to various problems, such as difficulty managing platform differences. For instance, when I mention supporting all versions of different operating systems (Windows XP, Vista, 7, macOS Leopard, Lion, etc.), it turns into a daunting task to avoid regressions.
00:13:38.560 Maintaining and testing on all these platforms requires knowledge about the intricacies of each one. This is a considerable burden, and as I work on Shoes full-time now, I hope to address these challenges.
00:14:33.760 One of the proactive measures I'm taking is to assist other open-source projects. I firmly believe in the value of collaboration and continuously helping people. Recently, I've been focusing on adopting Travis CI, a continuous integration service, which will enable me to work with various platforms.
00:15:05.440 Using Travis CI gives developers ease of integration, and I’m working with them to set up macOS and Windows environments to manage builds better. This means everyone in the Ruby community will benefit from testing their code on multiple platforms.
00:15:51.200 The challenges of Shoes don’t end there. The infrequency of releases has become a concern as Shoes only released version 3 on _why day last year. We haven’t planned another release for this year, so the sparse updates can be problematic.
00:16:27.840 Also, most of Shoes is implemented in C, which can be a hurdle when recruiting Ruby developers who often prefer high-level languages like Ruby. While I love writing in C and feel comfortable with it, finding contributors who share this enthusiasm can be challenging.
00:17:12.800 Despite the difficulties, I've learned significantly from working on Shoes, especially about MRI and the Ruby source code. However, I'd like to see more Rubyists perceive the potential benefits of engaging with C.
00:17:58.720 This project can, however inadvertently, foster a sense of software archaeology as I work through _why's original code. Although I never met him, I feel connected to _why through the code I read—the way he approached problem-solving and built his work.
00:18:28.560 When I describe _why as an artist whose medium was source code, it’s not just a metaphor; I truly believe production code can be a form of art. However, I diverge from his perspective on automated testing and feel quite strongly about its importance in building reliable software.
00:19:05.520 Gregory Brown's discussion on testing and some comments there sparked a much deeper thought on how the community views testing. I believe there should be a balance between _why’s approach and ensuring Shoes transitions into being reliable software.
00:19:51.360 Currently, Shoes has a different goal and vision compared to _why’s original intentions. My aim is to make Shoes the default way people write GUI apps in Ruby, transitioning away from older toolkits like Tk.
00:20:48.320 Unfortunately, Shoes is more of a custom Ruby distribution than a Ruby project. So, when you attempt to gem install Shoes, you will see a message directing you to the website to download it.
00:21:37.840 The issue becomes apparent when we tried to shift to Ruby 1.9.2. The build process has been failing to include encoding properly, which is significant since random crashes on Windows result from this. It feels daunting sometimes, but problem-solving is part of the challenge.
00:22:26.080 The packaging situation can be leveraged from Ruby itself, helping with compatibility. But transitioning Shoes into a gem format is an incredibly challenging task that makes development frustrating at times.
00:23:00.880 However, taking on these difficulties makes me excited as a programmer. I’m right at a 'weird inflection point' as both the current state has nobody knowing about Shoes, and I’m working towards a brighter future.
00:23:55.440 We have to be aware of community dynamics. It’s vital to nurture community, reflecting on why we lose those we respect. Heroes leave the Ruby community—people like _why and Zed Shaw—and we often reminisce their contributions.
00:24:51.760 People may leave for various reasons, but it evokes reflections on our community. Some of these heroes have switched to different languages or communities entirely, and we wonder how this affects our own Ruby community.
00:25:47.440 The important aspect is ensuring that new programmers entering this community understand we’re all human. The manner in which we address and uplift community, feeling supportive rather than hostile, is crucial. We must cultivate a warm and inclusive culture.
00:26:40.680 Despite the intense rivalry, building bridges between languages like Ruby, JavaScript, and Python helps solidify positive relationships. We should celebrate our achievements in promoting shared knowledge rather than perpetuating tribalism in programming.
00:27:39.680 I appreciate that we can look past these rivalries to collaborate, sharing code and ideas that serve as success for everyone involved. That’s the environment I want to create, where new programmers and veterans can work together, helping one another.
00:28:34.720 In closing, let’s focus on creating positive moments—celebrating _why day means remembering his contribution while moving forward embodies a mindset of encouragement. Ruby is a beautiful tool for creation if we let it inspire us. Thank you for your time today.
00:29:17.120 As I conclude, explore Shoes and Hackity Hack, and encourage others to find joy in programming. Let’s work together building a thriving, inclusive community fosters exciting environments for all. And with that, I thank you for listening.
00:30:05.760 I have multiple online platforms where you find me, including my website and Shoes’s website. Lastly, I'm writing a book about RESTful APIs and how we often misunderstand and misuse those principles, and I hope to enlighten many through what I share.
00:31:02.080 Thanks for listening to me today. Let's continue to inspire and create a fantastic programming community.
00:31:25.680 Thank you.
Explore all talks recorded at LoneStarRuby Conf 2011
+19