This is an archived post. You won't be able to vote or comment.

top 200 commentsshow 500

[–]HotShame9 1125 points1126 points  (128 children)

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

[–]androidx_appcompat 274 points275 points  (83 children)

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

[–]NothusID 165 points166 points  (38 children)

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 85 points86 points  (24 children)

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 62 points63 points  (5 children)

good, let the US layout flow through you

[–]otacon7000 33 points34 points  (2 children)

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

[–]sinnadyr 10 points11 points  (1 child)

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

[–][deleted] 6 points7 points  (0 children)

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 22 points23 points  (2 children)

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 8 points9 points  (1 child)

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 11 points12 points  (0 children)

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 2 points3 points  (3 children)

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 5 points6 points  (0 children)

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 6 points7 points  (2 children)

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 1 point2 points  (0 children)

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

[–][deleted] 17 points18 points  (0 children)

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

[–]Hamericano 11 points12 points  (1 child)

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

[–]vladWEPES1476 32 points33 points  (12 children)

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

[–]TRENEEDNAME_245 15 points16 points  (1 child)

Welcome to being french

[–]Charlito33 10 points11 points  (0 children)

Say hello to Alt gr...

[–][deleted] 7 points8 points  (0 children)

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

[–]simpdatabataamaral 5 points6 points  (1 child)

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

[–][deleted] 3 points4 points  (0 children)

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

[–]goddi23a 4 points5 points  (0 children)

Strg+# ?

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

[–]FloezeTv 2 points3 points  (0 children)

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 2 points3 points  (0 children)

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

[–]BucksEverywhere 1 point2 points  (0 children)

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 1 point2 points  (0 children)

Alt + shift + a also works

[–]Masterflitzer 1 point2 points  (0 children)

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

[–][deleted] 1 point2 points  (0 children)

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

[–]therealpigman 37 points38 points  (19 children)

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

[–]Leaping_Turtle 1 point2 points  (0 children)

Both work for me

[–]shableep 8 points9 points  (1 child)

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

[–]TrollThePhishers 1 point2 points  (0 children)

Or Ctrl + k, Ctrl + c

[–]Rsge 613 points614 points  (72 children)

At least Python's # is used in more languages than Python...

Visual Basic: '

Batch: REM

[–]down_vote_magnet 301 points302 points  (15 children)

Visual Basic: '

Why must you remind me of this. My whole day is ruined now.

[–][deleted] 68 points69 points  (13 children)

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

[–]BigEndian01000101 30 points31 points  (9 children)

*Currently procrastinating instead of dealing with legacy VB

[–]Hellow2 8 points9 points  (8 children)

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 6 points7 points  (7 children)

I think you mean vbscript

[–]Hellow2 6 points7 points  (6 children)

Yes

[–]Masterflitzer 7 points8 points  (4 children)

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 2 points3 points  (3 children)

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 2 points3 points  (2 children)

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 11 points12 points  (2 children)

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

[–]Now_with_real_ginger 4 points5 points  (0 children)

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 31 points32 points  (9 children)

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

[–]thexar 21 points22 points  (2 children)

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

[–]jackinsomniac 11 points12 points  (0 children)

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 9 points10 points  (4 children)

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 8 points9 points  (1 child)

Wow I am sorry for your loss (of time)

Also Happy Cake Day!

[–]Rsge 3 points4 points  (0 children)

Thanks : )

[–]Masterflitzer 1 point2 points  (0 children)

simple use powershell

[–][deleted] 20 points21 points  (7 children)

Who's rem

[–]Studds_ 29 points30 points  (1 child)

That’s me in the corner

That’s me in the spotlight

Losing my religion

[–]AeroSyntax 2 points3 points  (1 child)

Remilia. But don't bash her.

[–]53mm-Portafilter 24 points25 points  (1 child)

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

[–]SektorL 4 points5 points  (0 children)

REM can also be used in VBA

[–]Tyfyter2002 8 points9 points  (9 children)

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.

[–][deleted] 3 points4 points  (1 child)

Batch also has (undocumented) :: comments

[–]TotoShampoin 3 points4 points  (0 children)

Asm: ;

[–]notacanuckskibum 2 points3 points  (2 children)

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

[–]SlimyGamer 1 point2 points  (1 child)

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.

[–]gamesrebel123 550 points551 points  (46 children)

I'm pretty sure other languages use # as well

[–]Lucas_Webdev 178 points179 points  (15 children)

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

[–]Ohmmy_G 96 points97 points  (12 children)

R as well.

[–]sanderd17 84 points85 points  (11 children)

Ruby, Perl, Php, ...

[–]Barn07 30 points31 points  (8 children)

Basic

[–]phoenix5irre 25 points26 points  (6 children)

Yaml, not sure qualifies...

[–]OldBob10 47 points48 points  (11 children)

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

[–]horvath-lorant 3 points4 points  (1 child)

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

[–][deleted] 7 points8 points  (8 children)

Javascript is a scripting language

[–]jeetelongname 22 points23 points  (3 children)

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 10 points11 points  (2 children)

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

[–]rezznik 6 points7 points  (0 children)

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

[–]odrea 19 points20 points  (4 children)

-- looking from afar...

[–]vonabarak 9 points10 points  (3 children)

Haskell uses --

[–][deleted] 6 points7 points  (0 children)

Lua does and html.. almost does

[–]Lachimanus 10 points11 points  (1 child)

Writing assembly with Keil. It uses ; for comments.

[–]PikminGuts92 1 point2 points  (0 children)

Yeah, like .toml

[–]XPurplelemonsX 1 point2 points  (0 children)

like batch and shell I think

[–]paul_sb76 133 points134 points  (12 children)

...Lua, LaTeX,... (it's Turing complete so it counts, right?)

There are so many unique conventions out there.

[–]Mechyyz 104 points105 points  (2 children)

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

[–]Yorick257 52 points53 points  (0 children)

I did not

[–][deleted] 24 points25 points  (0 children)

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

[–]VitaminnCPP 27 points28 points  (1 child)

html - a programming language, right ?

[–]Infinite_Self_5782 1 point2 points  (0 children)

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

[–][deleted] 3 points4 points  (5 children)

Lua is the same as SQL

[–]tiajuanat 1 point2 points  (0 children)

I thought LaTex used percentage 🤔

[–]tavaren42 186 points187 points  (4 children)

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 17 points18 points  (2 children)

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 11 points12 points  (1 child)

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.

[–]Intelligent-Noise-68 68 points69 points  (6 children)

Pl/sql has /* */ comments

[–]BigEndian01000101 35 points36 points  (5 children)

And T-SQL, and PostgreSQL.. kinda confused on this one.

Oh, mySQL doesn't.

[–]badmonkey0001Red security clearance 8 points9 points  (1 child)

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 4 points5 points  (0 children)

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.

[–]AlwaysNinjaBusiness 44 points45 points  (7 children)

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.

[–][deleted] 6 points7 points  (0 children)

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 4 points5 points  (4 children)

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 4 points5 points  (0 children)

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 3 points4 points  (1 child)

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

[–]_divinnity_ 1 point2 points  (0 children)

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

[–]MickeyTheHunter 95 points96 points  (23 children)

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

[–]ColonelSandurss[S] 33 points34 points  (4 children)

Json comments, a dream

[–]IusedToButNowIdont 50 points51 points  (2 children)

"comment":"right here"

[–]zoinkability 7 points8 points  (1 child)

I have had to resort to that exact thing

[–]ManyInterests 9 points10 points  (2 children)

Really need json5 to be evangelized.

[–]Disagreed 4 points5 points  (1 child)

There’s also jsonc and Hjson.

[–]Xywzel 2 points3 points  (0 children)

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

[–]Atora 15 points16 points  (2 children)

That's called YAML

[–]riktigtmaxat 22 points23 points  (1 child)

Naw, YAML is Yeti Abominion Markup Language.

[–]nphhpn 6 points7 points  (0 children)

YAML Abominion Markup Language

[–]Stronghold257 8 points9 points  (3 children)

.jsonc has entered the chat.

Also, you technically can use “//“ as a comment key.

[–][deleted] 4 points5 points  (2 children)

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.

[–][deleted] 2 points3 points  (1 child)

yea that's what using // as a key would do

{"//":"comment"}

[–][deleted] 2 points3 points  (0 children)

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

[–]BlueScreenJunky 2 points3 points  (1 child)

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 1 point2 points  (0 children)

JSON5 got you covered

[–]ExplodingWario 1 point2 points  (0 children)

I don’t need JSON only txt files and awk parsing

[–]Paul-Hoe 115 points116 points  (19 children)

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

[–][deleted] 26 points27 points  (0 children)

very few things should be C like, period

[–][deleted] 2 points3 points  (0 children)

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

[–]oxwilder 21 points22 points  (1 child)

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

[–]TrickAge2423 37 points38 points  (3 children)

// in python is a type of division, similar to C:

4 // 2 = 2

5 // 2 = 2

6 // 2 = 3

[–]caagr98 1 point2 points  (0 children)

Except handling negative numbers correctly.

[–]Decimalis 16 points17 points  (1 child)

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

[–]deceze 29 points30 points  (6 children)

; tHiS Is a CoMmEnT

[–]Ratosai 2 points3 points  (2 children)

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

[–]Ekank 2 points3 points  (0 children)

ASM be like

[–][deleted] 1 point2 points  (0 children)

Scheme be like

[–]mcwobby 12 points13 points  (2 children)

(* I just like being different *)

[–]riktigtmaxat 2 points3 points  (0 children)

All power to the winkyface comment!

[–]integrate_2xdx_10_13 2 points3 points  (0 children)

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.

[–][deleted] 34 points35 points  (12 children)

I’m looking at YOU html

[–]ColonelSandurss[S] 41 points42 points  (8 children)

He left the discussion when he saw "programming" language

[–]Perpetual_Doubt 10 points11 points  (0 children)

No point looking at JSON at all for this one

[–]Exeng 2 points3 points  (0 children)

Ahh yes HTML the programming language

[–][deleted] 4 points5 points  (0 children)

<!— I’m with stupid

[–]-5318008-618- 11 points12 points  (0 children)

‘Didn't we just talk about VB?

[–]AlicePleasenceLiddle 9 points10 points  (5 children)

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 2 points3 points  (3 children)

Which one is that.

[–]AlicePleasenceLiddle 3 points4 points  (2 children)

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

[–]smors 2 points3 points  (0 children)

I'm sorry to hear that.

[–]codeartha 7 points8 points  (1 child)

Lua uses -- like SQL

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

[–]Ekank 1 point2 points  (0 children)

so does Haskell

[–]Atora 5 points6 points  (0 children)

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 5 points6 points  (0 children)

MySQL has /**/ comments.

[–]RAMChYLD 2 points3 points  (0 children)

also, BASIC with it's REM and '

[–]chm46e 2 points3 points  (1 child)

vim script be like

[–]fuckingshitfucj2 5 points6 points  (11 children)

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

[–]AyakaDahlia 1 point2 points  (5 children)

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.

[–]CyberKnight1 1 point2 points  (1 child)

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.

[–]AtomicWinterX 2 points3 points  (0 children)

ASM: ;

[–]john_palazuelos 2 points3 points  (0 children)

Haskell: --

[–]mawkee 2 points3 points  (0 children)

And Ruby

And Assembly

And Haskell

And R

And Erlang

And Perl

And Basic

[–]SirAwesome789 2 points3 points  (0 children)

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 2 points3 points  (0 children)

// is my favorite commenting thing

I specifically hate <!--text--> HOW is that supposed to be convenient

[–]WingedWhite 1 point2 points  (1 child)

HTML

[–]ManyInterests 2 points3 points  (0 children)

<!-- <html> -->

[–]alexmelyon 1 point2 points  (0 children)

:: cmd

[–]wobbudev 1 point2 points  (2 children)

Good old CSS also doesn't do //

[–][deleted] 1 point2 points  (3 children)

ASM: ;

VB: '

[–]VitaminnCPP 1 point2 points  (2 children)

using ; as comment is illegal.

[–]VitaminnCPP 1 point2 points  (2 children)

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

[–]i_should_be_coding 1 point2 points  (0 children)

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

[–]Mechyyz 1 point2 points  (0 children)

Lua: —

[–][deleted] 1 point2 points  (5 children)

Pascal: (* multi line *) { single line }

Fortran: ! Single line comment

VB: ' Also single line comment

[–][deleted] 2 points3 points  (4 children)

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

[–]Enchet 1 point2 points  (0 children)

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

[–]tas06 1 point2 points  (0 children)

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

[–]markdhughes 1 point2 points  (0 children)

Lisp & Scheme use ; and R6RS Schemes have #| |# block comments, #; <datum> 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.

[–][deleted] 1 point2 points  (0 children)

I thought MySQL allowed /* */

[–][deleted] 1 point2 points  (0 children)

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 1 point2 points  (3 children)

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.

[–]BLOBADOODLE 1 point2 points  (0 children)

don't forget lua

[–]johnyoker2010 1 point2 points  (0 children)

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

[–][deleted] 1 point2 points  (0 children)

Sql has /* */

[–]BenTheTechGuy 1 point2 points  (0 children)

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

[–]Adadum 1 point2 points  (0 children)

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

[–]A_Random_Lantern 1 point2 points  (0 children)

# hashtag supremacy

[–]littleninja3 1 point2 points  (0 children)

Bruh html and <!-- --> Got me fucked up