Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Adding member functions/fields from use cases, C++
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

GennadiyKorol
Ketchup Master

Israel
54 Posts

Posted - Jul 15 2008 :  5:40:01 PM  Show Profile  Reply with Quote
Hello everyone,

I just can't stop sharing ideas, as even a small chance of them being implemented is well worth it.


This one is a slight modification of existing add member functionality in VAX.


Consider the following project. We've got the Banana and Kitchen classes. Right now we're working on the Kitchen::prepareShake() function, using Banana class:



void Kitchen::prepareShake() {
   Banana banana;
   banana.peel();

   int pieces = 10;
   Knife knife;

   // peel() function is defined in Banana class, everything's OK.
   // But cutToPieces is not yet defined...
   // We're going to write this:
   vector<EatableHandle> pieces = banana.cutToPieces(knife, pieces);
}


Now we'd click over cutToPieces and pick "add declaration"
and Visual Assist X will thoughtfully add the right signature to Banana.h file (possibly with a stub):


// in Banana.h
vector<EatableHandle> cutToPieces(Knife & knife, int pieces); 


Then one could use the great "Create implementation" feature to implement the banana-cutting routine.

Being able to check output and input parameters as passed by reference and being const would also be a great feature.

Suppose now our project contains Worker class for people working in the kitchen, containing the Worker::taste(Tastable & food) function.
Now we continue working on our Kitchen::makeShake() method and do this:



void Kitchen::prepareShake() {
  // Previous code as before.... shake variable contains the prepared shake.
  // We type this:
  worker.taste(shake);

}


Now clicking over worker we can use "Add field" or existing "create declaration"
This would add a Worker worker; member to the Kitchen class. Letting VAX figure the type of worker using the methods we used on this would be of tremendous help. If it couldn't resolve the type, a pop-up might be use where user can pick the type for the new field.

Same could be used for "Add local" / "Add parameter" features, being able to specify if we want to add Worker worker as a parameter to the current function (maybe by reference, as const?) or as a local variable initialized somewhere before.


ADD: While we're at it, can we make change signature also work by context? So if the caret is over the function banana.pe[]el() VA would recognize and let use change the signature of the peel function for the banana class.


This is essentially my vision of it, the goal is to let the editor figure most of the information about the symbol on its own, essentially letting the user focus on his code logic and not the technical details.

Hope that wasn't too long...
Thanks for reading,
Gennadiy

Correctness might be a theoretical concept but incorrectness has practical implications.

Edited by - GennadiyKorol on Jul 15 2008 6:15:08 PM

GennadiyKorol
Ketchup Master

Israel
54 Posts

Posted - Jul 16 2008 :  3:41:03 PM  Show Profile  Reply with Quote
Ignore the add in the previous post, I can see that the newer build recognizes symbol under caret and allows changing the signature. Greato :)

Correctness might be a theoretical concept but incorrectness has practical implications.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Jul 17 2008 :  5:48:41 PM  Show Profile  Reply with Quote
We are considering a feature to create a function, where VA tries to work out the return type and the parameters:

case=2451

If I understand correctly this will do what you are looking for.

zen is the art of being at one with the two'ness
Go to Top of Page

GennadiyKorol
Ketchup Master

Israel
54 Posts

Posted - Jul 19 2008 :  1:05:07 PM  Show Profile  Reply with Quote
Yeah, but I also wanted to suggest that for variables/fields as well. So VAX could figure out the variable type from the way it is used.


Like if it's passed to a function, you can deduce its type from there. If a function is called on the object, deduce the type according to function (resolve ambiguity with a pop up list). Etc.

Correctness might be a theoretical concept but incorrectness has practical implications.
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18947 Posts

Posted - Jul 21 2008 :  2:29:05 PM  Show Profile  Reply with Quote
We are considering doing this for variables as well:

case=3964

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000