Talks

Deconstructing a Hype: What People Think Is Wrong With Ruby?

Balkan Ruby 2019

00:00:20.510 You know that the original plan for this talk was actually a crash course on how to pronounce my name. I seriously planned to do that, but then I decided to drop it because the presentation is already long.
00:00:26.430 So, hi, I'm Amr. I don’t want to go too deeply into what I do for work. You can just grab me anywhere, and we can discuss it later. I mean, I sell clothes on the internet, and that’s it.
00:00:35.000 But why am I actually here on this stage at the moment? Have you ever heard the term 'hype-driven development' before? This term was introduced by a person named Merrick in a blog post in 2016 under the title 'Hype-Driven Development.'
00:00:44.940 It basically speaks about the tendency of software teams to make technical decisions based on hype. Rather than researching options, they see what others consider a hot technology or a hot pattern and they try to follow it.
00:01:01.270 They don’t really rely on solid research when doing this, and they obviously don’t consider their own project needs and contexts. Honestly, this tendency exists.
00:01:10.470 I’ve been in this industry maybe not as long as some of you, but I have seen this tendency a lot. People tend to follow trends, especially seniors or those who are paid as seniors. Sometimes, seniors often follow hype even more than juniors.
00:01:23.220 Juniors have the tendency to try to understand things more deeply, while seniors just express opinions without much explanation. Beginners are usually the most confused by hype. When I was a beginner, I often wondered why certain bold statements were made without explanations.
00:01:35.010 A quick Google search with terms like 'Ruby is dead' will probably yield millions of blog posts with titles like 'Ruby is dead' or 'Ruby is done.' This plays into what I call the Ruby trashing hype.
00:01:45.680 Don’t get me wrong: when I mention hype, I don't imply that it’s always negative. Hype is simply different. To explain this further, I created a diagram I call the "anatomy of a hype." A hype usually starts with a real situation.
00:01:58.530 Someone introduces a new solution or faces a new problem in their own context and shares it in a conference or blog post, which is absolutely great. Then, a buzz begins.
00:02:08.520 This buzz can snowball into a state of mania where every software team in the world feels compelled to adopt the latest trend, like microservices or serverless architecture, even when it may not necessarily fit their context.
00:02:18.740 Eventually, many teams reach a state of disappointment. They followed the trend based on a conference presentation, only to realize that it was unnecessary, landing themselves in a big problem.
00:02:32.880 Today, I aim to discuss the state of realization within our community: recognizing that every hype comes with its own context. Each solution or problem has a specific context that we need to discuss.
00:02:39.550 For example, noSQL databases work well with specific types of data, but they aren’t suited for everything. Similarly, microservices are applicable in very specific organizations and technologies, and not the solution for all problems.
00:02:55.010 This same idea applies to claims that 'Ruby is bad' or 'Ruby is not a good technology.' Such statements have specific concerns behind them, but they aren’t universally true.
00:03:07.440 The focus of my research project is to understand and deconstruct this Ruby trashing. Throughout this project, I will highlight things I feel critical about in Ruby.
00:03:21.300 However, please note that this is not a critique of the Ruby core team's efforts. For context, when the Ruby core team and Matz began their work on Ruby, I was only four years old.
00:03:36.740 I think it’s important to clarify that my aim is to support and help improve the language. What I am doing is a research project I launched a few months ago under the title "What’s Wrong With Ruby?"
00:03:46.660 This research project has three goals. The first goal is to solidify all the claims behind the hype. I would like to provide substantial arguments as to why people frequently criticize Ruby.
00:03:55.870 The second goal is to generate a report that can be useful to the core team and the broader community, shedding light on the perceptions of Ruby and why it may be seen as a problematic language.
00:04:09.460 The third goal is to explain these problems in simpler language for beginners. Too often, senior developers tend to communicate in ways that can be confusing for newcomers.
00:04:20.990 Now that we know the why and the what, let’s discuss the how. As someone who earns a salary as a senior software engineer, I have plenty of thoughts about Ruby. I work with Ruby regularly and have encountered many bottlenecks that have made me uncomfortable.
00:04:39.550 Initially, I thought about making a presentation or writing blog posts to share my views on the problems with Ruby. However, that felt quite arrogant since my experiences represent just one perspective within a vast community.
00:04:54.230 I realized that I need to involve as many people from the community as possible to address these questions adequately. The first phase of my research involves qualitative interviews.
00:05:04.660 I’ve been talking to individuals, usually for half an hour to an hour, discussing various topics, transcribing their insights, and identifying focal points and interesting quotes.
00:05:15.920 The participant groups I’ve targeted include core contributors from different Ruby implementations. I’ve interviewed people from JRuby, Truffle, the Ruby core team, and some who’ve committed to see Ruby and Rubinius in the past.
00:05:31.680 I’m hoping to connect with more people in the Ruby community. The second focus group consists of maintainers and contributors to commonly used gems in the Ruby ecosystem.
00:05:41.820 So far, I’ve conducted around 25 interviews and have about 20 scheduled. From those I have completed, I’ve spoken with maintainers from VCR, SimpleCov, and several other well-known gems.
00:06:00.430 The third group includes Ruby community members and event organizers—those who run Ruby user groups across Europe.
00:06:07.370 I’ve reached out to individuals from various meetups and conferences. Unfortunately, many Ruby enthusiasts have already moved on to other technologies, such as Elixir or Rust, which makes it harder to engage.
00:06:25.550 However, I’m still keen to interview Ruby engineers at all levels. I haven’t yet connected with complete beginners interested in participating, so if you know any, please do reach out.
00:06:38.260 Also, I’m interested in speaking to academics who have explored Ruby, so any connections to such individuals would be greatly appreciated.
00:06:49.180 Now that we’ve established what I am doing, let’s explore some findings. I wouldn’t even call them findings yet; rather, they are highlights and quotes from the interviews.
00:07:10.160 First topic: performance. It’s important to note that performance is a broad term. When I say performance, speed is one aspect, but it's not just limited to speed.
00:07:19.000 A quote from Toby Pfeiffer, the organizer of the Ruby user group in Berlin, illustrates this well: Imagine you have two rabbits trying to get from point A to point B.
00:07:28.580 You might ask which rabbit arrives faster, but another aspect is to consider how many carrots each rabbit needs to achieve this.
00:07:40.120 This effectively describes performance. However, it raises the question of what actually defines good performance, as it can vary based on context.
00:07:49.300 Another sentiment prevalent about Ruby, particularly outside the Ruby community, is the common statement: 'Ruby is slow.' While this might seem obvious, it's essential to point out that Ruby’s computational performance has never been a strong point.
00:08:01.800 This characteristic was by design, as the primary focus has always been on developer happiness—allowing developers to feel comfortable while coding.
00:08:16.670 To clarify, programming languages are tools we use to build things. While they may impact our performance, they do not solely dictate it.
00:08:27.090 A story I encountered was about one project where a poorly written C extension was rewritten in Ruby, and the performance improved significantly. This illustrates that sometimes, the quality of code is a more significant factor than the language used.
00:08:44.280 When discussing why the sentiment that 'Ruby is slow' persists, Curtis McHale, the maintainer of a gem, shared his thoughts. He believes many early Ruby adopters came from Java or C backgrounds, attempting to solve problems that didn’t align with Ruby’s strengths.
00:08:55.270 Eventually, the community recognized that you don’t need the same level of optimization to sell clothes online and can still produce profits with Ruby.
00:09:11.050 The performance of Ruby can yield positive outcomes even in high-demand contexts. For example, NASA has utilized Ruby successfully, showcasing that there exist successful implementations, even if Ruby's inherent performance isn’t exceptional.
00:09:24.960 This is not to say that we are defending Ruby; rather, we recognize the community's drive to move forward despite the past performance limitations.
00:09:34.950 Efforts like Truffle Ruby and JRuby show that optimizing Ruby is indeed possible and relevant. Choies Mutters, one of the JRuby authors, noted that certain features in Ruby complicate performance enhancements compared to other languages.
00:09:53.800 There’s also the initiative known as Ruby 3.0. According to the Ruby core team, Ruby 3.0 will be three times faster than Ruby 2.0. I found it interesting how divided the community is around this goal.
00:10:08.550 Some argue that the goal is lofty and difficult to attain. They compare it to Per 6's long wait time and express concern that when Ruby 3 is finally released, it might not meet expectations.
00:10:23.850 On the other hand, some believe the three times faster goal is too low, pointing out that projects like Truffle Ruby are already demonstrating twelvefold speed increases in certain benchmarks.
00:10:35.460 There’s a third group who emphasizes the vagueness of this overall metric. When we say that Ruby 3 will be three times faster, what does that mean specifically? What benchmarks are we referring to?
00:10:52.370 C Ruby 2.6 introduced a just-in-time compiler, which was an important step, yet it was not intended to deliver massive performance enhancements.
00:11:05.630 Chris Seaton, the lead on Truffle Ruby, suggested a metaphor of an ice hockey stick shape for Ruby optimization efforts. As he noted, a lot of effort can yield only marginal gains within Ruby's dynamic nature.
00:11:20.680 People from the Truffle Ruby team mentioned that while C Ruby performance was a motivation for developing Truffle Ruby, their primary focus was to create something that could work well with other JVM languages.
00:11:35.780 This realization led to the possibility of compiling JRuby to JVM bytecode, resulting in performance benefits. Throughout my experience, I've noticed that engineers often over-engineer performance, obsessing over milliseconds.
00:11:46.920 I must say that from my limited experience, the Ruby community tends to address performance challenges in a healthier way than in other communities.
00:12:01.890 As for profiling and benchmarking tools, interviewees expressed satisfaction with how Ruby handles these processes compared to other programming languages.
00:12:16.840 However, many indicated that real-world learning resources on performance optimization are lacking. Many talks at Ruby events often address Rails or single query optimizations, which aren’t the primary focus of real-life performance enhancements.
00:12:32.370 People mentioned that they would like to see more discussions and presentations on real-world applications rather than theoretical benchmarks. It's essential to share experiences that go beyond the traditional perspectives.
00:12:52.000 The discussion on gem maintainers versus application developers is also notable. Gem maintainers face an added performance burden due to their libraries being utilized across multiple applications, necessitating more significant consideration than application code often requires.
00:13:15.210 Now, let’s pivot to my next focal point: the distinction between Ruby as a language and its C implementations.
00:13:22.370 I think beginners struggle to grasp concepts when they hear terms like JRuby, Truffle Ruby, or M Ruby.
00:13:32.060 It's crucial to understand that Ruby is a programming language with specific specifications and characteristics, while CRuby, which most refer to simply as Ruby, is just one implementation of these.
00:13:46.560 Dr. Yvonne Draghi, a senior engineer at Amazon, shared that while many alternative implementations exist for various languages, JRuby and Truffle Ruby are high-quality implementations—not experimental toys.
00:14:06.590 JRuby is production-ready, and although I could delve into comparative details, many resources online already cover the topic well.
00:14:25.170 Here’s some feedback from individuals who have utilized JRuby in production: Jacob Matthews shared his experience after three years in production applications, claiming JRuby is often overlooked.
00:14:35.150 Dr. Yvonne also attested to his positive experience with JRuby, noting the responsiveness of its developers in addressing issues.
00:14:46.140 Jacob further commented that Truffle Ruby is possibly the most exciting advancement in the Ruby ecosystem recently. As Choies Mutters noted, one merits of these implementations is the ability to retain the benefits of Ruby while leveraging everything from the Java platform.
00:15:06.840 Chris Seaton stated that Truffle Ruby is faster, runs additional languages besides Ruby, and has a superior debugger.
00:15:20.080 However, there are downsides, such as JRuby's notorious slow startup times, which complicates development. While improvements are underway, many developers experience a frustrating wait during JRuby's initialization.
00:15:33.060 The Truffle Ruby team is also exploring new JVM features that can improve performance significantly. Meanwhile, there’s a burgeoning interest in compiling Java to native code that could potentially resolve these issues.
00:15:49.560 Though the JVM has excellent garbage collection and stability, it is more memory-intensive than expected compared to the C world.
00:16:04.290 Truffle Ruby is still early in development and is not yet a stable, production-ready implementation. Regarding support for implementation, developers face many obstacles.
00:16:16.860 Initially, C Ruby was the sole implementation available, so there was no clear path for defining Ruby's specifications, creating challenges for the maintainers.
00:16:30.250 As a result, many maintainers have had to ensure compatibility with C Ruby primarily, relying on its test suite.
00:16:46.610 Moreover, there is often a lack of available resources for development compared to traditional application code, where engineers can get by more straightforwardly.
00:17:03.760 Another topic of significant impact in the Ruby ecosystem is native C extensions. Many gem maintainers opt to write C extensions to improve performance, given the nature of C as a low-level compiled language.
00:17:19.000 Although C extensions can improve performance, they come with challenges for gem maintainers trying to support other implementations.
00:17:34.470 Trust's comment that C extensions are a significant impediment to Ruby's growth highlights a reality many developers face—finding balance between speed and accessibility.
00:17:49.170 Interestingly, the Truffle Ruby team believes this is solvable with enough research—an optimistic view on an otherwise complicated issue.
00:18:02.030 One final observation by Toby is to encourage developers to experiment with migrating to JRuby before rushing to rewrite performance bottlenecks, as this change may provide unexpected performance boosts.
00:18:13.930 This is vital advice. There’s a need for more real-life use cases in talks—genuine experiences with Ruby—rather than solely benchmarks from core teams.
00:18:29.360 The next focal point, which I’ve rewritten many times and still feel it’s not perfect, is about concurrency and parallelism.
00:18:44.940 In recent years, we’ve had to shift our focus toward concurrent programming to accommodate the multi-core devices we now use, with many devices equipped with multiple processing cores.
00:18:58.720 The significant demand has brought forth the necessity for software engineers to grasp concepts of concurrency and parallelism.
00:19:15.760 There's often confusion about the difference between the two: concurrency refers to managing multiple tasks at overlapping times, while parallelism means executing multiple tasks simultaneously.
00:19:27.620 Critics argue that Ruby struggles with both concurrency and parallelism, particularly within C Ruby, due to a global interpreter lock that restricts running Ruby code in parallel.
00:19:39.740 The inability to run Ruby code in parallel leads developers to promote multi-processing approaches, which often leads to increased complexity and memory issues, especially with process forking.
00:19:52.490 Despite this, successful projects in production, like the Unicorn web server, operate under this model. However, what developers truly desire is to harness lightweight threads that don’t require duplicating memory.
00:20:09.420 Currently, there is no capacity for Ruby to run concurrent threads due to the global interpreter lock. While efforts have been made to resolve this, it remains an ongoing challenge.
00:20:24.060 The discussions surrounding Ruby 3.0 encompassed concurrency as one of the three key design principles, reflecting the community's awareness of the challenges.
00:20:39.220 The second challenge in concurrent programming involves the scarcity of intuitive, high-level abstractions that could facilitate understanding of how to implement concurrency effectively.
00:20:56.220 I believe that existing abstractions in distributed systems could provide a foundation. Terms like 'actor models' and 'goroutines' were mentioned frequently during interviews.
00:21:09.200 While there's been talk about Ruby 3.0 and its planned guilds proposal, it hasn’t been a prominent topic in recent discussions, raising questions about its current status.
00:21:27.630 Moving on to the next focal point, I want to speak about what I term "syntactical innovation." Ruby’s syntax is generally well-loved, yet many feel there’s been a lack of noticeable innovation since version 1.9.
00:21:40.420 Innovative features like keyword arguments have been well received, while the safe navigator often leads to frustrating code patterns—hastily introduced without sufficient examination of their impact.
00:21:56.420 Finally, I’d like to mention a point about community contribution to open-source software. The Ruby community must foster engagement among developers who want to help drive projects.
00:22:13.420 People should feel invited to contribute, whether through code or other avenues, such as mentorship or documentation.
00:22:27.470 It's critical for all contributors to recognize the human aspects of language implementation; mistakes can happen, and we should support one another in the process.
00:22:43.880 Additionally, I want to applaud the initiative where the Ruby core team has transitioned to using Git, which has been highly beneficial.
00:22:59.860 Another interesting point raised by Choies Mutters is his travel experiences. He often attends Ruby conferences to connect with Rubyists and encourages them to get involved in JRuby.
00:23:17.280 Now, let’s address the topic of Ruby and its coupling to Rails. It’s vital to acknowledge that Ruby is a general-purpose language and not exclusively a web-focused one. There are numerous other web frameworks available.
00:23:36.990 In fact, there's a fun quiz called "Ruby or Rails" that tests your knowledge on various methods, which is worth checking out.
00:23:52.290 As for the standard library, there’s certainly room for improvement, especially with meta-programming, which remains a topic of contention among many in the community.
00:24:10.640 Regardless of these challenges, I stand by my belief that Ruby remains a wonderful language, and that's why I am here at Balkan Ruby today.
00:24:29.810 I also truly appreciate the Ruby community, as it tends to be more welcoming and diverse compared to other tech communities.
00:24:45.200 This project represents a way for me to contribute meaningfully to Ruby, offering me a platform to share what I’ve learned during my research.
00:25:03.020 If you find this project intriguing and want to help spread the word, please do. Connect with me, follow me on Twitter @gilad, and let's discuss how you can contribute.
00:25:20.370 If you know people within your network who have unique insights about Ruby, I would appreciate introductions or recommendations for interviews.
00:25:38.010 I recognize that the journey ahead may prove challenging, but I invite any volunteers looking to engage and offer their assistance. I’m specifically looking for diverse interviewees.
00:25:52.760 I believe that increasing diversity within this project can offer more perspectives, and I’d be grateful for any introductions.
00:26:09.600 Thank you so much for your attention.