T O P

  • By -

YoumoDawang

`

`


DomingerUndead

{{'' // why do that when you can bind comments}}


jfcarr

But, but, why didn't you comment your JSON file?


Sea_Maximum7934

We don't talk about comments in JSON, no no no.


Jnick-24

but it’s so good for configs otherwise :(


Sea_Maximum7934

{ my_config_value: 42, my_config_value_description: "we don't talk about Bruno" }


iMakeMehPosts

Istg if I ever make a JSON loader I'm supporting C-style comments in and no one can stop me.


dagbrown

Just run it through the C preprocessor first. As a bonus, your JSON now supports `#include` directives and C-style macros.


Sea_Maximum7934

Wonderful idea. Next up we need include directories while parsing so we should standardise on cmake to solve that problem.


tsavong117

Does anyone feel like life would be easier if we just used the right tool for the job instead of hacking together solutions? Me either. So do we want a single standard or should we make 5 "technically compatible" ones with names that are functionally identical, save for some tiny detail?


Sea_Maximum7934

Well, you know, I could use the standard library, but it wouldn't be tailored to my use case. My own configuration parsing library is written by me so it doesn't suffer from the common "not invented here" issue, which as we all know is a fatal flaw....


tsavong117

I swear if I have to deal with another set of really shitty tools made by a dev in the 90s that hasn't been updated since 2005 and has never been used by anyone outside of one specific company and has an interface that makes me BEG for a command line interface to save me from the BRIGHT FUCKING WHITE WITH LIGHT GRAY BOXES I'm just going to become a printer salesman. Can't beat em, and all.


CiroGarcia

JSON5 supports # comments I believe


just-bair

JSONC entered the chat


LetscatYt

Damn you! Now that song is in my head again


Juff-Ma

I hate JSON and XML for configs, they are data exchange formats, who decided that they should be used for configuration? I get it when you need to create a logical structure but not a simple configuration. - Brought to you by your local TOML master race gang. PS: fuck YAMLs significant whitespace - Brought to you by my personal hate for significant whitespace


Sea_Maximum7934

XML, the readability of a machine interface, with the compactness of a human interface. XML: we made it hard to read for humans, but ALSO hard to parse for machines. XML: because we hate you, that's why.


JosephLam1

Use yaml for configs, not json. Json is not supposed to be used for configs and isn’t meant for human readability. Yaml also got that comment functionality everyone likes


Jnick-24

🤓


MrFluffyThing

Wait are you endorsing JSON for human readability and config files or not? How many fingers an I holding up? Does it matter if a human ever has to read the config file? 


Aln76467

no. use toml its way better


1Dr490n

Ooh I like your profile picture


Jnick-24

thanks dude


Aln76467

nah toml is way better


rouge_chaos

JDSL will like to have a word with


Romejanic

{ "_": "who needs comments when you have _" }


SocDemGenZGaytheist

But that feels so hack-yyyyyyy :( And what if I want to write a function that iterates over the keys to count the things they represent, or something?


Romejanic

Yeah I know, but the only way to get any form of comments in pure JSON is hacky workarounds, unless you use a different format which supports comments like JSONC or YAML


Luk164

Eh even vscode just uses jsonc and calls it .json. At this point if your parser doesn't support it you need a better parser


Romejanic

There’s not a lot of parsers which support it though. For JavaScript in the browser and on node they implement the `JSON.parse()` function from the JavaScript spec which doesn’t have support for comments, and that’s what most devs will use


Luk164

Not a lot != None I honestly dunno about JS since I avoid it like the plague, but I am pretty sure you can either find something or just load a file and preprocess it yourself


Romejanic

I stand corrected, it looks like Microsoft provides their one which I’m guessing is the same one they use for vscode, so I guess that’s a good alternative. I don’t know if that’s the case for other languages https://www.npmjs.com/package/jsonc-parser


Luk164

C# built in parser supported block comments initially and added line comments in v6 Newtonsoft had them since forever and can even load them as separate special values if you want


alexanderpas

ignore anything that starts with the underscore.


Cootshk

You mean JSONC, JSON5, JS, or ?


iam_pink

Sometimes I wish I could, just so that I could comment out something for a quick test


JoshYx

In many cases, you can. Many modern tools that deal with json files are okay with // comments.


iam_pink

Not node json imports


shillB0t50o0

{ comment: this is a comment }


ethanjf99

{ “comment”: “this is a comment” }


shillB0t50o0

{ "u": "right" }


[deleted]

[удалено]


Katniss218

You win


TheSportsLorry

Duck you, take your upvote and get out


Jae9erJazz

Ctrl + / in code editors all the way


fullup72

I rebind my editors to `Ctrl + q` so I can do it with one hand. Also, muscle memory from that being the default in SciTE, which was the first editor I used a bit over 15 years ago.


augigi

You know there are two control buttons on the keyboard right?


fullup72

Yes, but left hand comments/uncomments while right hand exclusively rides the arrows or the mouse. It just feels much more ergonomic to me.


ContemplativeNeil

I also like to keep one hand free when I'm commenting!


fullup72

Helps to keep the other hand in the arrows or mouse. But also, yes.


ChrisScripting

What's that on a European keyboard if you happen to know? Or Nordic. Whatever require / to be used with shift


Spice_and_Fox

That is one thing I like about the sap code editor. Commenting and uncommenting is ctrl + >


VastPossibility3158

As usual vim has a quicker method but it requires 3+ keybinds to use Ctrl v to enter block mode and select all lines then shift i to enter insert mode and insert // or # or whatever, doesn't auto do html or anything like code but lets be honest nobody using vim is coding in HTML a whole bunch. Vim users probably only code in RUST or Ziggy or Brainfuck lets be honest


TheMysticalBard

This is absolutely not quicker than Ctrl+/


Plagiocefalia

it depends, if you want to comment all lines inside the block you can select by just pressing `vi{` that is much faster than using the mouse or shift-arrows


VastPossibility3158

Im assuming the average code user reaches for his mouse goes over to the line, presses ctrl / then moves mouse away


TheMysticalBard

Shift+arrows to select lines you want to comment, Ctrl+/ to comment.


zettabyte

> arrows If you leave home row, you've lost. Might as well jump on an office chair for a quick sword fight. Flow is broken. :-)


Opening_Criticism_57

I thought the memes about vim users were just jokes… how wrong I was


zettabyte

Holy crap. This is programmer humor. I made a reference to a classic XKCD and added a smiley face. You guys are wound up pretty tight if you couldn’t see that’s tongue in cheek.


JoshYx

If we're talking about the average code user then vim is exactly NEVER quicker lol


Noisycarlos

Just i just press gcc in mine and done


DoOmXx_

🤓


Bagel42

I use vim and do web dev… and also have a plugin to do things quicker


MoveInteresting4334

> vim has a quicker method…requires 3+ keybindings > lets be honest > let’s be honest You contradicted yourself. Twice.


Mokousboiwife

i use comment.vim or whatever its called gcc and its commented


carlos_vini

{/\* commenting in JSX \*/}


Goat1416

Fuck this. > {/* WebStrom */} > {/* will */} > {/* comment each line this way */} >{/* And VsCode >Comments like this */} And Select + remove comments doesn't work.


a_cloud_moving_by

Hmm, in IntelliJ these things are customizable. I'd be surprised if they weren't in other IDEs.


YoumoDawang

First one is objectively superior


Chickeninvader24

{% comment %} commenting in Liquid {% endcomment %}


Snazzy21

I hate HTML comment syntax. Then there's Haskell that uses -- which I have no comment on


sathdo

-- is standard for SQL as well.


u10ji

And Lua


IHeartBadCode

COBOL is a * but only if it is in column 7. Unless you’re using that fancy free format COBOL.


MoveInteresting4334

> but only if it is in column 7 I always thought maybe I’d learn COBOL someday. This comment has changed my mind.


Vanceagher

Was just thinking the same thing, what is column 7?!


MoveInteresting4334

The first rule of column 7 is that you don’t talk about column 7.


hackerdude97

I mean anything that doesn't require 50 symbols and two lines to write is *okay*-ish. Comments are supposed to be quick, not good looking


BoneWitchNun

fuck yeah HTML


artyhedgehog

Commenting in JSON:


skobbokels

That is why JSON 2 Electric Boogalo exists, although sadly, it's named JSON5


GahdDangitBobby

To comment in JSON, you create another file called `comments.txt` and put it in the same directory


artyhedgehog

Thank you, that's terrifying.


Sea_Maximum7934


MokausiLietuviu

'COMMENT' This is a comment in ALGOL. It is terminated by a semicolon. ; 'COMMENT' Know what else is terminated by a semicolon? Y:=X+1; 'COMMENT' Every other bloody line of logic, which means the above line of logic was never performed.;


rtybanana

this is heinous


MokausiLietuviu

I'm greyer than I should be.


ChickenSpaceProgram

Very off topic but how would one go about learning ALGOL?


MokausiLietuviu

I didn't ever learn ALGOL directly, but there's a large family of languages that are closely based on it. I learned one of those and worked with it for years. I learned it because it was the only implemented high level language for that system. I think the biggest ALGOL-decended language is Pascal, so I'd go for that


ChickenSpaceProgram

Neat, I was mostly interested in learning ALGOL specifically because I like learning useless things but maybe I'll learn a bit of Pascal for fun.


dawsky

Luckily ie6 is ded


gravity_is_right

We have Safari now to replace it


InternetAnti

-- commenting in SQL..


rbardy

/* commenting a block in SQL */


NigelDuckrag

My favourite because it works also in C. I am not really a dev but I like sql and C. Nobody cares.


windowschips

Lua too


RepresentativeDog791

``` “”” Python is the really crazy one using string literals as comments “”” ```


Zitrone21

; Commenting in assembly


thedrj0nes

; also used for commenting in MUMPS. for loop=1:1:10 do .;things, but don't forget, when you're in a loop, the comment goes at the number of dots you are .;at in the loop, or the loop ends right there AND the interpreter will not warn you that has happened! .quit quit


Schecher_1

also used for ini files


fatemonkey2020

*for some assemblers some assemblers take //, #, and there's probably more and some assemblers take multiple of those options


RajjSinghh

I remember my first internship at a company that had two developers and one of them saw me comment out some tag and I got told off for them being "horrible wordpress things"


Appropriate-Scene-95

It seems kinda coherent, I'll let it pass


NatoBoram

' commenting in Visual Basic


RealCrazyChicken

``` -- and then there's Lua ```


le_nathanlol

finally, after all those years, someone who uses lua!


RealCrazyChicken

I only use it with computercraft 😭


hawkinsst7

rem Commenting in BASIC or batch files :: not really a comment in batch files, but can be used as one, and (something I read when I was a kid), its slightly faster since rem is an actual token that has to be parsed, and :: is a malformed label and is ignored. :: i'm not sure how true that is though.


bigmonmulgrew

Ignore the next sentence. Commenting in ChatGPT


eras

`\\ commenting in PHP`


Same_Garlic2928

or # like this to annoy the purists


pistolerogg_del_west

--what are you guys talking about


Westdrache

Why is this comment empty?


pistolerogg_del_west

Is it?


09_hrick

is this sql?


Geoclasm

<%--commenting in aspx--%>


R_Harry_P

REM I like to keep it BASIC.


Adreqi

' not visual enough.


Xiagax

Commenting in Brainfuck


windowschips

‘ Commenting in visual basic is horrendous


NeverYelling


purchase_bread

20 REM COMMENTING IN BASIC


pocketgravel

HTML comments are the most ye olde shit. Its easier to write an HTML comment in the margins of a punch card than to do it manually in a text editor.


rr-0729

% commenting in LaTeX


s0litar1us

/* Fun fact /* In C */ this is not a comment */


ChChChillian

`C Commenting in Fortran`


legendgames64

Not just JS. C, C++, Turbowarp, etc.


js1618

{{}}


PennyFromMyAnus

@commenting in Razor


Lozdie

; commenting in assember


Fenor

Wait for op to see how it was in xhtml


GahdDangitBobby

I'm learning Ruby on Rails right now and commenting in the HTML template files (`.erb` files) is such a pain in the ass. Sometimes you'll comment something out and it will evaluate the expression anyways. It defeats the entire purpose of a comment! Plus, there are two ways to comment - first is by using an HTML comment `` and the second way is by commenting the Ruby statements `<% #comment here %>` and both of them seem to still create bugs. There's probably something I'm missing but it's certainly not intuitive.


Maleficent-Cry-5872

//that's C, C++, Golang that's right and bless


al00011

I think it is a personality defect, but I love html comment syntax. I want to use it everywhere.


smocza_dusza

Good news you can also used it in JS apparently , it was added so you can comment things about of script tag for browser who ignore them /shrug


Zestyclose_Toe_4695

% Commenting in Matlab


StooNaggingUrDum

It makes sense. The `<>` represent a comment tag and the `!--` is like a shebang line...


NotTheOnlyGamer


shgysk8zer0

``` {% comment %} Commenting in Liquid{% endcomment %} ```


smocza_dusza

Also I recently learned that


ChickenSpaceProgram

! don't forget commenting in Fortran


HackerDaGreat57

@ Commenting in ARMv6-M on GAS


skeleton_craft

Okay. Has anyone ever commented their html code other than to comment out a PHP block?


AlexOzerov

This is so stupid and annoying


Careless-Honey-4247

{/* comment your information here */} JSX


yourteam

#--dba says hello


Admiral_Skye

@\* commenting in razor/blazor \*@


SpiderKoD

XML will be on HTML side 🤷‍♂️


RandomiseUsr0

{/* hello from JSX */}


shilltom

rem


Particular-Welcome-1

rem commenting in batch


azurfall88

<>{/* commenting in JSX */} (sometimes it doesn't even work either)


BirdlessFlight

`{# Do you even Twig? #}`


AstaHolmes

String redditComment = "Java have left the chat.";


SoRaang

How about commenting in different .txt file and reference the line number


s0litar1us

--[[ Lua block comment -‐]]


Undernown

Who cares? I just press "ctrl + /" andnit just works.


EternalDreams

;; commenting in elisp


antek_g_animations

I sometimes comment in xaml, I cannot trust future me


Puch_Hatza

; Commenting in ASM


Keio7000

Commenting in PDDL: ; comment


JustSpaceExperiment

Just wait for language that makes the opposite to make easy write comments. You will prefix code with some character and lines without prefix will be treated as comments - multiline comments solved automatically.


Kenway1011

And then you start using django. You use them all and then there is one more.


navetzz

Fortran 77


Fit_Helicopter1949

/* in PLI */ Am I the only one coding in that language?


grey_shoes

And xaml


sabalatotoololol

-- and {- -} master race


Aliics

Brainf*ck comments. Everything that isn’t valid syntax is a comment.


dfs_zzz

"Commenting in Smalltalk“


tubbys_requiem

-- nice


_grey_wall

{# comment #}


Hamza12700

You should look at Ocaml comments


DeltaLaboratory

REM THIS IS COMMENT IN WINDOWS BATCH FILE


xorflame

Quality humour post, feel free to post on r/leetcodecirclejerk as well for some additional karma ;)


FoxReber

// commenting in c#, c++, java


Pawlo371

Rel


Energetic_Eggplant

Sql style -- or /* xyz */


forever-and-a-day

⌘/Crtl + / easy


Merdperf

Commenting in reddit:


phesago

/\* COMMENTS IN SKWILL \*/


Treeager

% commenting in prolog


elasticweed

<# Powershell, for the refined gentleman coder #>


busdriverbuddha2

; commenting in windows CFG file


SamelCamel

--[[ lua comments make me wanna peel off my skin --]]


river0f

Just use ctrl K + ctrl C


TheFrenchSavage

Why HTML doesn't have comment tags is beyond me.