We’re rewarding the question askers & reputations are being recalculated! Read more.

Questions tagged [comment]

For questions requiring the manipulation or use of comments in code.

Filter by
Sorted by
Tagged with
65
votes
40answers
9k views

Uncomment a COBOL program!

COBOL is a very old language, at the time of writing it is 58 years old. It is so old, in fact, that it has a very interesting quirk: the first six characters of each line are comments. Why is this, ...
12
votes
17answers
2k views

Generate /* line number comments */

Your task is to write a program (or function) that will take a string as input and append text to the beginning of every line that satisfy the following rules: The text appended must contain the line ...
30
votes
20answers
3k views

Parse the comments out of my esoteric code

Earlier this week, we learned about how to format esoteric languages for commenting. Today, we're going to do the inverse of that. I need you to write a program or function that parses some well-...
42
votes
28answers
2k views

Esolang-Comment-Template-Generator

Lots of people on this site use esoteric languages, and since these languages are unusual and hard to understand, they will frequently write an explanation in a certain format. For example, if the ...
14
votes
4answers
507 views

Make a simple pretty-comment tool

Challenge: Some ascii-art is a pain to make, but makes code comments easier to read, especially when the code is dense. The challenge is to make a simple tool that converts comments to simple ascii-...
19
votes
8answers
10k views

Remove single line and multiline comments from string

Goal Using the programming language of your choice, write the shortest program to eliminate comments from a string representing a C program. Input The string can be taken as any form of input, but ...
27
votes
2answers
2k views

Vim - surround comment line with comment character

Today I realised that I often like to define sections in my code like so: #################### # Helper Functions # #################### But that it's tedious to ...
20
votes
11answers
1k views

Restricted Polyglot

Polyglots are programs that are valid in multiple programming languages simultaneously. Most such polyglots are written in such a way that certain constructs of one language are interpreted as ...
8
votes
7answers
975 views

Do the needful? [closed]

Goal Replace all comments in C, C++, or Java Code with the comment // Do the needful. Specifics This coding challenge is a simple one. Take as input the name of ...