Originally posted by wizard69
C has a lot of problems, but at least it is clean and easy to read. You could argue that much of it is kept in your head as opposed to written, but that is preferable when reading someone else’s code (or yours in a month or two) relative to unpacking what is going on in Rust.
Here’s some examples from Serde, their JSON serialization library:
Code:
impl<'a, W, F> ser::Serializer for &'a mut Serializer<W, F> fn serialize_field<T: ?Sized>(&mut self, key: &'static str, value: &T) -> Result<()> struct NumberStrEmitter<'a, W: 'a + io::Write, F: 'a + Formatter>(&'a mut Serializer<W, F>); fn parse_str<'s>(&'s mut self, scratch: &'s mut Vec<u8>) -> Result<Reference<'de, 's, str>>; impl<'b, 'c, T: ?Sized + 'static> Deref for Reference<'b, 'c, T> pub fn pointer<'a>(&'a self, pointer: &str) -> Option<&'a Value>
Rust may be the future, but definitely not my future. You couldn’t pay me to deal with the extra eye-strain. I’d much prefer using a safe and clean language with a GC like clojure, javascript, or *shudder* python. Or something like scheme that can compile to C. I would even rather write in C or C++ and take my chances with the roulette wheel. I also formally apologize to C++. I used to call it unreadable but next to this monstrosity it is practically a Lisp. Ok I’m done.
Comment