Use of -1 to express edge cases in computer programs and data structures
Most PL folks would probably suggest that an option type is better suited.

For instance, in Haskell you'd use a Maybe T type: you use Nothing instead of -1, and Just x instead of x.  In SML, you'd use a T option type, and use None instead of -1 and SOME x instead of x.

The benefit of this is to better document the meaning of the sentinel value, and also to force the programmer to consider both cases everywhere it is relevant.  This helps avoid certain kinds of programming mistakes, where a -1 value is inadvertently used as if it were a real value.  It also ensures that the domain of the type T is separate from the sentinel value.

In a language without an option type, you can also use tagged unions or other methods of encoding this into the type system or class hierarchy.

That said, this is a pretty subjective question.  Opinions will vary.  You should not expect everyone in a field to share the same opinion about a subjective matter like this.