# Issue using optional argument before options [duplicate]

I have a problem using optional arguments before an OptionsPattern:

Options[f] = {"Opt" -> None};
f[x_, y_:Automatic, OptionsPattern[]] := {x, y, OptionValue["Opt"]}
f[1, "Opt"->"wrong"] (* returns {1, "Opt" -> "wrong", None} *)


As you can see, mma assigns y the option rule, not Automatic!

What is the fix here?

This might be a known bug, as I remember encountering this type of thing before, or maybe I just forgot how to handle it?

Options[f] = {"Opt" -> None};

I have to say, though, mixing both optional args and Options has always felt wrong to me. In my mind, optional arguments are the lazy-person's Options (although it is nice that they can do the pattern matching up front). Is there any reason not to make y an option?
• @JasonB. I'd say that the determining what is tangential and what is central to the task at hand is a pretty subjective call. So much so that I often find myself rewriting an interface to take only Options and required arguments after initially writing it to take optional args. For the most part I find myself wishing I had just made things options from the get-go. – b3m2a1 Feb 24 at 16:02