The Daily WTF
My plate has been full this week, but not as full as Walter's! "Maybe hold the cheese?" suggests Walter T. regarding a pepper and steak grinder. "Seen at Reading (MA) House of Pizza on Jul 24 2024." If you decide to search around to try to understand the different names for this kind of sandwich, you will undoubtedly discover someone...
Jaco's team had a problems with making an embedded web server shut down properly. Something about the shutdown process was deadlocking, so one of their "ninja Yoda coders" rockstarred their way to a solution. private void stopServer() { try { if (webServer != null) { logger.debug("Shutdown webserver"); // This goes into a dead lock, therefore...
Andy has some concerns about future proofing. In this case, he sends us some C# code that's supposed to validate an IP address. string[] address = StringTools.splitStr(IP, '.'); if (address.length < 4) { throw new Exception("Bad IP format : " + IP); } Andy writes: "IPv6 will never be a thing!" It's not just IPv6, of course....
We're not going to look at code today, and instead, we're going to talk about a code metric. Specifically, "NPath complexity". NPath complexity is a good metric to track, and many static analyzers will do it. Formally written, it's defined: "The NPath complexity of a method is the number of acyclic execution paths through that method." Or, more simply,...
Jan wrote some code that set a property, and a few lines later had to write code to read that value- and the compiler complained. Which is what drew his attention to this C# code: public string ViewNodeFilter { protected get { if (viewNodeFilter.IsNotValid()) { return "null";...
Adrian M. lit up this blooper for us. "Apparently Siemens Mobility wasn't satisfied that a mere 95-year copyright term would be enough for the brochure about their m60-series traffic light controller. I hope I won't have to wait until 2029 for a green light." See for yourself here. Mark W. thinks Doordash needs a kiss on...
Build your own newsfeed
Ready to give it a go?
Start a 14-day trial, no credit card required.