CodeSOD: A Tern at the Build Process
by Remy Porter from The Daily WTF on (#41SXA)
Justin Self inherited an internal build tool. Rome may not have been built in a day, but this tool was. It "simplifies" provisioning development environments, claiming machines in the environment for certain tasks, and so on.
(e.BuildStatus == null ? (e.Branch == null ? "" : ($"\nBranch: <{e.BranchUrl}|{e.Branch}>")) : ($"\n{(e.BuildStatus == "Building" ? "Building" : e.BuildStatus == "Success" ? $"Built" : "Build failed")}: <{(e.BuildStatus == "Success" ? e.BuildReleaseUrl : e.BuildUrl)}|{e.BuildRelease}>") + $"{GetCardUrl(e.Branch)}") + $"\n{(e.DeployStatus == "Deploying" ? "Deploying" : e.DeployStatus == "Success" ? "Deployed" : "Deploy failed")}: <{e.DeployUrl}|{e.DeployRelease}>{GetCardUrl(e.DeployRelease)}"Whitespace added for "readability"
Unfortunately, this ternary is one of twenty in a row. Justin writes:
[Advertisement] ProGet can centralize your organization's software applications and components to provide uniform access to developers and servers. Check it out!I wanted to make a change to it but" after the 4th ternary, I could no longer remember what I was doing and had trouble picturing my children's faces.