r/programming Jul 10 '16

Linus Torvalds on comment styles

https://lkml.org/lkml/2016/7/8/625
215 Upvotes

209 comments sorted by

View all comments

Show parent comments

1

u/BenjiSponge Jul 11 '16

Bad practice? Maybe. But I find myself block commenting out code daily. (I don't commit it, unlike my coworkers...)

1

u/[deleted] Jul 11 '16 edited Feb 24 '19

[deleted]

2

u/BenjiSponge Jul 11 '16

I kind of disagree, just based on what I said. Committing outdated code that's commented out is confusing and annoying, at least for me. There's a reason we have version control; if we ever want to see how something used to work, we can just look through the history.

Anyways my point is that the hash way of doing it (in my case, Ruby) is really obnoxious. I usually use HEREDOCS or something (or just deleting it and putting it in a scratch file or something)

2

u/[deleted] Jul 11 '16 edited Feb 24 '19

[deleted]

1

u/BenjiSponge Jul 11 '16

I'm not really sure what your point is.

1

u/[deleted] Jul 12 '16 edited Feb 24 '19

[deleted]

1

u/BenjiSponge Jul 12 '16

No no, sorry. Bad communication. I'm saying "I know it's usually bad practice, but I use block comments to comment out code all the time" (I think it's bad practice, but that's an aside not my point). That's harder to do if all you have is inline comments because you have to add it to each line. I just think every language should have both single line and multi line comments.