News for hackers. Stuff that matters.
Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @08:08AM (#15449065)
This is one of the signs that we're doing it wrong with programming languages.

We're dealing with text. A program can be expressed in text, actually every piece of information can be converted to text some way or another. The question is if it's the right way to do it. It's not.

I know why we chose text at the time. It doesn't make sense today.

In this case, we should be using a tool that would let us write comments without worrying about delimiters or escaped characters. That's so 20th century.

Re:Block Comments Are a Bad Idea by andruby on Wednesday October 11, 2017 @08:22AM (#15449133)
What are you suggesting? Some kind of "rich text"? Or are you suggesting visual programming?
Re:Block Comments Are a Bad Idea by wdfx on Wednesday October 11, 2017 @08:43AM (#15449257)
I was just thinking about some kind of code side-car file format which stores comments/docs separately. You'd then have a vertical split view with code on one side and the linked comments/docs on the other. You could select some code and use that to insert/link comments in the other pane.

I'm not entirely sure if I've ever seen something like this before - maybe as a feature in a specific language, but not as an IDE feature for all languages.

Re:Block Comments Are a Bad Idea by wdfx on Wednesday October 11, 2017 @08:44AM (#15449264)
as for using comments to disable code - you probably should have the active code in source control and then you are free to simply delete it.
Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @09:03AM (#15449385)
This solution or simply a switch to temporarily disable some chunk of code should be an easy-to-use part of the editor. The programmer should not be concerned with implementation details (implementation details of the editor/language, not the program being written) like nested comments, indentation, etc.
Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @08:53AM (#15449331)
"Visual programming" seems to have too many meanings. "Rich text" too.

I meant code editors that "know" that you are writing code and make things easier for you. In other words, exactly the opposite to one that prompts absurd debates about if multiline comments are a good or a bad idea.

Re:Block Comments Are a Bad Idea by LeifCarrotson on Wednesday October 11, 2017 @09:06AM (#15449399)
> make things easier for you

This sounds a lot like "do what I mean." You have to tell the editor in some way that you want to write a block comment or not, and that you want to end it.

My editor does make somethings easier for me - if I start a block comment, it automatically inserts the block comment closing character after my cursor. It does syntax highlighting of the block comments, so it's obvious at a glance where they begin and end. I can declare or remove a bunch of single-line comments by selecting a block of text and hitting a shortcut key, or by creating a multi-line cursor at the start of the lines and adding or deleting the single-line comment characters.

I find it hard to imagine an editor with an interface which is easier and faster than entering simple text, once I'm intimately familiar with the shortcuts used with the editor and the syntax of the language I'm writing in. If one exists or could exist, I'd love to know about it!

Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @03:48PM (#15452804)
I find it hard to imagine an editor with an interface which is easier and faster than entering simple text

So you call "entering simple text" to the automatic managing of comments that you just described? I can't honestly agree with that ;)

Re:Block Comments Are a Bad Idea by cat199 on Wednesday October 11, 2017 @08:27AM (#15449168)
I think OP is suggesting something akin to the magical automated dev tools of the 1980s (OOH ITS GRAPHICAL) which never actually came to fruition.
Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @08:58AM (#15449361)
I don't know what you refer to. But anyway, be careful with discarding ideas that didn't work in the 80's. What was unpractical then could be very convenient today.

Edit: actually I'm curious how much time it will take for my gp comment to go from "downvoted eccentricity" to obvious.

More edit: I'm not only thinking in more computing power. We know a little more on usability and user experience now than then.

Re:Block Comments Are a Bad Idea by LeifCarrotson on Wednesday October 11, 2017 @09:13AM (#15449430)
Like Light Table? In the 80s, it would be unimaginable that you could re-compile and run code with every keystroke, or watch the values of variables updating in real time. The demo (http://lighttable.com/#see) would be inconceivable.
Re:Block Comments Are a Bad Idea by narag on Wednesday October 11, 2017 @03:57PM (#15452885)
That seems too complex. In the 80's there was TurboPascal, an IDE sold for $50 with step-by-step execution and variable inspection. Compilation was extremely fast.

I dislike doing things with every keystroke. I hate when I start typing something in an IDE and it rushes to underline the word with a disapproving red line.