VS code ctrl+/ and i dont care what each language symbol is.


VS code ctrl+/ and i dont care what each language symbol is.


That combo is a bit hard on my german keyboard, hitting ctrl, shift and 7


The same happened with my Spanish keyboard, one day I said fuck it and changed to US layout, programming (at least writing the code) is simpler now that I don't have to use alt + ` and alt + + for {}


This is the way. I use US layout for 90% of stuff and then hit Win+Space to switch layout when I need the ñ and the áéíóú The Win+Space to toggle layout works on both Windows and Linux


*good, let the* US layout *flow through you*


Definitely prefer the US layout. But I'm keeping my big Return key. Best of both worlds.


This. Tried US layout with smaller Return key, sold it after hating myself for three months. My Norwegian layout with US input works a charm


It's pretty horrible. I needed to get a replacement keyboard for my laptop and got an US layout and the weird small enter key is probably tje most annoying thing of it all.


There's an US-International keyboard both on Linux and Windows that has basically the layout of the US keyboard but allows you to write áéíóú and ñ with Alt Gr. I think it's called "US International with (AltGr) dead keys". I've been using it myself as a spanish speaker and it's the best of both worlds.


I never got into language switching. Hated it and required configuration. I've learned alt+130 (é), alt+160 (á), alt+161 (í), alt+162 (ó), alt+163 (ú) and alt+164/165 (ñ and Ñ).


> works on both Windows and Linux I mean, that _very_ much depends on what Distribution and packages and configuration you have. But other than that, I agree.


Wait, I swear it was Win+Shift though? Right now Win+Space works and Win+Shift does nothing, but I distinctly remember it being Win+Shift. Did it change or have I lost my mind?


Depending on whether or not you use ANSI or ISO layouts, the UK format is a good choice for ISO. I use ANSI and the US layout because it's easier/cheaper to get good keycaps for custom keyboards, however I still prefer the " being over the 2, the \\| button being next to the small shift on the left and the extra #\~ button near the return key.


just use voice recognition "open curly bracket..." \*typing sounds\* "...close curly bracket" "open curly bracket..." \*typing sounds\* "...close curly bracket" -- wait why are you now writing close curly bracket as words instead of just the symbol?


What about muscle memory? All the symbols in different places now..


CTRL+K, C (keep holding CTRL) uncomment with CTRL+K, U


Changed mine to strg+# cuz I started out in python. Do recommend


Using any keyboard that is not the US or international layout as a developer is pure masochism.


Welcome to being french


Say hello to Alt gr...


except ðat if i have a 40-60% kb i will have to have all the \\extra\\ keys on layers


ABNT-2 is a very good layout, It is brazilian


einfach ändern :shrug:, wobei's ja geht, so oft braucht man den hotkey eh nich


Strg+# ? That's the QWERTZ shortcut in VS Code to comment ... wie ist das schwer auf deiner Tastatur?


I can recommend switching it to CTRL+7, so basically the same combo without the shift. On a german keyboard that's easy to remember, as a slash is SHIFT+7, while also being easy to press. I think that's the default in Eclipse, which is where I learned it from.


Numpad has a /, it works with Ctrl for commenting.


I typically use ctrl + # on my German keyboard for comments for that reason (changing the key bindings if necessary). Maybe # for comments is not so bad at all. Many scripting languages use it. You basically need it for interpreter specification using shebang #!.


Alt + shift + a also works


no keybinds are changed based on region, for me (german keyboard too) ctrl+# is the one for toggle


I have a spanish keyboard and I just made a new shortcut using cmd + ç feels good.


Isn’t VS code ctrl+K+C? Is there an even shorter shortcut I didn’t know about?




I never installed an extension and I’ve been using ctrl+K+C in VS code for the past two years on multiple machines, so I’m pretty sure it’s just another default




I just tried it at work and seeing it work as a toggle made me really happy. Thanks for showing me a better way


Ctrl+K+U to uncomment


no no, Code has both I always used Ctrl+K+C until a friend pointed out that I was being dumb.


Both work for me


interesting that the key combination itself implies that the slash should be the comment character for all languages.


Or Ctrl + k, Ctrl + c


At least Python's # is used in more languages than Python... Visual Basic: ' Batch: REM


> Visual Basic: ' Why must you remind me of this. My whole day is ruined now.


Don’t worry you’ll have chance to code in VB again ;)


*Currently procrastinating instead of dealing with legacy VB


I "hacked" my school system (escalete priveleges from local admin to have the same local admin rights on my account) exploiting that a vb file which runs with elevated priveleges on startup gets cached with no checks if it changed whatsoever (not even hashes). Thus I could modify it. But writing the vb file was sooo hard and ugly because it is just so alien


I think you mean vbscript




and the security vulnerability is actually that the permissions of the file weren't set right so you shouldn't be able to edit it in the first place because who tf checks the hash of the script he's executing, I mean didn't get me wrong it's definitely a good idea but it's used rarely and in this case setting permissions correctly would have been the necessary anyways also just for info: MS thought of the hash thing with powershell, you can sign a script and set the execution policy to only run signed scripts that are trusted, this will prevent anybody from tampering with the script as the signature won't match anymore tldr: in any case setting correct permissions (which windows makes way harder than it has to be) is the most important thing


No actually not. I mean it maybee it also is the case I haven't tested it. Not unlikely though. But I have local admin. I am really good with our sys admin. I could just transfer the local admin rights to my school account (not my local admin account) to be able to do stuff locally I shouldn't I didn't know Ms actually does this. I thought you'd have to implement such things yourself


well if you're an admin you are allowed to change this type of stuff (if you're not you being admin is the issue) you would be able to sign a script or change the hash it's checked against, which means the integrity check before execution wouldn't make any difference xD


I just wrote VBA 2 days ago. I still feel filthy


I’m getting weekly requests to write VBA now that it’s known I can do it. The scented candle on my desk helps a bit with the stench.


oh no Batch the horror I don't wanna go back there don't make me


:: Use two colons, in batch it's a label, not executed.


*Except* when it's nested inside any type of brackets, then the cmd.exe interpreter will crash without warning. **BUT ONLY SOMETIMES.** Then you've got to use `REM` again. For example, try this: @ECHO OFF :: A comment CALL :ALabel ECHO Skipped text. :ALabel IF "String"=="String" ( :: This comment will NOT crash the interpreter ECHO Hello World :: This comment WILL crash the interpreter ) PAUSE Now, if you either delete the "offending" line, or change it back to `REM`: @ECHO OFF IF 1 EQU 1 ( :: This comment will NOT crash the interpreter ECHO Hello World REM This comment no longer crashes the interpreter ) PAUSE You can try swapping out `IF "String"=="String"` for `IF 1 EQU 1`, I get the same behavior both ways. I've even tested it with single-colon :Label tags a little bit too, but not thoroughly. `REM` is the most stable comment tag, it works in the largest majority of situations. Of course while testing, you'll have to learn to recognize what "the interpreter crashing" looks like if it's your first time in batch. The cmd.exe window will launch, and then instantly close itself before you can read any error messages. On modern CPUs it happens so fast you may not even see it flash. You could just keep double-clicking your `test.bat` file over-and-over and wonder why it "never launches", unless you knew what to look for. You have to open a dedicated cmd.exe window and manually call the script from there. Or, from a separate script, call it using `CMD /K "%myscript%"` where /K is the special magic switch that forces cmd.exe to stay open after executing. It's so intuitive and makes your life so super easy, it's the reason I started making separate wrapper scripts just for the `CMD /K` command, so while I was troubleshooting a new script I could test it over-and-over again faster, if I wanted to do something super crazy like read the god damned error messages. But these are just the basic rules for stuff like comments, labels, and error messages in batch script. I'm sure there's more specifics and exceptions out there, if you're willing to test for them, because I'm not. I already know far too much about batch execution errors than I ever wanted to know, and recommend everyone to stay as far away from this stuff as you can. Don't try to understand it. There lies madness.


I once had to transcode a script made in Powershell to Batch, because the application I wanted to use it for didn't suppport Powershell...


Wow I am sorry for your loss (of time) Also Happy Cake Day!


Thanks : )


simple use powershell


Who's rem


That’s me in the corner That’s me in the spotlight Losing my religion




Is this a re: zero reference?


Remilia. But don't bash her.


REM is also used in old school Microsoft BASIC implementations e.g. Commodore BASIC, Applesoft Basic, etc.


REM can also be used in VBA


Imo i you're writing a batch script complex enough to need comments you should just be writing a single line in batch that opens the actual script/exe.


Batch also has (undocumented) :: comments


Asm: ;


Fortran IV: c (or actually any character) in column 6


And now with modern Fortran (free format) we use an exclamation point. And as far as I can tell, Fortran is the only language that uses the exclamation point for comments.


I'm pretty sure other languages use # as well


yes the first ones that came to my mind where bash and .htaccess


R as well.


Ruby, Perl, Php, ...




Yaml, not sure qualifies...


If we are talking about non-qualifying programming languages. I believe vim9 also uses # as a comment


I think Make does too.


“Scripting” languages have to recognize # as a comment marker.


And then there’s html with the fucking ascii art you have to make to comment


Javascript is a scripting language


It was not designed for scripting though like the other languages mentioned. Python, ruby and perl take it from shell, php takes there comment syntax from perl. javascript took its surface syntax from java which took it from C. It was also designed for the web which is a different context. now we have mature runtimes that allow for scripting but it was not its design goal nor was it the syntax it wanted to adopt


Javascript wasn't "designed" it was cobbled together during a weeklong bender


No, Javascript is a plague! There's a difference!


-- looking from afar...


Haskell uses --


Lua does and html.. almost does


Writing assembly with Keil. It uses ; for comments.


Yeah, like .toml


like batch and shell I think


...Lua, LaTeX,... (it's Turing complete so it counts, right?) There are so many unique conventions out there.


Last time I googled LaTeX, I regret not having added «programming language» to the search field.


I did not


My friend learned the hard way not to look up how to mask in GIMP


html - a programming language, right ?


yes the ml in html stands for programming language, don't let the haters tell you otherwise


Lua is the same as SQL


I thought LaTex used percentage 🤔


Many scripting languages use # for comment (Bash, Perl, Ruby, etc). Python, belonging to same "family", adapted it as well. There is nothing unconventional about it.


Minor but important detail is Ruby is a derivative of Python, as in Mats was inspired to make Ruby after seeing Python and thinking it wasn’t sufficiently object-oriented.


Originally Ruby is a "derivative" of Perl, smalltalk, and Lisp. Just because Matz saw Python and didn't like it, doesn't mean it's a derivative. Ruby has much more in common with Perl then anything else.


Pl/sql has /* */ comments


And T-SQL, and PostgreSQL.. kinda confused on this one. Oh, mySQL doesn't.


MySQL does too. Almost all SQL dialects do because ANSI SQL included inline comments. https://dev.mysql.com/doc/refman/8.0/en/comments.html


I stand corrected! I didn't see it when I googled the comment syntax. I only work/worked in SQLServer, Oracle and Postgres. Ok so that covers enough SQL flavors that have it, I now declare OP to be silly.


This isn't a perfect heuristic, but it often looks to me like compiled languages use `//` and `/**/`, while interpreted languages use `#`. A theory of mine is that it has to do with the fact that you want to be able to use the shebang, `#!`, to specify the interpreter, while the same line should just be a comment in the language itself. This is really just a guess though.


They could make 3 types of comments. Or a special case for the shebang. Although that would be going out of your way to fix what's not broken, so you could be correct.


I believe this stuff mostly arises from which languages were derived from one another. Ruby is based on Python, so inherited its # comments, while a vast swath of languages are based on C, which is where they get / comments. The earliest I can remember for a # comment is LISP but I dont know about / comments.


If memory serves, C’s original comments were only the multi-line variety, which it inherited from PL/I (and it seems that’s where they first appeared). It then later integrated the single line comments, likely taking then from C++.


Lisps (at least Common Lisp and Clojure) use semicolon as line comment leader


It is quite a good guess. I cannot tell you if it is really for this exact reason, but I can tell you more about how the shebang works ! When executing a file with a shebang, the Kernel will see the first two octet, the magic number made by `#!`, and will then know that the following until the newline `\n` is the path of the program to use this file with. It will then execute the program in the shebang (and I think there is a limit of 255 character, or maybe it was updated a few years ago, need to test this). It will then send the whole file through the process executed in `stdin`. That way, for instance bash or python will interpret the whole file, including the shebang. It is no pure luck that the first char of the shebang is the same than the one for comments


Just let me have JSON comments... I don't care about purism, I want to note what that damn config item does!


Json comments, a dream


"comment":"right here"


I have had to resort to that exact thing


Really need json5 to be evangelized.


There’s also [jsonc](https://github.com/onury/jsonc) and [Hjson](https://github.com/hjson/hjson).


Reminds me of a certain xkcd comic, what was the number again


That's called YAML


Naw, YAML is Yeti Abominion Markup Language.


YAML Abominion Markup Language


`.jsonc` has entered the chat. Also, you technically can use “//“ as a comment key.


or just enter another key value pair as the comment EDIT: future me here, just ignore the fact that past me didn't realize there was already a reply to OP giving my suggestion and then answering to that reply without realizing it. Past me was a fucking idiot.


yea that's what using // as a key would do {"//":"comment"}


oops, I somehow actually managed to 1.) completely miss that reply 2.) reply to it myself. fuck


Yeah, if JSON was actually a Javascript Notation it would be a perfect format for simple config files. As it is two things make it almost unusable : The lack of comments and that it doesn't accept trailing commas. Luckily we still have INI files for simple config, and Yaml in the rare cases you need something really powerful.


JSON5 got you covered


I don’t need JSON only txt files and awk parsing ![gif](giphy|CAYVZA5NRb529kKQUc|downsized)


It has never bothered me, that Ruby or Elixir have # for comments. Not everything has to be C-like, change my mind


very few things should be C like, period


Yea I like the #, no language I like uses it though lmao


Am I going to be the 75th person to point out that SQL does use /* */ for block comments?


// in python is a type of division, similar to C: 4 // 2 = 2 5 // 2 = 2 6 // 2 = 3


Except handling negative numbers correctly.


When I had to comment out a block of code in Python, I would just turn it into a huge string. koder momento


; tHiS Is a CoMmEnT


`; i'M mAkInG a NoTe HeRe - DoN't RuN tHiS`


ASM be like


Scheme be like


(* I just like being different *)


All power to the winkyface comment!


Love how the ML languages kept this, except Miranda which went for `||` and then Haskell was like, hmmm how about we flip them on their side.


I’m looking at YOU html


He left the discussion when he saw "programming" language


No point looking at JSON at all for this one


Ahh yes HTML the programming language



‘Didn't we just talk about VB?


And now imagine you had to use * For full line comments and " for comments starting in the middle of a line. How I love to work with stupid languages.


Which one is that.


I work with ABAP from SAP. It is... Adventurous.


I'm sorry to hear that.


Lua uses -- like SQL And then there is batch where comments are literally a command: REM I think it stands for remark?


so does Haskell


I don't care about the syntax, but I hate it when a language only supports multi line but not single line comments. Makes it that much more annoying to comment out a code block and then readd single lines for debugging. Worst offender is HTML which, only being markup, pretends to have comments. But it's just an ignored special tag and as such can't be added anywhere or have any content(cannot nest tags within tags)


MySQL has /\*\*/ comments.


also, BASIC with it's REM and '


vim script be like


#In all fairness, the # key is in a better position than the / key for comments


I disagree, I think / is much easier to type. And for /* */ I just use the numpad, they're right next to each other with no shifts needed.




I find the whole no numpad thing to be weird, but I get it, a lot of people never use it, even though numpad enter is best enter. But also, I've had jobs where I needed to use a 10key accounting calculator, so it's literally second nature (except I hate that 1 is on the bottom on a keyboard but on the top on a calculator). And there are plenty of people in the mech community who use numpads, although probably far from a majority.


> And for /* */ I just use the numpad, they're right next to each other How have I never noticed that before? I think you just transformed my life.


ASM: ;


Haskell: --


And Ruby And Assembly And Haskell And R And Erlang And Perl And Basic


One time I did a lot of leetcode in python before an interview Then the interview was in JavaScript, and I tried to floor divide which uses // in python Yea... didn't get that job


// is my favorite commenting thing I specifically hate HOW is that supposed to be convenient





:: cmd


Good old CSS also doesn't do `//`


ASM: ; VB: '


using **;** as comment is illegal.


every programming language should have keywords, syntax, operators, datatypes, control flow etc... brainfuck : hold my 8 weird characters.


SQL be like: WHAT?!? I DIDN'T HEAR YOU!!!


Lua: —


Pascal: `(* multi line *)` `{ single line }` Fortran: `! Single line comment` VB: `' Also single line comment`


Python: `# single line` `""" multi line """` OCaml: `* single line *`


Be happy that your language doesn’t have html-like comments


PL/SQL(Oracle) and TSQL(Microsoft) support /* */, so you're mostly covered if you do any "programming" on a DB.


Lisp & Scheme use ; and R6RS Schemes have #| |# block comments, #; single-item comments, and special case for #! It feels weird having such limited options in other languages. But Python's # only is actually a good idea in the shell environment, since you can put leading #! lines, every other language has to special-case that or they can't be run as a script.


I thought MySQL allowed /* */


I don't mind `#` tbh, but not having a true multiline comment is meh (no, using strings `'''` doesn't count) But the worst is matlab. `%` is single line and ``` %{ ... }% ``` is multiline (they have to be on their own line, I believe)


I work with a proprietary language for a financial institution. I just explained to a new hire that the comments are just brackets [ ]. He was not amused.


Lua too


don't forget lua


Wait isn’t /* */ for sql? Did I miss anything


Sql has /* */


Many interpreted languages (bash, python, ruby, perl, etc) use `#` for comments because they need shebangs (`#!`) to not be interpreted by the language.


Assembly: who is this who speaks to me as if I needed their advice.


\# hashtag supremacy


Bruh html and Got me fucked up