CodeSOD: Classical Design
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
1d ago
There is a surprising amount of debate about how to use CSS classes. The correct side of this debate argues that we should use classes to describe what the content is, what role it serves in our UI; i.e., a section of a page displaying employee information might be classed employee. If we want the "name" field of an employee to have a red underline, we might write a rule like: .employee .name { text-decoration: underline red; } The wrong side argues that this doesn't tell you what it looks like, so we should have classes like red-underline, because they care what the UI element looks like, n ..read more
Visit website
CodeSOD: A Small Partition
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
1d ago
Once upon a time, I was tuning a database performance issue. The backing database was an Oracle database, and the key problem was simply that the data needed to be partitioned. Great, easy, I wrote up a change script, applied it to a test environment, gathered some metrics to prove that it had the effects we expected, and submitted a request to apply it to production. And the DBAs came down on me like a sledgehammer. Why? Well, according to our DBAs, the license we had with Oracle didn't let us use partitioning. The feature wasn't disabled in any way, but when an Oracle compliance check was pe ..read more
Visit website
CodeSOD: A Top Level Validator
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
4d ago
As oft stated, the specification governing email addresses is complicated, and isn't really well suited for regular expressions. You can get there, but honestly, most applications can get away with checking for something that looks vaguely email like and call it a day. Now, as complicated as the "accurate" regex can get, we can certainly find worse regexes for validating emails. Morgan did, while on a contract. The client side had this lovely regex for validating emails: /* Check if a string is in valid email format. Returns true if valid, false otherwise. */ function isEmail(str) { v ..read more
Visit website
Error'd: Paycheque
The Daily WTF | Curious Perversions in Information Technology
by Lyle Seaman
6d ago
There are an infinite variety of ways to be wrong, but only very small number of ways to be right. Patient Peter W. discovers that MS Word is of two minds about English usage. "Microsoft Word just can't seem to agree with itself on how to spell paycheck/pay check." Faithful readers know it's even worse than that.   Slow Daniel confused me with this complaint. He writes "It seems that the eclipse has reversed the flow of time for the traffic-free travel time." I don't get it. Can readers explain? The only WTF I see here is how much faster it is to walk than to drive 2 miles. Franconia i ..read more
Visit website
CodeSOD: To Tell the Truth
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
6d ago
So many languages eschew "truth" for "truthiness". Today, we're looking at PHP's approach. PHP automatically coerces types to a boolean with some fairly simple rules: the boolean false is false the integer 0 is false, as is the float 0.0 and -0.0. empty strings and the string "0" are false arrays with no elements are false NULL is false objects may also override the cast behavior to define their own everything else is true Honestly, for PHP, this is fairly sane and reasonable. The string "0" makes my skin itch a bit, and the fact that the documentation page needs a big disclaimer warning tha ..read more
Visit website
CodeSOD: Terminated By Nulls
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
1w ago
Strings in C are a unique collection of mistakes. The biggest one is the idea of null termination. Null termination is not without its advantages: because you're using a single byte to mark the end of the string, you can have strings of arbitrary length. No need to track the size and worry if your size variable is big enough to hold the end of the string. No complicated data structures. Just "read till you find a 0 byte, and you know you're done." Of course, this is the root of a lot of evils. Malicious inputs that lack a null terminator, for example, are a common exploit. It's so dangerous th ..read more
Visit website
Two Pizzas for ME
The Daily WTF | Curious Perversions in Information Technology
by Bobby T. Johnson
1w ago
Gloria was a senior developer at IniMirage, a company that makes custom visualizations for their clients. Over a few years, IniMirage had grown to more than 100 people, but was still very much in startup mode. Because of that, Gloria tried to keep her teams sized for two pizzas. Thomas, the product manager, on the other hand, felt that the company was ready to make big moves, and could scale up the teams: more people could move products faster. And Thomas was her manager, so he was "setting direction." Gloria's elderly dog had spent the night at the emergency vet, and the company hadn't grown ..read more
Visit website
CodeSOD: They Key To Dictionaries
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
1w ago
It's incredibly common to convert objects to dictionaries/maps and back, for all sorts of reasons. Jeff's co-worker was tasked with taking a dictionary which contained three keys, "mail", "telephonenumber", and "facsimiletelephonenumber" into an object representing a contact. This was their solution: foreach (string item in _ptAttributeDic.Keys) { string val = _ptAttributeDic[item]; switch (item) { case "mail": if (string.IsNullOrEmpty(base._email)) base._email = val; break; case "facsimiletelephonenumber": base._faxNum = val; break; case "telephonenumber ..read more
Visit website
Error'd: Past Imperfect
The Daily WTF | Curious Perversions in Information Technology
by Lyle Seaman
1w ago
A twitchy anonymous reporter pointed out that our form validation code is flaky. He's not wrong. But at least it can report time without needing emoticons! :-3 That same anon sent us the following, explaining "Folks at Twitch are very brave. So brave, they wrote their own time math."   Secret Agent Sjoerd reports "There was no train two minutes ago so I presume I should have caught it in an alternate universe." Denver is a key nexus in the multiverse, according to Myka.   Chilly Dallin H. is a tiny bit heated about ambiguous abbreviations - or at least about the software that i ..read more
Visit website
CodeSOD: A Valid Applicant
The Daily WTF | Curious Perversions in Information Technology
by Remy Porter
1w ago
In the late 90s into the early 2000s, there was an entire industry spun up to get businesses and governments off their mainframe systems from the 60s and onto something modern. "Modern", in that era, usually meant Java. I attended vendor presentations, for example, that promised that you could take your mainframe, slap a SOAP webservice on it, and then gradually migrate modules off the mainframe and into Java Enterprise Edition. In the intervening years, I have seen exactly 0 successful migrations like this- usually they just end up trying that for a few years and then biting the bullet and do ..read more
Visit website

Follow The Daily WTF | Curious Perversions in Information Technology on FeedSpot

Continue with Google
Continue with Apple
OR