Enterprising Michael
by in Error'd on 2024-04-26
Faithful Michael R. is good for a chuckle today. "I am using the free tier Infura right now but think I will go enterprisey straight away." Can't turn down a deal like that, eh?
Faithful Michael R. is good for a chuckle today. "I am using the free tier Infura right now but think I will go enterprisey straight away." Can't turn down a deal like that, eh?
Ulvhamne sends us some bad code that, well, I think at this point we should really coin a name for this particular anti-pattern.
@Override
public int getNumOfItemsInDataContainer(int parDataId)
{
int numberOfItems = 0;
for (Integer x : myTransactionDataContainerMap.keySet())
{
numberOfItems ++;
}
return numberOfItems;
}
Bob's employer had a data-driven application which wasn't performing terribly well. They had some in-house database administrators, but their skills were more "keep things running," and less "do deep optimizations". The company opted to hire a contract DBA to come in, address the performance problems, and leave.
In actual fact, the DBA came in, ran some monitoring, and then simply wrote some guidance- generic, and frankly useless guidance. "Index on frequently queried fields," and "ensure database statistics are gathered on the appropriate schedule."
Marcus's team was restructuring the API, and the architect thus wanted a number of methods marked obsolete, to encourage developers to move to the new version of the API. So the architect created a Jira task, assigned it to a dev, and moved on.
Somehow, this C# code got committed and merged, despite being code reviewed:
As oft discussed, null-terminated C-style strings are an endless source of problems. But there's no problem so bad that it can't be made worse by a sufficiently motivated developer.
Today's rather old code comes from Mike, who inherited an old, MFC application. This code is responsible for opening a file dialog, and the key goal of the code is to configure the file filter in that dialog. In MFC, this is done by passing a delimited string containing a caption and a glob for filtering. E.g., "Text Files (.txt) | *.txt" would open a dialog for finding text files.
This week we have a special visit from a mythical beast: the snarklemma. But first, a non-error Error'd.
Obsessive Optimizer Ian K. "Walmart's nationwide network of warehouse stores means they can save time and money by shipping locally. FedEx has them covered: Their nationwide shipping fleet determined the shortest path from Houston to its largest suburb goes via Georgia." Not the shortest path, nor the fastest, but surely the cheapest one that meets the delivery date requirement. It's probably not an error, and I believe it, but I still can't believe it!
Yesterday we talked about bad CSS. Today, we're going to talk about bad HTML.
Corey inherited a web page that, among other things, wanted to display a bulleted list of links. Now, you or I might reach for the ul
element, which is for displaying bulleted lists. But we do not have the galaxy sized brains of this individual:
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; }