What's so bad about building XML with string concatenation?

前端 未结 12 1362
长发绾君心
长发绾君心 2020-12-01 12:21

In the thread What’s your favorite “programmer ignorance” pet peeve?, the following answer appears, with a large amount of upvotes:

Programmers who build XML u

12条回答
  •  醉梦人生
    2020-12-01 13:10

    If you need trivial XML then it's fine. Its just the maintainability of string concatenation breaks down when the xml becomes larger or more complex. You pay either at development or at maintenance time. The choice is yours always - but history suggests the maintenance is always more costly and thus anything that makes it easier is worthwhile generally.

提交回复
热议问题