3 ms·
Also, most c++ code is just...ugly. It can really assault the senses, looking at some of the template & indirection abstractions, etc. Rust just looks better, f
by aswanson 7y ago
Also, most c++ code is just...ugly. It can really assault the senses, looking at some of the template & indirection abstractions, etc. Rust just looks better, from what I've seen.
- x3ro 7y agoWhile this is very subjective, I tend to agree. All codebases I've read and worked on in C++ were eyesores in all but the simplest places. That being said, I think Rust macros are much worse compared to C++, if you ignore templates. Don't get me wrong, I really like Rust. I just think that it's macros make for some of the most unreadable code I've ever seen.
- todd8 7y agoThis seems kind of inevitable with macros. They help the macro creator write code with new, "better" abstractions, but readers of the code have to learn the semantics of the macro before they can understand what's happening. The built in mechanisms of a language are familiar to those new to a program's code but macros usually hide something significant (otherwise why have a macro). I've written fancy macros for assembly language programming to support my own looping, iterating, argument passing etc. but I noticed that the other programmers on the team weren't interested in using them. On the other hand, I'm so grateful to John Wiegley for his use-package macro for emacs lisp.
- kazinator 7y ago> readers of the code have to learn the semantics of the macro before they can understand what's happening. They always have the alternative of reading the expanded code, which is very similar to what the author of the macro could have written by hand instead of the macro.
- carlmr 7y agoI had the same feeling with macros intially, but once you wrote a few of them it's ok, and they provide many more guarantees than pure text preprocessing of C/C++.
- Thaxll 7y agoRust is not a pleasant language to read tbh: https://github.com/SergioBenitez/Rocket/blob/v0.4/core/http/src/header.rs#L48 https://github.com/SergioBenitez/Rocket/blob/v0.4/core/http/... Clean C++ 14/17 is less cluttered.
- vinay_ys 7y agoThat file looks quite readable (ignoring the comments - which again looks very readable in color syntax highlighted documentation).
- kbenson 7y agoI think it's the numerous single character lifetime annotations that they are referring to. I agree that this particular bit of code is somewhat hard to parse (as a rust amateur), but that might be alleviated quite a bit with some less terse naming.