T O P I C R E V I E W |
znakeeye |
Posted - Sep 22 2007 : 08:23:38 AM 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 |
2 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Sep 24 2007 : 1:11:15 PM 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. |
sl@sh |
Posted - Sep 24 2007 : 04:54:17 AM 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! |
|
|