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
 Stupid autotext entries?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

znakeeye
Tomato Guru

379 Posts

Posted - Sep 22 2007 :  08:23:38 AM  Show Profile  Reply with Quote
In Win32 programming (especially MFC) integers are often prefixed with an 'n'. Many APIs require flags, so here we usually have an 'nFlags' variable (See CWnd::OnKeyDown etc).

Ok, so what happens when you type this?
nf<enter>

You get "!= false". Maybe it's just me, but I think the following autotext entries should be removed: nf, nt

sl@sh
Tomato Guru

Switzerland
204 Posts

Posted - Sep 24 2007 :  04:54:17 AM  Show Profile  Reply with Quote
Ummm, I dunno - maybe it's just me, but aren't tools like VA meant to make those annyoing prefixes obsolete? I mean, just hover over your variable, and you get it's definition displayed as a tooltip! I even know people who argue the same way about 'm_' as a prefix to member variables, although I still consider this a useful paradigm.

Anyway, typing a shortcut and immediately pressing <enter> assuming there would be just one possible autocompletion strikes me as ... hasty. I'd at least wait for the suggestion listbox to show up!
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18939 Posts

Posted - Sep 24 2007 :  1:11:15 PM  Show Profile  Reply with Quote
Answer 1, the default autotext entries are simply that, a set of defaults. They are there to give you ideas and get you started. Delete the ones you don't want, edit the ones you use, and add new ones to be helpful.

We are moving to a much smaller default list of autotext entries in a future build of VA, but this is not guaranteed to solve this problem in general. After all you may start float and double variables with 'f' which is also a good trigger for the autotext entry "false".

Answer 2, sl@sh I stick with this type of naming convention in my code for the following reasons:
* I used to do a lot of cross platform development. VA does not work so well on a UNIX dumb terminal inside VIM
* typing just the type prefix can be a good way of helping VA to suggest the correct item - this varies a LOT with your code base though
* I currently spend a lot of time working in VBScript (our automated testing tool uses it), and since everything is a Variant in VBScript I need to know what type I think a variable is

Answer 3, the only thing you can safely assume will turn up when you type nf is an autotext entry with this shortcut. Suggestions, which is what you are clearly hoping for, are VA's best guess, but since they are an educated guess it is unwise to assume you will get what you want. A lot of the time you will, but it depends on context, typing history, etc. As sl@sh says, it is wise to check what is being suggested before accepting it.

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