-
Notifications
You must be signed in to change notification settings - Fork 404
Description
Visual Studio Version: 16.8.2
Summary
Visual Studio is a truly wonderful product, but some aspects of it cause hassles every week on average. Currently the GUI for Conditional Compilation Symbols in Project Properties window in Visual Studio (16.8.2) is inadequate and a hassle to use, and inconsistent with other parts of Visual Studio. It fails to support large projects that need a larger quantity of symbols. It is unfortunately only a textbox (and narrow), despite the fact that it actually represents a list of values. The current textbox suggests that only a single value should be entered, but in reality it's a case of a textbox being misused as a substitute for a list GUI. Screenshot:
To solve this problem, I suggest that the symbols textbox be replaced with a list GUI like the following mockup for C# projects:
For comparison, see also the preexisting list GUI for "Environment variables:" in the "Debug" panel in Project Properties of an ASP.NET Core project:
C# versus C++ Differences/Considerations
In C#, a symbol can only be enabled or disabled (boolean), whereas in C++, a value can be assigned to a symbol. I began my career using C++ but I mostly stopped using C++ long ago because I noticed that my productivity was much better when I used C#, thus the GUI for C++ projects is unimportant for me, but anyway, for people who still use a lot of C++ code, remember that C++ symbols allow a value to be assigned to each symbol. Thus the GUI for C++ symbols should be like the above "Environment variables" screenshot, whereas the GUI for C# symbols can be a list of tickboxes/checkboxes. Here is a mockup for C++:
Alternatively, you may wish to use the same symbol list GUI for both C# and C++ projects. This is also a good idea. Thus the symbol list would look like the above two-column mockup regardless of whether it is for a C# or C++ project. However, if it is a C# project, Visual Studio would limit the user to entering only a boolean true or false value for each symbol (not an integer value). If it is a C++ project, Visual Studio would allow the symbol value to be true or false or an integer.
Example C++ Code | Value in new GUI in VS |
---|---|
#define EXPERIMENTAL |
true |
#undef EXPERIMENTAL (or otherwise not defined) |
false |
#define XYZ_VERSION 5001 |
5001 |
Re Multiple Configurations in a project
Regarding multiple Configurations in a .csproj (such as the "Debug" and "Release" Configurations), the list/names of Conditional Compilation Symbols should be the same for all Configurations, except that the tick/value of the symbols should be different for each Configuration. For example, the symbols DEBUG
and TRACE
should appear in the symbol list regardless of whether the current Configuration is "Debug" or "Release", but when the "Release" configuration is chosen, the DEBUG
symbol would be shown as unticked or Value=false. Thus when you use the GUI to view a different configuration, only the tick or value of each symbol should change, not the symbol names nor the quantity of symbols.
Alternatively, if compatibility reasons or other reasons lead to a final decision to store a completely separate symbol list for each Configuration, then this would still be OK provided it has the ability to enable and disable each symbol without deleting symbols from the list.
Steps to Reproduce
- Open the Project Properties window of a project.
- Click "Build" on the left.
- Look for the textbox "Conditional compilation symbols".
- Notice how awkward this textbox is, especially when it contains more symbols than fit in such a narrow textbox.
- Notice how VS does not provide any way to disable a symbol without deleting it from the textbox.
Expected Behavior
- Support a larger quantity of symbols, for example 10-20 symbols, in a manner that isn't awkward or inconvenient or a hassle.
- Support the ability to enable and disable symbols without deleting them from the Project Properties window.
- Preferably show only different values (not names) of symbols when the user views a different Configuration. Preferably have the same list of symbol names for all configurations, but different symbol values for each Configuration.
- Respect the standard practice of using a list GUI to represent a list, instead of using a textbox to represent a list.
- Be consistent with other parts of Visual Studio, such as the aforementioned "Environment variables" GUI.
- Use a self-explanatory GUI. Do not use "secret" non-intuitive practices in GUI, such as visually appearing to support only a single item (a single textbox) but actually supporting multiple items if the user knows the special "secret" such as using special punctuation (semicolons) to separate multiple items in the textbox.
- Do not require users to continue to remember the details of special punctuation rules such as whether the names in the textbox should be separated by space, comma, or semicolon. Do not confuse users whenever users accidentally use a comma or space instead of a semicolon. Use a self-explanatory list GUI instead of hidden/special punctuation rules.
Actual Current Behavior
- A larger quantity of symbols (such as 10-20 symbols) is not truly supported in practice. Technically it is supported but it is impractical, especially considering how narrow the textbox is.
- Whenever you need to temporarily disable a symbol, you're forced to entirely delete it from the textbox, meaning there is no way to temporarily disable a symbol without deleting it.
- The GUI (that textbox) is a non-standard way of representing a list of items, and it is inconsistent with other parts of Visual Studio.
User Impact
- Large projects need a larger number of symbols but the narrow textbox makes it difficult for users to manage more than 2 or 3 symbols.
- Users are mistakenly led to believe that Visual Studio doesn't really support large projects, because this part of the GUI is currently designed for only 2 or 3 symbols.
- Users lose information whenever they need to temporarily disable a symbol, because VS forces users to entirely delete the symbol instead of allowing symbols to be disabled. Users suffer loss of productivity when they later re-enter the symbol and accidentally enter the symbol name slightly different than it was previously. For example, users can't remember that the EXACT name of the previously-deleted symbol was (for example) "WINDOWS_UWP" and not "UWP". Users temporarily delete "WINDOWS_UWP" and then later accidentally re-enter it as "UWP", causing time lost to troubleshooting.
- Users (even experienced users) are confused whenever they forget that the special "secret" punctuation is semicolons, and they accidentally enter commas or spaces instead of semicolons.
- New users or beginners need "secret" knowledge to know how to enter multiple items in the textbox, because the GUI is not self-explanatory and not intuitive.