Maybe it's a bug, not a feature. We simply don't know,

They calculate the number of Sneak attack dice per level, they just need to set that number to roll that number of 6 sided dice.
It's not that complicated, at least in my opinion.

But I am completely with you here spectralhunter, I also don't know a thing about coding apart from 'Hello world', so I am not in a position to really tell.

I don't know if they use it somewhere else.
My PC broke down before Christmas and I wasn't able to build a new one till now (waiting on the graphics card).

But once again I have a PC I want to play BG3 and have a good look at stuff like this.