# CodeSOD: Extremely One Line

DevFeed: [CodeSOD: Extremely One Line](<https://devfeed.tech/articles/codesod-extremely-one-line-31464.md>)

Original publisher: [Read original article](<https://thedailywtf.com/articles/extremely-one-line>)

Author: Remy Porter

Published: 2026-09-16T06:30:00Z

Content type: opinion

Language: en

Sources: [The Daily WTF](<https://devfeed.tech/sources/the-daily-wtf.md>)

Topics: [ASP.NET](<https://devfeed.tech/topics/aspnet.md>), [Code](<https://devfeed.tech/topics/code.md>), [Visual Studio](<https://devfeed.tech/topics/visual-studio.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [browser](<https://devfeed.tech/topics/browser.md>), [HTTP](<https://devfeed.tech/topics/http.md>)

Tags: [asp-net](<https://devfeed.tech/tags/asp-net.md>), [browser](<https://devfeed.tech/tags/browser.md>), [cli](<https://devfeed.tech/tags/cli.md>), [code](<https://devfeed.tech/tags/code.md>), [codesod](<https://devfeed.tech/tags/codesod.md>), [http](<https://devfeed.tech/tags/http.md>), [studio](<https://devfeed.tech/tags/studio.md>)

## AI overview

This CodeSOD commentary examines an ancient ASP .Net application containing a function written on one line, Safari user-agent detection, and a mysterious "uplevel" value. It criticizes the confusing style and notes that the same pattern appears on multiple pages.

## Source excerpt

Autoformatting your code is a standard thing to do these days. And in those days past, if we're being honest. There's no excuse to not use some kind of autoformatter. Whether you configure your editor to do it or are a weirdo like me who runs a formatter from the CLI as a build step, you've got an easy way to format your code so it looks neat and readable. And some IDEs, like Visual Studio, are pretty insistent about doing this for you. Which makes today's code sample a bit more perplexing. This comes from an ancient ASP .Net application that Austin has the misfortune to work with: protected void Page_PreInit(object sender, EventArgs e){if (Request.ServerVariables["http_user_agent"].IndexOf("Safari", StringComparison.CurrentCultureIgnoreCase) != -1)Page.ClientTarget = "uplevel";} protected void Page_Load(object sender, EventArgs e) { Logic(); } Which function is Logic() called from? The fact that I'm asking probably is enough to get you to scroll over. The entire Page_PreInit function is on a single line, followed by the declaration of the Page_Load function. A confusing and annoying choice. The real bonus is that if the browser has "Safari" in its user agent, we set a field to a mysterious "uplevel" value. A mix of user agent sniffing, strings as enums/flags, and wonderfully unclear names. And yes, this particular pattern appears in more than one page in Austin's application. Someone thought this was not just a good idea, but good enough to do over and over again. [Advertisement] Picking up NuGet is easy. Getting good at it takes time. Download our guide to learn the best practice of NuGet for the Enterprise.