[x3d-public] C++ SAI: setters and addChildren return void

John Carlson yottzumm at gmail.com
Sun Dec 15 02:05:30 PST 2024


This link discusses many options for C++.  If method chaining is not
preferred, how about examples with “auto “?  See link.  I don’t really know
about auto, since my C++ knowledge dates from the 90s.

https://stackoverflow.com/questions/2279180/does-c-have-with-keyword-like-pascal

I don’t mind code generation, indeed, if void is promoted in the standard,
I would be happy, because my generator and parser already work.

John

On Sun, Dec 15, 2024 at 3:29 AM John Carlson <yottzumm at gmail.com> wrote:

> I had a look at:
>
> https://github.com/Web3DConsortium/X3D/blob/master/ISO-IEC19777/ISO-IEC19777-4/ISO-IEC19777-4v3.3/ISO-IEC19777-4v3.3-IS/Part04/abstracts.html
>
> I have some comments from a usability position.
>
> For example, not returning “this” from setters, addChild and other adders
> (I think only addChild does not exist), while good for debugging, requires
> a lot more duplicated code, in the form of repeated use of variable names
> in the code.  Please make me aware of examples if this is not required.
>
> Here is an HAnim example:
>
>
> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/cplusplus/net/coderextreme/data/JinLOA4.cpp
>
> I don’t know if C++ contains the concept of Pascal’s “with” (creating a
> context or namespace where repeated use of a variable name is not required)
> and should would be documented in any C++ examples produced by the
> Consortium (IMO).
>
> Is there going to be an X3D XML to C++ stylesheet converter to give best
> practices, or are we on our own?
>
> John
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20241215/f23eae38/attachment.html>


More information about the x3d-public mailing list