Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
enthe0s
Oct 24, 2010

In another few hours, the sun will rise!
So I'm starting out with Visual Studio for the 1st time and I'm wondering if anyone can give me a good reason as to why the comment/uncomment hotkeys are so idiotic. I'm coming over from SublimeText where 'Ctrl + /' either comments/uncomments based on whether or not the currently selected lines are commented or not. In VS, you have to start a "chord sequence" with 'Ctrl + E', and then if you follow that up with 'C', it will comment out the currently selected lines, but if you follow up with 'U', it will uncomment them instead.

Why did anyone think this is a good idea?

Adbot
ADBOT LOVES YOU

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!

bpower posted:

Nope, but its trivially easy to reassign keys via keyboard option menu. In the quick launch window (cntl+q) type keyboard, and go from there.

Sweet, I'm doing this ASAP.

Bonfire Lit posted:

My best guess is that they only wanted to use letters for shortcuts because depending on the keyboard layout, you might have to use a modifier to type other chars (for example, you have to hold shift to type numbers on AZERTY, and / is shift-7 on QWERTZ), and they ran out of letters so they had to use chords.

That's fair, but I'm still wondering why they wouldn't just use the same letter ('C') to toggle comments on and off instead of putting it on two different keys.

Maybe they wouldn't have run out of letters if they simplified :colbert:

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!

Jabor posted:

Because then you have to contextually decide whether the particular selection is currently "commented out" or not? I know I find it annoying when I want to uncomment a section, but Eclipse decides to add another layer of comments because one of the lines I selected wasn't already commented out.

The core of your complaint seems to be "they do it differently to what I'm used to" - which is a completely reasonable objection (and reason to want to change it), but doesn't mean that their way of doing it is bad.

So I'm coming over from SublimeText, and it has never had a problem trying to figure out if it should comment/uncomment depending on the context of what's highlighted.

I'm not averse to change, that's not my core complaint. My core complaint is that the very commonly used action of commenting/uncommenting code is no longer one hotkey, but now rather a hotkey followed by one of two modifer keys for a very binary operation (if commented -> uncomment, if uncommented -> comment).

I think it's bad because it requires the user to not only press more keys, but it also requires them to stop and make a secondary decision of remembering which key to press depending on what the current state of the code is (commented/uncommented).

It's like having Caps Lock be on Ctrl + C, U for uppercase and Ctrl + C, L for lowercase. It's explicit and it makes sense, but there's not much gained here than if the hotkey was just Ctrl + C and it was smart enough to toggle between the two depending on context.

I'm just trying to save my keystrokes and put off RSI for as long as possible man! :argh:

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!

Jabor posted:

I honestly don't buy that you select a block of text and then have to remember whether you're wanting to comment or uncomment it. That seems like more of a muscle memory "it's different to what I'm used to" thing.

Sorry, I think I was unclear in my explanation. I'm not saying that I just forgot what I wanted to do after selecting a block of code, I'm saying that I have to remember which key combination to press depending on whether the selected block is commented or not ("Is this block commented? Ok yeah, I need to press U. Is it uncommented? Oh, I need to press C instead). It's way better when I don't have to think about which hotkey I have to use and I just know that the same key will perform both actions.

But you're right, I think after doing it for a while muscle memory would take over so it becomes a non issue.

enthe0s
Oct 24, 2010

In another few hours, the sun will rise!

Look Around You posted:

But Comment starts with 'C' and Uncomment starts with 'U'? I mean I'd agree if it was like 'T' for comment and 'M' for uncomment or something like that, but I mean it's not...

The followup keys are intuitive, but it's the fact that it's 2 separate keys is the issue.

Look Around You posted:



e: what behaviour does a contextual one do for something like:

code:
if (x == 5) {
  // x *= 20;
  x *= 3;
  // return x + 3;
  return x + 20;
}
? I've never used that feature before tbh.

So if you highlight that entire block, Sublime comments all of that out, resulting in double commenting exactly like VS, which is fairly expected.

If you highlight an uncommented line, it will comment with Ctrl + /. If you highlight a commented line, it will uncomment with Ctrl + /.

Same hotkey, different result.

  • Locked thread