Disappointed with Path

TL:DR

Such file paths, when input by users or discovered from directory searches and so on, are inputs to a program. As such they should be checked for validity as much as all other inputs to programs.

It's amazing how frequent such "rare edge cases" can be. Especially when there are millions of people using billions of files originating from God know what operating systems. Far better things are checked properly if one want robust code. As Rust uses do.

It's not clear to me how that is so. Admittedly a lot of example codes for almost anything in Rust omit any error checking and just use unwrap(). But that is traditional in example codes in all kind of languages where error checking is not included for the sake of clarity in the example

Perhaps users of Rust programs would rather have a meaningful error message/dialog and not have the program they are using just crash. Depends what one is creating I guess.

My view of a systems programming language is that it can be used to create the operating system that implements and maintains such file paths. Not just consume them like any old application program.

I presume you don't mean "unsafe" there as in the Rust concept of "unsafe" and the unsafe keyword?

13 Likes