Posts tagged with "learning"

Now for some Rust

2 min read; 10 GFI

I'm sure I've mentioned it plenty of times on this blog over the years, but I like to dabble with programming languages. For some people, writing code is purely a job; they concentrate on one language, do it well, and that's enough for them. I can respect that. For me, though, writing code started as a hobby, long before I ever did it as a living, and it continues to be a hobby.

A consequence of this is that I like to try to wrap my head around a new language every so often. Over the years, I've written code with:

  • Assembler
  • BASIC
  • C
  • C++
  • Clipper
  • COBOL
  • Common Lisp
  • Emacs Lisp
  • JavaScript
  • Julia
  • OCaml
  • Pascal
  • Perl
  • PHP
  • Python
  • Ruby
  • Scheme
  • TypeScript

and probably some others I've forgotten to add to this list. One or two I like to think I've (mostly) mastered (at least at one point in my cycle of use); others I've dabbled with to the point of having some fun and nothing more.

This last week, I've started to add another language to the list: Rust. I don't know where on the usage scale it will end up yet (either quick dabble or the walk to attempting to master), but I'm finally getting to grips with it and the urge to do so is sticking.

I've had a couple of goes before now, both times making an effort to work through the book. For some reason, both those times in the past, I lost interest. I think it's because -- as I've often said -- I'm the sort of person who needs a purpose when it comes to learning a language. So, to this end, I'm working on the problem I've used for this so many times before: I'm writing a Norton Guide reading library.

As always, for me, this is a great project to work on: it's a problem I know well, it's an outcome I know well, and it's a requirement that touches on all sorts of issues that you want to be thinking about when learning a language. Already, while working on this, I've had to learn something about how to build a library package, how to lay the code out, what Rust does for the obvious bits of syntax you tend to go looking for, how to do memory management, how to do file IO, and so on.

I won't claim that what I've got written so far is good Rust. I suspect that much of it isn't even idiomatic Rust (yet). What I do know is, so far, the code is working, and in getting it to work, I've started to understand some core concepts of writing Rust.

I now want to see it through to the finish. Heck, who knows, perhaps I'll eventually take it further and build a Rust-based sibling application for AgiNG so I can see how working with Ratatui compares with all my experience with Textual.

Getting started

1 min read; 14 GFI

By coincidence, in a couple of different places over the last couple of weeks, the subject of "how do I progress in learning to program?" has cropped up. For me, I think the approaches and solutions tend to be the same for when I want to get my head around a new language: read good examples of idiomatic code, read other related materials, find a problem you care about and implement a solution (ideally something you'll directly benefit from, or at least others may benefit from). Hence the 5x5 puzzle and Norton Guide reader projects I mentioned in my previous post.

Of course, not everyone has problems that they need solving in a way that would work for this approach. So another approach I've recommended in the past is to go looking on somewhere like GitHub and find projects that promote "low-hanging fruit" issues in a way that's designed to be friendly for those who are new to development, new to contributing or new to the problem domain.

While looking for examples of this yesterday I stumbled on Awesome for Beginners. This looks like a great list and one I'm going to keep bookmarked for future reference. Now, this particular list does seem to have an emphasis on pulling in people who are new to contributing to a project rather than new to development, but it does strike me as a good place to start looking no matter where you're coming from.

I know I'm going to start having a wander around that list. It's always nice to contribute and I feel there's real personal benefit in actively solving a problem that someone else has and welcomes help with.