Comment

Comment by virtualritz

While wrapping parts of OpenSubdiv for Rust [1] I noticed the C++ API was littered with uses of int for indexing/lengths (both are always positive) of geometry buffers.

So I opened a ticket with Pixar [2].

Some of the same strange arguments were brought forward (incl. the Google style guide BS). I wrote a longish reply [3] that mentions two comments [4,5] from an ill-guided article promoting use of signed in C++.

I closed the ticket in the end because I felt that if people really believe there are good reasons for signed in the cases at hand they haven't grokked the problem sufficiently – trying to convince them otherwise would not be a good use of my time.

[1] https://crates.io/crates/opensubdiv-petite

[2] https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1...

[3] https://github.com/PixarAnimationStudios/OpenSubdiv/issues/1...

[4] https://www.learncpp.com/cpp-tutorial/unsigned-integers-and-...

[5] https://www.learncpp.com/cpp-tutorial/unsigned-integers-and-...

parent virtualritz 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton