Home » Developing U++ » U++ Developers corner » [REJECTED]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye) [message #46036 is a reply to message #46032] |
Sun, 21 February 2016 17:23   |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Novo wrote on Sun, 21 February 2016 17:11Hi Oblivion,
You've added virtual destructor, which is IMHO not necessary. It will just add an extra pointer to your data structure.
I'm just curious, why you cannot use plain Vector<Any>?
Hello Novo,
Thank you for your comment.
Yes you are right, it is unnecessary in this case; a relic from its first version I've forgotten to delete. Thanks for pointing out!
As to your question, well, there are mainly two reasons why I do not want to use plain Vector<Any>:
First, as you can see, VarArgs is a convenience class/wrapper. It simply hides the unnecessary interface/clutter of Vector, which is huge, and allows a rather goal oriented, limited interface.
This brings me to the second reason: semantic considerations. Think of VarArgs as something like the Id class, which is actually a String, in the Core package. But unlike Id class,
VarArgs has a specific set of methods, and announces its purpose: It stores arguments for methods, or functions in a dynamic manner. Nothing less, nothing more.
From a newcomers perspective, when all you want to do is to use variadic functions, whose macros are not very safe and trying to find an equivalent for them in U++, where would you look at first?
Would you read through the whole documentation, and try to figure out which combinations will work? (This is what ought to be, but we are living in a world where time is precious.) It would be time consuming to read through the whole documentation of Vector, which is rather huge, and Any. Having specific classes under your reach for widely used programming techniques is, I believe, the goal of rapid application development frameworks, and U++ usually excels at this. Aside from that, it improves the source code readablity.
Regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Sun, 21 February 2016 19:24] Report message to a moderator
|
|
|
 |
|
[REJECTED]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Oblivion on Sun, 21 February 2016 14:46
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Novo on Sun, 21 February 2016 16:11
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Oblivion on Sun, 21 February 2016 17:23
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Novo on Sun, 21 February 2016 19:42
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Oblivion on Sun, 21 February 2016 21:34
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Novo on Thu, 25 February 2016 05:10
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: mirek on Mon, 22 February 2016 20:34
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: Oblivion on Thu, 25 February 2016 21:35
|
 |
|
Re: [PROPOSAL]: VarArgs class for U++ (va_ macros replacement, in U++ stlye)
By: mirek on Fri, 26 February 2016 11:10
|
Goto Forum:
Current Time: Sat Apr 26 19:39:25 CEST 2025
Total time taken to generate the page: 0.00376 seconds
|