In Rust, Debug is a trait that allows us to inspect the state of a struct by printing the struct to std out or, you know, whatever. Usually, we just derive debug implementations, but there are cases when that's not possible or even desirable. Here's a real world example.
Sometimes, I'm not sure why I write about software. Specifically, I'm not sure why I write about Rust. The community built up around the language views me as basically the root of all
The compiler often doesn't see the difference between imperative and object-oriented code, so try not to feel too bad about which one you write.
Rust allows the programmer to choose between static and dynamic dispatch pretty much on a case by case basis. In real world terms, the performance difference between the two is practically invisible; a branch is a branch is a branch. When should we choose one over the other and why?
Once upon a time, computers were slow and disks were small. Every kilobyte—nay, every byte!—was precious, and a thing to be hoarded and safeguarded against the awful ravages of time and bloat. In those days, a great many stupid things were done in the name of efficiency. Here is one.
Let's take a deeper look at the latest challenge with an eye toward why, exactly, it may be challenging for newer programmers. Hold onto your hat; this is a long one!
Everyone's done this one. I mean, well, most people have. But today I read a post by a guy who just finished this for the first time (and congratulations, by the way!), and he said his implementation took six hours to run.
"CA2000: Dispose objects before losing scope" sounds like good advice. Your dad might say that before you head off to college, or maybe you heard it from a Jedi master. Too bad this advice is bullshit.
How much more RAM does your system need? We all know the only correct answer to this question is "all of it," but let's curtail our goals for a moment and think about how much we can actually use.
Once upon a time, a fool thought, "I know! I'll fix this problem with a regular expression." Then he had two problems.
When a colleague attempted to explain to me the benefits of internal iteration, I genuinely did not understand why he thought it was such a big deal. Now that I get it, kind of, I'm going to explain it to you.
Ninety percent of what we do is putting data on a server. The other ninety percent is wondering where the hell it went.