Why are Perl source filters bad and when is it OK to use them?

后端 未结 7 1515
Happy的楠姐
Happy的楠姐 2020-11-30 07:55

It is \"common knowledge\" that source filters are bad and should not be used in production code.

When answering a a similar, but more specific question I couldn\'t

7条回答
  •  一整个雨季
    2020-11-30 08:18

    I don't like source filters because you can't tell what code is going to do just by reading it. Additionally, things that look like they aren't executable, such as comments, might magically be executable with the filter. You (or more likely your coworkers) could delete what you think isn't important and break things.

    Having said that, if you are implementing your own little language that you want to turn into Perl, source filters might be the right tool. However, just don't call it Perl. :)

提交回复
热议问题