2 ms·
I don't think, for example, "semicolons terminate statements; blocks in curly braces; module import is use module::submodule::symbol; comment with // or /* */
by logicallee 11y ago
I don't think, for example, "semicolons terminate statements; blocks in curly braces; module import is use module::submodule::symbol; comment with // or /* */ which can nest." is deep water. The tutorial has to make a decision: does its audience know what a loop is, or how to even think about an algorithm that would use it? If the audience doesn't, then it's not a Rust programming language book, it's a Beginning Programming with Rust book. If the audience does, then they just need to be told the syntax.
Even when they ostensibly do that, "The main concept that makes Rust unique is called ‘ownership’. Consider this small example:" could be better-stated as a difference between Rust and (list the languages that don't have it.)
Tutorial authors and tool authors also waste INCREDIBLE amounts of time through dishonesty. For example, Functional Programming like Haskell is largely defined by the hoops you have to jump through syntactically and in program structure due to what it avoids. But a Haskell tutorial will NEVER make it obvious within the first two minutes that you are doing something fundamental different from C, Java, Python, C#, Perl, whatever - and that it has a whole concept, monads, just to get around this artificially imposed self-limitation.
They're just dishonest, waste incredible gobs of time, and don't get to the point.
When was the last time you picked up a language book that made it completely obvious in the first minute what it was and wasn't suited for, how many hours you would need to practice it before you made progress, and what the absolute bare minimum number of minutes you would need to invest before you could start doing anything in it was? It's a guessing game. "Wow, this only took me two minutes!" (json). "Wow this took me two weeks and I still can't do shit!" (haskell)
I Googled "I tried learning haskell for" to report on what I found. There happens to be one hit on that exact syntax. Guess how long the guy "tried" learning haskell for? A few months.
- maxerickson 11y agoThis gets back to the thing where the author (probably necessarily) has to write for a wide audience. Someone who enjoyed math in various school classes will probably understand the basics of functional programming faster than someone who only worked their way through it. So one of them might be just as angry as you are at the bad advice in the front matter of the book.