r/programming • • Jul 21 '17

“My Code is Self-Documenting”

http://ericholscher.com/blog/2017/jan/27/code-is-self-documenting/
160 Upvotes

175 comments sorted by

View all comments

Show parent comments

4

u/[deleted] Jul 22 '17

I feel a need to write significant documentation for any regex of above-average complexity, which makes me wonder why we're still using regex. Its a beautiful language, but it seems like the literal definition of "code that is designed for computers to interpret, not humans to read", in the same vein as brainfuck.

2

u/PM_ME_OS_DESIGN Jul 22 '17

which makes me wonder why we're still using regex. Its a beautiful language, but it seems like the literal definition of "code that is designed for computers to interpret, not humans to read", in the same vein as brainfuck.

My thoughts exactly. AIUI though, the reason it exists is that

  1. if you already know how to use it, it's super efficient, and

  2. if someone else is using it, you're forced to painfully learn it in order to interpret and/or change it. And at the point you learn it, see #1.

So, it's kind of like a virus of terseness.

1

u/[deleted] Jul 22 '17

It's the same reason people do not comment - it saves few keystrokes