Sean Hoffman
Nov 3, 2021

--

As an ex-C# programmer, I actually like String.Empty, and as a current Go programmer I wish there was an equivalent in Go. You present excellent arguments though in favor of "" over string.Empty though. I'm curious what if any performance difference there might be. Truth be told I think I always used string.IsNullOrEmpty() anyway, which theoretically should be slower than string.Empty().

Regardless, I absolutely agree that it should be a constant.

--

--

Sean Hoffman
Sean Hoffman

Written by Sean Hoffman

Software Developer (C++, C#, Go, others), Husband, Father. I eat fried potatoes annually on July 14th.

No responses yet