/learn-to-code-rust-baseball

Learn to Code with Rust and Baseball

Primary LanguageRust

Learn to Code in Rust - With Baseball Data!

Goals of The Tutorial

Learn to Code in Rust with Baseball Data is a Rust tutorial which assumes zero knowledge of Rust, or even programming in general. In this tutorial, you'll learn how to pull baseball data from the MLB stats API, all in pure Rust, with concepts introduced as they become relevant.

The entire tutorial is free to use, and developed in the open. Please file any issues you run into, be it content, errata or whatever!

The goal is to keep each chapter short and focussed on one concept at a time. Each chapter will explain the background you need to undersand what you are doing. Every step will be built up methodically, and wrapped around things you can see and touch.

Why?

The hardest part of learning to code is the "chicken and egg" problem. In order to understand concepts like "borrowing", you need to understand how memory works in the computer, as well as the difference between stack and heap memory. If you want to understand how text works in the computer, you need to understand ASCII, utf-8, characters, bytes, graphemes, etc.

When you are learning a new language, this can lead to a very disjointed learning experience. You start with a big dump of knowledge, often without something to tie it to. You start, but then you run into a concept which requires a detour.

My pedagogical thesis relies on having every concept tied to something you are doing. As much as possible, I try to tie abstract concepts to concrete things, that you will build yourself. All the knowledge you need to progress will be self contained in the tutorial, even if I throw in a link or 2 for "recommended reading".

Is This Tutorial For Me?

Yes.

Is it Really for Me?

If you've never done any programming before, YES! If you've done some programming, but no Rust, then YES! If you're fairly comfortable with Rust, but just want to learn the baseball bits, you might want to skip some of the line by line explanations and jump to the code snippets.

Is the Author Qualified to Write a Rust Tutorial?

I don't have a computer science programming background, nor am I a professional developer. I self describe as a "hobby" programmer. This affords me a unique perspective on learning how to code. Rust is the first language I was able to develop a high level of proficiency in. Most of the tutorials and documentation you'll read are written by professionals. This is obviously a good thing, however, it is extremely hard to put yourself in the shoes of someone who is at the very beginning of the learning curve.

For myself, I still remember all the pitfalls, the struggles and the little details which are now "obvious", but weren't at the time. My hope is that this perspective will help deliver a very accessible, approachable end product.

Do You Want To Sell This?

No. If it ever gets to a level of polish that warrants commercialization, it would follow what Marijn Haverbeke did with his "Eloquent Javascript" series, where all versions are freely available in any digital format you want; just the print version needs to be paid for. This project's only goal is to teach Rust, sans commercial intent. The content will remain FOSS, forever.

Contributing

Please contribute by opening issues, giving feedback, etc. In order for the tutorial to make sense, it needs to follow a linear path, with a consistent voice. For now, that means that each chapter needs to be written by me. At some point, we may be able to add "advanced" or "intermediate" chapters, which could go on interesting tangents. We'd still want to go with the "one chapter one concept" principle, but I haven't really thought that far ahead yet.