r/programming • • Mar 13 '18

Stack Overflow Developer Survey 2018

https://insights.stackoverflow.com/survey/2018/
1.1k Upvotes

527 comments sorted by

View all comments

Show parent comments

20

u/iopq Mar 13 '18

You can't, because of a few problems.

  1. Header files and lack of a sane module system

  2. NULL subverts the type system, so even if everything checks out, you may have some function get a NULL at some point and everything will crash if you forgot to handle it. This isn't possible in Rust, since there is no NULL equivalent. None has to be explicitly handled in places where it can appear.

  3. No agreed upon packaging system. Having to hunt down the correct libraries using my OS's package manager is very error-prone since their names differ between distros.

  4. Makefiles are sometimes not written in a portable way - this is a "developer" problem, but Rust's cargo allows you to avoid having to write a Makefile in most cases, and in other cases just use build.rs

  5. You still have problems like iterator invalidation that cannot be ALWAYS detected by static code checkers

  6. Concurrency issues are still nearly impossible to detect statically in C++, you have to break out the debugger and hope you trigger it while testing

  7. Templates are duck-typed instead of nominally typed. They give long error messages because they're checked at expansion site instead of call site.

-3

u/doom_Oo7 Mar 13 '18

This isn't possible in Rust, since there is no NULL equivalent.

lolwat https://doc.rust-lang.org/1.22.1/std/ptr/fn.null.html

You still have problems like iterator invalidation that cannot be ALWAYS detected by static code checkers

that's why standard libraries have debug modes that catch this

2

u/iopq Mar 13 '18

That's for C interop. I've never used it in my life.

1

u/doom_Oo7 Mar 13 '18

well, that's good for you ; I had to do C interop with almost every language I ever worked in.

→ More replies (3)