Programming with Rust

Author:  Donis Marshall
Publisher: Addison-Wesley
Pages: 400
ISBN: 978-0137889655
Print: 0137889658
Kindle: B0CLL1TGVT
Audience: Programmers wanting to learn Rust
Rating: 3
Reviewer: Mike James
Rust is the language we all want to learn at the moment so this is just in time.

Rust is currently the great language hope to banish memory errors from programming. The only problem is that it makes use of some new ideas and as a result you probably need to rethink how to go about programming. Rumor has it that far too many Rust programmers continue to write programs using it as if it was C and escape the difficulties using unsafe blocks of code. There is a need for a good book on Rust.

Banner

This book is good in parts and it might suit your needs if you prefer a reference manual approach. That isn't to say that this book is all reference manual, but it does miss many opportunities to explain why something is like it is or how it differs from what you might already know.

After a brief introduction to programming paradigms and the major features of Rust, we get started with Hello World. There is a lot to take in and a lot of new jargon.

 

 

Chapter 3 is where the exposition of the language really starts with a look at variable types. This is fairly complete rather than being a gradual introduction of ideas - we go from integers to  pointers in not many pages. This is not for the complete beginner, but then most people wanting to learn Rust are probably moving on from C. Next we have a chapter on Strings and one on using the console, i.e. the Print command.

Chapter 6 digs into flow of control and it is another very complete statement of the possible control structures. There have already been many missed opportunities to highlight what makes Rust special or different. For example, Rust's for loop is nothing like C's and yet it is presented without the obvious comment that Rust does it slightly differently. As a result you might well keep wondering if a full C-style for is going to be introduced later - it isn't of course.  Chapter 7 continues along the traditional track with collections - arrays, vectors and hash maps.

It really is only at Chapter 8 do we get to anything that is central to what makes Rust different - ownership. Chapter 9 continues the related theme with a look at lifetimes. These two features are what most programmers will want to know all about, but the coverage is very short. I would liked a longer discussion with more examples, especially of how things go wrong. I think you will leave these two chapters thinking you have mastered the ideas until you actualy try to make use of them.

From this point the book continues along a fairly standard road that would be followed irrespective of the language. Chapter 10 is on references and includes a consideration of borrowing. Chapter 11 is on functions, 12 on error handling, 13 on structures, 14 on generics, 15 patterns, 16 closure, 17 traits, 18 and 19 are on threads, 20 is on memory, 21 macros, 22 interoperability - with C in particular and 23 closes the book with a look at modules.

Verdict

This is a book that is going to disappoint both the reader looking for a reference style presentation and the reader looking for an informal account. It tends to present everything on a topic rather than starting simple preparing the ground for meeting the more advanced or esoteric ideas later. There is also a lot of forward referencing due to this approach. Some parts are better than others in making it clear how Rust differs from other languages, but there are also lots of places were a few words contrasting it with C or Python would help the reader.   

 

To keep up with our coverage of books for programmers, follow @bookwatchiprog on Twitter or subscribe to I Programmer's Books RSS feed for each day's new addition to Book Watch and for new reviews.

Banner


Math for Programmers (Manning)

Author: Paul Orland
Publisher: Manning Publications
Date: January 2021
Pages: 688
ISBN: 978-1617295355
Print: 1617295353
Audience: Python developers interested in math
Rating: 4
Reviewer: Mike James
Of course you need to learn math, don't you?



Coding for Beginners, 2nd Ed (In Easy Steps)

Author: Mike McGrath
Publisher: In Easy Steps
Pages: 192
ISBN:978-1840789751
Print:1840789751
Kindle: B0B56LN77V
Audience: Complete beginners to programming
Rating: 4
Reviewer: Sue Gee

This book aims to introduce hands-on modern programming to complete beginners. Can this be achieved in fewer than 180 [ ... ]


More Reviews

Last Updated ( Tuesday, 26 March 2024 )