#(sanvander) How to comment on same line as code?

25 messages · Page 1 of 1 (latest)

sour hinge
#

Hey guys, i know that if you use # at the start of a line, it will comment out the whole line. But is there also something like that after a line of code, you can add a comment on the same line? I added an example of what i meant, where #test would be the comment

static coveBOT
#

(sanvander) How to comment on same line as code?

static coveBOT
#

Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>

rich stirrup
#

nah thats not a thing

sour hinge
#

Ah ok thanks, is there anyway i can change this thread to a feature request?

cerulean cipher
#

Why not put it above your code?

sour hinge
#

Well when im programming I do it on the same line as the code as well, and afaik most programmers do that? (when just commenting for that specific line). Sometimes i need to add some explanation or information to each line of code for a decent sized section. I feel like it would hinder the readability of the code if i'd do it like:

line of code
comment
line of code
comment
line of code
comment
and so on for mayeb dozens of lines.

It'd help a lot if it would be :

line of code #comment
line of code #comment
line of code #comment

#

But maybe im a special case in this lol

rich stirrup
#

imo i prefer seeing comments separated from the code

cerulean cipher
#

Config files usually have comments above their key/value pairs, explaining what it does, prior to offering the choice.

toxic wave
#

Denizen does not support same-line comments and likely will not.

loud flume
#

(and this is a rather large company, so there are plenty of people doing it this way)

true wyvern
#

The original reason they weren't allowed is because in early versions of Denizen it was more likely to be a mistake than intent, a lot of - narrate "something #1" style things would borky from that so inline comments were disabled

#

now that we have the toolset to prevent that mistake (ie syntax highlighting mainly lol) it's less of an issue, but it'd still be a helluva undertaking to add in now, considering we'd have to have a years-long deprecation cycle to protect all the scripts out that there use #from breaking overnight

#

and, given that fact and the reasoning explained above for why that's usually not preferred anyway, doesn't seem worth it

fresh ingotBOT
#
Thread Closing Reminder

Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.

If not yet resolved, please reply below to tell us what you still need.

(Note that if there is no reply for a few days, this thread will eventually close itself.)

#

@sour hinge