1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
|
[
{
"id": "https://programming.dev/post/56115670",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/post/56115670",
"page": "en/til/2026/09/05/multiline-sh-comments.html",
"published": "2026-09-05T16:06:50Z",
"content": "Multiline comments in POSIX sh\n\nBack writing in my website.\n"
},
{
"id": "https://programming.dev/comment/25835338",
"in_reply_to": "https://programming.dev/post/56115670",
"source": "fediverse",
"author": "FizzyOrange",
"handle": "FizzyOrange@programming.dev",
"profile": "https://programming.dev/u/FizzyOrange",
"url": "https://programming.dev/comment/25835338",
"published": "2026-09-05T16:37:44Z",
"content": "Yeah but... Don't. Multiline comments are a bit of an anti-pattern at the best of times. This is a war crime.\n"
},
{
"id": "https://programming.dev/comment/25835411",
"in_reply_to": "https://programming.dev/comment/25835338",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25835411",
"published": "2026-09-05T16:43:32Z",
"content": "I use this only when developing, mostly while debugging. IIRC I've never commited code like this.\n"
},
{
"id": "https://programming.dev/comment/25835523",
"in_reply_to": "https://programming.dev/comment/25835411",
"source": "fediverse",
"author": "FizzyOrange",
"handle": "FizzyOrange@programming.dev",
"profile": "https://programming.dev/u/FizzyOrange",
"url": "https://programming.dev/comment/25835523",
"published": "2026-09-05T16:50:23Z",
"content": "Close notepad.exe. Open a real editor. Select the text you want to comment out. Press Ctrl-/\n"
},
{
"id": "https://programming.dev/comment/25835605",
"in_reply_to": "https://programming.dev/comment/25835523",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25835605",
"published": "2026-09-05T16:55:43Z",
"content": "No notepad.exe, nvi: `'a,s/^/# /`.\n"
},
{
"id": "https://beehaw.org/comment/6198058",
"in_reply_to": "https://programming.dev/comment/25835338",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6198058",
"published": "2026-09-05T18:07:40Z",
"content": "\u003e Multiline comments are a bit of an anti-pattern at the best of times.\n\nIf you're making this as a general statement, it varies from language to language. For example, CSS (and arguably HTML and Markdown) only supports multiline comments, and multiline comments are often used for documentation (as with jsdoc and, though only comments in the same way that heredocs to /dev/null are, Python).\n\nBut yeah, if you *actually* do this in Bash, [wat](https://www.destroyallsoftware.com/talks/wat).\n"
},
{
"id": "https://lemmy.ml/comment/27651659",
"in_reply_to": "https://programming.dev/post/56115670",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27651659",
"published": "2026-09-05T18:36:21Z",
"content": "I think this solves an issue, that's not an issue at all and makes it more complicated and harder to read. What do I mean by that?\n\nIt requires more text and exact correct syntax of multiple elements. It makes it harder to see where the start and end is, and one has to look for any lines that could potentially be a comment in a heredoc. The syntax highlighter does not show this in comment color. Bash still executes those lines to read the \"comment\", as it thinks its normal code. In example variables can still be expanded in heredocs. Other tools removing comments from script to count lines would be fooled too.\n\nCompare this to a single hashtag symbol in the beginning of each comment. That's all. This is also good practice everyone understands. From practical point of view, why would anyone use heredocs for multi line comments over single line comments?\n"
},
{
"id": "https://lemmy.ml/comment/27651807",
"in_reply_to": "https://beehaw.org/comment/6198058",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27651807",
"published": "2026-09-05T18:46:28Z",
"content": "\u003e CSS (and arguably HTML and Markdown) only supports multiline comments, and multiline comments are often used for documentation\n\nThose aren't programming languages. Because, especially in HTML, a line end does not end an instruction and is just for formatting. So single line comments would be very awkward in HTML, so they had to use multi only. And because CSS is meant to be used close to HTML, I think they opt in to the same. JavaScript in example has single line comments again.\n\nDoes any programming language exist that supports multiline comments only without single line comments?\n"
},
{
"id": "https://programming.dev/comment/25837399",
"in_reply_to": "https://lemmy.ml/comment/27651807",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25837399",
"published": "2026-09-05T18:51:39Z",
"content": "C89, AKA ANSI C famously only supports `/* */`, having `// ` as a cross-pollinated idea from C++.\n"
},
{
"id": "https://lemmy.ml/comment/27652362",
"in_reply_to": "https://programming.dev/comment/25837399",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27652362",
"published": "2026-09-05T19:19:44Z",
"content": "Good example, at least historical. ;-) I wonder why they never added single line comments before. I mean it took them quite a long time to do so. Languages before 1960 even had single lines too. \n\nEdit: BTW it was common in C to write multiline comments to have them look like single line comments too, because that's easier to read and understand. Maybe that's why they didn't feel the need for, because in practical usage it could be replicated. In example as:\n\n```c\n/* Title\n * description\n * variables\n */\n```\n\nThis could easily be replaced by single lines as:\n\n```c\n// Title\n// description\n// variables\n```\n"
},
{
"id": "https://beehaw.org/comment/6198279",
"in_reply_to": "https://lemmy.ml/comment/27651807",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6198279",
"published": "2026-09-05T19:42:00Z",
"content": "Both HTML and CSS (when together) are turing complete, and JSX syntax only supports HTML comments in many places.\n\nJavaScript *having* single line comments isn't really relevant. Multiline comments are in heavy use there, arguably moreso than single line comments.\n\nEdit: and I should add that \"programming languages\" is moving the goalpost. The person I responded to didn't qualify their statement to programming languages.\n"
},
{
"id": "https://lemmy.ml/comment/27652766",
"in_reply_to": "https://beehaw.org/comment/6198279",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27652766",
"published": "2026-09-05T19:50:27Z",
"content": "I don't think that being turing complete means anything in this discussion, because it does not change what the language is for and how its used and interpreted. HTML and CSS are not instructions for the CPU, they are markup languages describing text for humans, not compiling it down to execute machine code for CPUs.\n"
},
{
"id": "https://beehaw.org/comment/6198316",
"in_reply_to": "https://lemmy.ml/comment/27652766",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6198316",
"published": "2026-09-05T20:05:25Z",
"content": "Again, the discussion was about multiline comments, not programming languages.\n\nAnd regardless of all that, JSX remains one of the most used languages in the world and supports only multiline comments in certain contexts, and JavaScript as a whole uses multiline comments generously.\n\nThe discussion was around multiline comments being an anti-pattern, which is entirely untrue. They just serve a different purpose than single-line comments, and usage varies from language to language.\n"
},
{
"id": "https://lemmy.ml/comment/27653021",
"in_reply_to": "https://beehaw.org/comment/6198316",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27653021",
"published": "2026-09-05T20:09:41Z",
"content": "\u003e The discussion was around multiline comments being an anti-pattern, which is entirely untrue. \n\nIt is an antipattern in Bash. He did not say that for HTML or JavaScript.\n"
},
{
"id": "https://beehaw.org/comment/6198326",
"in_reply_to": "https://lemmy.ml/comment/27653021",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6198326",
"published": "2026-09-05T20:11:36Z",
"content": "Bash doesn't have multiline comments. Even the article acknowledges this lol. From context, it was a general statement, not specific to Bash.\n"
},
{
"id": "https://programming.dev/comment/25841603",
"in_reply_to": "https://programming.dev/post/56115670",
"source": "fediverse",
"author": "CameronDev",
"handle": "CameronDev@programming.dev",
"profile": "https://programming.dev/u/CameronDev",
"url": "https://programming.dev/comment/25841603",
"published": "2026-09-06T00:06:07Z",
"content": "Your website is dead.\n"
},
{
"id": "https://programming.dev/comment/25842210",
"in_reply_to": "https://programming.dev/comment/25841603",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25842210",
"published": "2026-09-06T01:05:26Z",
"content": "Oops, renamed the www dir, should be back now.\n"
},
{
"id": "https://programming.dev/comment/25845713",
"in_reply_to": "https://beehaw.org/comment/6198058",
"source": "fediverse",
"author": "FizzyOrange",
"handle": "FizzyOrange@programming.dev",
"profile": "https://programming.dev/u/FizzyOrange",
"url": "https://programming.dev/comment/25845713",
"published": "2026-09-06T08:39:35Z",
"content": "The fact that CSS only supports multiline comments doesn't mean multiline comments are good, it means CSS is badly designed.\n"
},
{
"id": "https://beehaw.org/comment/6199598",
"in_reply_to": "https://programming.dev/comment/25845713",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6199598",
"published": "2026-09-06T08:54:26Z",
"content": "It means neither of those, actually, just that CSS supports only multiline comments.\n\nMultiline comments remain prevalent across ecosystems though (like in JS and Python). If you believe they're bad there too, that's fine, but the fact is that it would be an anti-pattern to go against those established standards.\n"
},
{
"id": "https://lemmy.world/comment/25692482",
"in_reply_to": "https://programming.dev/post/56115670",
"source": "fediverse",
"author": "talkingpumpkin",
"handle": "talkingpumpkin@lemmy.world",
"profile": "https://lemmy.world/u/talkingpumpkin",
"url": "https://lemmy.world/comment/25692482",
"published": "2026-09-06T16:10:53Z",
"content": "is\n```bash\n: \u003c\u003cEOF\n text\n text\nEOF\n```\n\na bash-ism?\n"
},
{
"id": "https://programming.dev/comment/25852776",
"in_reply_to": "https://lemmy.world/comment/25692482",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25852776",
"published": "2026-09-06T18:54:06Z",
"content": "AFAICT, not really, looks line POSIX sh at a glance. Just don't forget to `: \u003c\u003c'EOF'` instead of `: \u003c\u003cEOF`.\n\nBut `:` is arguably simpler than `cat`, one fewer fork/exec call plus no `open(2)` on `/dev/null`.\n"
},
{
"id": "https://programming.dev/comment/25852783",
"in_reply_to": "https://programming.dev/comment/25852776",
"source": "fediverse",
"author": "EuAndreh",
"handle": "EuAndreh@programming.dev",
"profile": "https://programming.dev/u/EuAndreh",
"url": "https://programming.dev/comment/25852783",
"published": "2026-09-06T18:54:29Z",
"content": "I like it, thanks :)\n"
},
{
"id": "https://lemmy.ml/comment/27668420",
"in_reply_to": "https://beehaw.org/comment/6198279",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27668420",
"published": "2026-09-06T20:12:59Z",
"content": "\u003e Edit: and I should add that “programming languages” is moving the goalpost. The person I responded to didn’t qualify their statement to programming languages.\n\nI think from context it is apparent that we are not talking about HTML and CSS (which you brought this up yourself, not the person you responded to). I think there was no need to specify his statement was to programming languages, by context we know it is. Also we are in Programming.dev. What context do you need more?\n"
},
{
"id": "https://beehaw.org/comment/6200940",
"in_reply_to": "https://lemmy.ml/comment/27668420",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6200940",
"published": "2026-09-06T20:45:35Z",
"content": "TIL programmers don't write HTML and CSS.\n\n(I guess if all you use are LLMs to write it, maybe that's true.)\n"
},
{
"id": "https://lemmy.ml/comment/27670051",
"in_reply_to": "https://beehaw.org/comment/6200940",
"source": "fediverse",
"author": "thingsiplay",
"handle": "thingsiplay@lemmy.ml",
"profile": "https://lemmy.ml/u/thingsiplay",
"url": "https://lemmy.ml/comment/27670051",
"published": "2026-09-06T22:09:56Z",
"content": "You understand the difference between a markup language to display text with HTML and CSS, and a programming language to execute programs. Right? And this has nothing to do with LLMs. I don't know why you are in an attacking position for no reason. I didn't want hurt anyone, just discussing here.\n"
},
{
"id": "https://beehaw.org/comment/6201202",
"in_reply_to": "https://lemmy.ml/comment/27670051",
"source": "fediverse",
"author": "TehPers",
"handle": "TehPers@beehaw.org",
"profile": "https://beehaw.org/u/TehPers",
"url": "https://beehaw.org/comment/6201202",
"published": "2026-09-06T22:57:49Z",
"content": "\u003e I don't know why you are in an attacking position for no reason. I didn't want hurt anyone, just discussing here.\n\nYou are being excessively pedantic over a topic that has absolutely nothing to do with the discussion. I don't know how you want me to respond to these comments.\n\nAs a reminder, what I was responding to was whether multiline comments are an anti-pattern, *not* whether HTML+CSS is a programming language.\n"
}
]
|