Learning rust by doing a project


I've been wanting to really learn rust for quite a while, and I've been doing projects on exercism.io, but it was starting to feel rather boring, the things that I do there aren't really feeling “real” they are great practice, but it's just doing stuff that you will then never look at again, they aren't really useful, and it gets kind of hard to muster the motivation, and the other thing is that you're not really encouraged to using crates.

So I was quite clear I had to find something to do, and it took me many days before I came up with a project simple enough for me to actually be able to do for myself.

And what I came up was to make a replacement for variety, or more a replacement for me for the parts of variety that I use, variety is a wallpaper downloader and switcher and bascially what it does is that it downloads wallpapers for you and switches them in a set interval. The problem that I had with it was that it's quite resource hungry, it kept being one of the programs running in my machine that was consistantly using the most memory, so it was a good thing to be able to make a replacement for. And the idea for Tapet was born.

Building Tapet


So I started with thinking out how this thing was going to work, and more clearly what steps so that I gathered up the things that I would need to get and here basically here was the stuff that I was finding I would need

So on I went, and honestly the whole thing went way smoother than I was expecting it to, the libraries for rust are mostly well documented, and it was rather easy to figure out what it was that I needed, granted it was probably the smallest thing each of these libraries did. So here is what I went for:

And off I went, and over 3 days I had made my thing, it's probably less than perfect, but it's mine, and it makes me happy.

What did I learn


Well, the most important thing I learned was to not be too afraid, and just try to make something. Have fun, and actually get something done, it's not as hard as I was trying to convince myself of.

Use the typesystem to your benefit, usually when I've been writing python and/or F# and other things I've been relying quite a lot on the repl, the rather amazing thing about rust has been that as long as it compiles it runs, and in the end I have found it to be even more comfortable as I didn't have to switch context all the time.

This was a lot of fun, and I hope to do it again, the only thing is that I will have to do the hardest thing again, find a project that is interesting to do, but still not so ambitious that I won't manage to do it.

I'd reccommend anyone that wants to learn to come up with something small that they want to solve and solve it. It's fun and practical, and in the end maybe you will end up with something that you can use as well.

And if you're interested in see (probably not that good rust code) you can find it over in my github repository