We have created a working Todo-app, and it looks awful. Nobody wants an app like that. We need to make it look a lot nicer to get users to actually enjoy it. We are going to use Tailwind.css to style this, not because we have to, but because it is all the rage right now. Is it better than all the other CSS tools? I do not know, it might be, but probably not. We will use it anyway.
Let us be clear about one thing before we get started. Optimistic UI has been around for ages. It's not tied to Remix in any way, and you can create optimistic UI in any framework in any language. But, Remix makes it a lot easier to create optimistic UI than most other frameworks.
The problem we will solve in this episode of the series is about forms. Clearing inputs and returning focus to the first logical input. This way the user can fill in the form, hit enter, and then return to the first input field to fill in the next instance.
We can add and delete tasks, but the UI isn't showing us what is happening if we have a slow network. We should tell the user that we're adding or deleting. And we should do it while they wait for the database communication to happen.
We already have a loader that can access the database to fetch data. But we need a way to send data to the database. We do that with an action function.
We want to load our data from an external resource, and eventually that will be a database. We'll start by cheating though, and continue to use our constant todoList.
Remix is a relatively new framework (open sourced in November 2021), that sort of tricks React developers into becoming fullstack developers. Almost without having to learn new stuff.
At this point you have learned about the core data structures of Rust. You have also seen some of the algorithms that use them. This post presents a case study with exercises. I want to let you think about choosing data structures and practice using them.
This post presents one more built-in type, the tuple. I then show how vectors, hashmaps, and tuples work together.
A HashMap contains a collection of indices, which we call keys, and a collection of values. Each key is associated with a single value. The association of a key and a value is called a key-value pair or sometimes an item.
Like a string, a Vec or std::vec is a sequence of values. In a string, the values are characters. In a vector, they can be any type, as long as they are all the same type.
This post presents a case study. It involves solving word puzzles by searching for words that have certain properties. For example, we will find the longest palindromes in English. We will also search for words whose letters appear in alphabetical order. And I will present another program development plan. A method I call "reduction to a previously solved problem".
Strings are not like integers, floats, and booleans. A string is a sequence, which means it is an ordered collection of other values. In this post you will see how to access the characters (graphemes) that make up a string. You will also learn about some of the methods strings provide.
This post is about iteration, which is the ability to run a block of statements over and over again. We saw a kind of iteration, using recursion, in part five, Conditionals and Recursion. We saw another kind, using a loop, in part four, Turtles all the way down. In this post we’ll see yet another kind.
Many of the functions we have used, produce return values. But the functions we’ve written all seem to be void. They have an effect, like printing a value or moving a turtle, but they don’t seem to have a return value. In this post you will learn to write functions that have explicit return values. And what those that seem to to not return anything actually do return.
The main topic of this post is the `if` statement. You can use it to execute different code depending on the state of the program. I also introduce the modulus operator.
This post demonstrates a process for designing functions that work together. It also introduces the `turtle` crate.
A function is a named sequence of statements that performs a computation. To define a function, you specify the name and the sequence of statements. Later, you can “call” the function by name.
Manipulating variables is one of the most powerful features of a programming language.
How do you start learning to program, and why should you choose Rust as your first language?