- Feature Articles
- CodeSOD
- Error'd
-
Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Edit Admin
Sometimes the cure is worse than the frist disease.
Edit Admin
Wait! Isn't this the same site that has roundly condemned "Soft Coding" in the past? ( e.g. https://thedailywtf.com/articles/soft_coding )
Edit Admin
With XML I find CDATA is your friend. e.g.
Addendum 2025-07-02 07:51: Ah, an off by two error
Edit Admin
At the same time, destination URLs, for example (or file paths) are frequently things that do have a template structure to them. Left to my own devices, I'd likely not use a format string, admittedly (because yeah, you're right, the order of the elements is well known, just have "domain", "root", and then the API end point is well known). So I shouldn't have called it wise, but it's certainly inoffensive.
Edit Admin
It depends. If team X maintains a software package and team Y installs it, perhaps in several places, then this configuration gives them some flexibility to handle things without passing them off to team X. However, if team X owns the software top to bottom, then it's almost certainly stupid. Why bother assigning a dev the job of changing a config when you can assign the same dev the job of changing the UI? If your answer is "it saves us a deployment", then you are bad at CI/CD, and that's where you should concentrate your effort, not on working around your weaknesses.
Edit Admin
There's an awful lot of "xxx" in that template. Maybe the developer is injecting a popup to his OF into the sales app?
Using this template to avoid writing "&" is, indeed, stupid. If that were coded into the template rather than be a parameter to string.Format it would have to be considered "sane". This code is a frist for me -- I've never seen anything like it and hope I never do!
Edit Admin
It's not completely unreadable. The word 'pristjek' is Scandinavian and means 'price check'
Edit Admin
Am I the only one who takes offence at the use of
<add key.../>
?This implies that this XML data structure really acts as a sequence of commands for populating a dictionary. Which raises the question: WHY? Why treat an XML file like a micro language for populating a dictionary instead of just mapping the dictionary to an XML structure?
Note that the difference would merely be to switch "add" for "entry" or similar. But the implications of the tag "add" on how the programmer was thinking about the problem frighten me.
Edit Admin
The fact that you believe the programmer was thinking is what frightens me.
Edit Admin
@R3D3: The standard .Net XML configuration system has add semantics. Because it also has remove semantics. There are times and places where that makes sense.
https://learn.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/appsettings/
Edit Admin
Same reason some people treat Perl as an operating system...?