After so many Java cups, I’m starting to feel Rusty (part I)

Miguel Rivero
Clarity AI Tech
6 min readAug 26, 2020

--

Hello Java.

I wanted to write you a letter for some time, and I’ve just found the courage to do it.

Ours has been a love that has lasted for more than 15 years now, but we need to talk, and it’s not you, it’s me, I’ve changed.

Like many couples, in the beginning, we were discovering each other, and I was fascinated with all of your features; how clean and neat you were with your shiny garbage collector. The versatility of moving your bytecode to almost any machine in the World and the abstraction brought by your inheritance.

Then, after many happy years together, something happened. I wasn’t feeling the same anymore. I can’t tell you exactly how I reached that point, but suddenly I was there, and things weren’t as they were before. Maybe it’s because I’ve experimented with some different stuff, I built some other Hello Worlds (some of them even ran without the need of any virtual machine),

I created some weakly typed code on my own, I tried some other frameworks, even non-web frameworks, can you believe it?

You have to understand me, maybe I have more seniority now, but I still have those youthful feelings: when you listen to some colleague talking about his/her expertise and realize that you actually know nothing (Jon Snow) when you hear about that tool that everyone uses except you, when you wonder how it would be to work in any of those fancy new AI fields…

I still have the same curiosity, the same pleasure of discovering new things… I still feel like I’m a kid, that one that was more interested (not always ;) ) in how that Arcade game was made than actually in playing it.

Thanks to that experimentation and willing to learn, I have to confess that I fled for a while from the corporate world, mostly full of serious and busy people and then started playing with mobile development and my own ideas, only interested in Android, of course, not only because it was “open source” and kept Linux into its guts, but also because you were there too. It felt just natural, and I didn’t want to break our everlasting bond.

That was the gate that opened a whole new world full of user interactions, push notifications and Bluetooth connections, but it felt familiar, nonetheless, because you were there with me. I took your hand and again we had fun together, and we published some stuff, which by the way was exciting but scary, because for the first time literally anyone could review and comment about all what you and I did, and that was quite different to what I was used to before when only a bunch of people gave their true opinion about my work, and those people’s thoughts could be sometimes good, sometimes bad, but surely they were always respectful (something that is not exactly guaranteed when you publish something in Google Play).

Developing for the first versions of Android was like getting back again into the late 80’s/early 90’s, when I commenced being interested in computers, bringing back much of the joy and that sensation of being closer to the machine, a much simpler one, back then.

And it was exactly at that moment in time when I achieved my childhood’s old dream of making Video games, and you know what?: even then we didn’t need to split in any way!

I was so lucky that I joined a team that made games for a niche market, composed of Android and J2ME players, so even when living surrounded of C++, Objective-C and machine code all around us, you and me stuck together, like jelly and peanut butter, even if it wasn’t your whole you, but your old and incomplete you in this case (J2ME…), I loved you anyway, it didn’t matter if we hadn’t ArrayLists or HashSets (we couldn’t even use floating-point numbers due to the really old phones we needed to support…), we had each other and we had imagination. You probably remember those times, because due to that limitation we had to reinvent the wheel together many times, but it was OK because what was really important was, one more time, your versatility (you know, write-once…).

But then, after so much time spent together, that so long feared moment arrived, and you were taken away from me. I was used to be with others for a short while, usually against my will: a bit of PHP for this legacy web, a bit of C# or Visual Basic for this customer that has only Windows servers, a bit of Python because of this cool lib, so convenient to use… but in the end, I always came back to your arms. Until then.

They told me that we couldn’t see each other anymore, that from that moment on if I wanted to keep making games, I had to be attached to your older brother: C++. I have to confess that it felt scary at the beginning, as your brother looked very strict and I didn’t play with C, everyone’s father, since the 90’s, but I accepted.

Fooling around with Gaming was the definitive no-return point. Maybe it’s because I felt again the joy of playing with things at a low level, much closer to the hardware, like in the good ol’ times, when a computer had only 512KB of memory and no hard drive and the restriction of resources was one of the main issues to care about… I don’t know what it was exactly, but I liked it, and I found myself learning about how games were made, even when my daily tasks were more related to services and multiplayer logic than with the gameplay itself.

After being forced to work with C++ for a while (a short while, actually), I lost many of my fears about memory management in particular and system languages in general and became interested in the native compilation, optimization, and high performance. Google launched Go around that time, so I investigated a bit about it, looking especially to the power of Goroutines and the promise of doing background job in a much more efficient way than threads (one of my main problems while working in games).

And then, Rust came to the scene, making little noise, and having much less publicity and support than Go, but bringing more interesting and revolutionary concepts with him.

It was love at first sight.

It’s probably much less productive when you use it for the first time than choosing Node and Javascript, for instance, but in exchange, it really changes something in the way you think, it’s not just learning a new idiom to do the same thing one more time, but learning to do things in a slightly different way instead, and also it promises you that when you get to know it better, it will pay you back with interest. C++ promises you the same amount of power if you are able to master it, but the difference is that with Rust you feel like you are in the XXI century since the beginning (You have cargo as a dependency manager, functional programming… it feels indeed like a modern language).

At this moment Java feels to me like the safe thing to do, Kotlin like the natural evolution and Go maybe like the correct choice for the future, but Rust feels like the most exciting choice of all.

If you like cliffhangers, wait for the Part II of this article where I’ll keep opening my heart, this time telling about my first impressions on Rust, this time with more concrete examples of the language…

--

--

Miguel Rivero
Clarity AI Tech

Trying to improve World’s sustainability, starting with finances