For the command below, the return value is the src_tag_group. But I can't understand this design. If I need to use src_tag_group later, I can directly use it. Why this function returns it again?
TagGroup TagGroupAddLabeledTagGroup(TagGroup tgt_tag_group, String label, TagGroup src_tag_group)
I can also only speculate, as a lot of the scripting language syntax and curiosities go back 20years or more. Clean-ups have been rare in this time, mainly because "backward compatibility" of old scripts was deemed a lot more important than having a super clean and logical naming and syntax convention.
However, while redundant, returning the (just added) source tagGroup allows for some convenient "pipe-lining" as well, which might be part of why it is like that. ( I do that in a lot of my own classes, rather than returning a void. )
Example #1 - Pipe-line convenience
Example #2 - Adding & Variable assignment in one line