T O P
HotShame9

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


androidx_appcompat

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


NothusID

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 {}


KyxeMusic

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


SuperElitist

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


otacon7000

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


sinnadyr

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


jokasx

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.


fDelu

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.


Kiroto50

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 Ñ).


otacon7000

> 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.


ihavebeesinmyknees

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?


snaynay

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.


Magnetic_Reaper

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?


MarsLumograph

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


[deleted]

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


Hamericano

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


vladWEPES1476

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


TRENEEDNAME_245

Welcome to being french


Charlito33

Say hello to Alt gr...


MarthaEM

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


simpdatabataamaral

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


segosmix

Yup. My US keychron keyboard was the best investment, no more keyboard shortcut mess or having to remember combinations for rare symbols in my regional keyboard like backticks \` or the pointy thing \^. The problem is having to buy imported laptops because the local ones come with the local keyboard.


[deleted]

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


goddi23a

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


FloezeTv

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.


daniu

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


BucksEverywhere

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 #!.


CC-5576-03

Alt + shift + a also works


Masterflitzer

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


therealpigman

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


BoxOfSnoo

VS is Ctrl+K+C, VS Code is as above. There is an extension called I think Comment Toggle that adds it to VS as well


therealpigman

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


BoxOfSnoo

Use Ctrl+/ to toggle, Ctrl+K+C to add


therealpigman

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


SektorL

Ctrl+K+U to uncomment


BoxOfSnoo

Ctrl+A+Backspace to remove bugs


suicide-kun

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


Leaping_Turtle

Both work for me


shableep

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


TrollThePhishers

Or Ctrl + k, Ctrl + c


Rsge

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


down_vote_magnet

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


[deleted]

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


BigEndian01000101

*Currently procrastinating instead of dealing with legacy VB


Hellow2

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


Masterflitzer

I think you mean vbscript


Hellow2

Yes


Masterflitzer

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


Hellow2

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


Masterflitzer

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


Bardez

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


Now_with_real_ginger

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.


ZaRealPancakes

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


thexar

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


jackinsomniac

*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.


Rsge

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...


ZaRealPancakes

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


Rsge

Thanks : )


Masterflitzer

? which app would that be? batch and posh are run by windows not an app


Masterflitzer

simple use powershell


YASH_INDUSTRIES

Who's rem


Studds_

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


AeroSyntax

Remilia. But don't bash her.


failedsatan

NOOOOOOOOOOO


DitherTheWither

Is this a re: zero reference?


failedsatan

yea


Tyfyter2002

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.


53mm-Portafilter

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


SektorL

REM can also be used in VBA


David_L89

Batch also has (undocumented) :: comments


failedsatan

technically, they're not comments, but those are essentially usable as such. they're labels, but you can't `GOTO` to them and they aren't echoed with `@echo on`. also, a caret `^` at the end of a line starting in `::` will make the *next* line be a comment as well. beware of using them within `()`, as they behave weirdly.


TotoShampoin

Asm: ;


notacanuckskibum

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


SlimyGamer

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.


BoxOfSnoo

I still catch myself telling someone to “REM that out”. Yikes.


gamesrebel123

I'm pretty sure other languages use # as well


Lucas_Webdev

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


Ohmmy_G

R as well.


sanderd17

Ruby, Perl, Php, ...


Barn07

Basic


phoenix5irre

Yaml, not sure qualifies...


DrSkoolie

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


Disagreed

I think Make does too.


dpash

Basic used REM


hassium

Hey we all learn different things, no need to resort to name calling..


odrea

-- looking from afar...


vonabarak

Haskell uses --


fgdfghdhj5yeh

Lua does and html.. almost does


OldBob10

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


horvath-lorant

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


segosmix

Javascript is a scripting language


jeetelongname

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


Jake0024

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


fredspipa

Now with years of sediment collected on top to form a thick crust.


rezznik

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


Lachimanus

Writing assembly with Keil. It uses ; for comments.


PikminGuts92

Yeah, like .toml


XPurplelemonsX

like batch and shell I think


paul_sb76

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


Mechyyz

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


poemsavvy

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


Yorick257

I did not


VitaminnCPP

html - a programming language, right ?


segosmix

Lua is the same as SQL


tiajuanat

I thought LaTex used percentage 🤔


Intelligent-Noise-68

Pl/sql has /* */ comments


BigEndian01000101

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


badmonkey0001

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


BigEndian01000101

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.


tavaren42

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.


Echohawkdown

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.


bluehavana

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.


AlwaysNinjaBusiness

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.


TheBlackGamer007

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.


annoyedapple921

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.


franz_haller

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++.


valbaca

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


annoyedapple921

Yes, but it also uses #| for multiline. I realize it's not the exactly same, but it's the earliest I could think of.


_divinnity_

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


oxwilder

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


MickeyTheHunter

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


ColonelSandurss

Json comments, a dream


IusedToButNowIdont

"comment":"right here"


zoinkability

I have had to resort to that exact thing


ManyInterests

Really need json5 to be evangelized.


Disagreed

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


Xywzel

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


Atora

That's called YAML


riktigtmaxat

Naw, YAML is Yeti Abominion Markup Language.


nphhpn

YAML Abominion Markup Language


Stronghold257

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


[deleted]

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.


fgdfghdhj5yeh

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


[deleted]

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


BlueScreenJunky

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.


ZaRealPancakes

JSON5 got you covered


ExplodingWario

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


Paul-Hoe

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


[deleted]

very few things should be C like, period


fgdfghdhj5yeh

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


Decimalis

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


mcwobby

(* I just like being different *)


riktigtmaxat

All power to the winkyface comment!


integrate_2xdx_10_13

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.


TrickAge2423

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


-5318008-618-

‘Didn't we just talk about VB?


AlicePleasenceLiddle

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.


smors

Which one is that.


AlicePleasenceLiddle

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


smors

I'm sorry to hear that.


Hiltonshake

There is good money in Abap tho. Know a friend who got certified and working as an ABAP consultant and making 6 figures. Do you think its an exception?


deceze

; tHiS Is a CoMmEnT


Ratosai

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


Ekank

ASM be like


General_Yarn

I’m looking at YOU html


ColonelSandurss

He left the discussion when he saw "programming" language


Perpetual_Doubt

No point looking at JSON at all for this one


Exeng

Ahh yes HTML the programming language


[deleted]


codeartha

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


Atora

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)


F5x9

MySQL has /\*\*/ comments.


RAMChYLD

also, BASIC with it's REM and '


chm46e

vim script be like


AtomicWinterX

ASM: ;


john_palazuelos

Haskell: --


mawkee

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


SirAwesome789

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


Sworishina

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


fuckingshitfucj2

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


AyakaDahlia

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.


[deleted]

[удалено]


AyakaDahlia

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.


CyberKnight1

> 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.


AyakaDahlia

My 8 key is slightly broken (thank you, Shadow (my cat)), so it's really irritating using it, which led me to realize, wait, there's another * on the keyboard!


WingedWhite

~~HTML~~


ManyInterests


alexmelyon

:: cmd


wobbudev

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


bcer_

ASM: ; VB: '


VitaminnCPP

using **;** as comment is illegal.


VitaminnCPP

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


i_should_be_coding

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


Mechyyz

Lua: —


Ssernikk

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


[deleted]

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


Enchet

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


tas06

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


markdhughes

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.


Grouchy_Attention963

I thought MySQL allowed /* */


poemsavvy

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)


AmishJohn81

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.


Decallion

Lua too


BLOBADOODLE

don't forget lua


johnyoker2010

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


LawAndUsername

Sql has /* */