Stringify All the Things!
by in CodeSOD on 2014-09-30When Justin submitted this C# code, he knew what line to include in the subject line of the email to get our attention:
if (String.Empty == null) GC.KeepAlive(string.Empty);
When Justin submitted this C# code, he knew what line to include in the subject line of the email to get our attention:
if (String.Empty == null) GC.KeepAlive(string.Empty);
Dan’s team had a large re-engineering project. They wanted to remove some Java dependencies and replace the UI layer with their new, in-house developed standard library. Like most large maintenance projects, it was big, had a few hidden traps, but was mostly time consuming tedium. For the tedious bits, they decided to bring on a new developer.
William was that developer. He radiated confidence like an LED bulb- cold, harsh, and efficient. He said all the right things in the interview. When Dan showed him their Git repository, William nodded sagely, “I know my way around Git quite well. I appreciate the distributed part of it. It gives me the freedom to work alone. I work best alone.”
Dan’s team wanted somebody who could work with minimal guidance, so William’s lone gunman motto seemed like a good idea. They brought him on, and Dan spent the first few days getting him set up, introducing him to the code base, and helping him with any questions he had. William didn’t have many, as he reminded Dan, “I don’t need you hovering over my shoulder. I work best alone.”
Visual Basic’s error handling is its own special WTF in itself. For those that haven’t had to suffer through it, you can set the error-handling mode with a special On Error
statement. For example, On Error Resume Next
, is a delightful statement that tells Visual Basic to simply ignore errors, and continue execution. A good programmer will know to check errors with conditional statements.
More common, is the On Error Goto ErrHandler
approach. As the code implies, when an error occurs, this simply executes a goto to jump to a specific label, with all of the fun that goto statements normally include.
Matteo recently interviewed a candidate that was employed elsewhere as an “architect”. His responses to the standard soft-skills questions sounded a bit rehearsed, which made Matteo suspicious, so he started asking some more technical questions, like: “What’s the difference between an interface and an abstract class?”
“Well, in some logarithms , an interface is going to be internal to the system, but an abstract class has terminators that make it external.”