Curious Perversions in Information Technology
7k followers 5 artykułów/tydzień
CodeSOD: Many Unhappy Returns

Gavin continues work on the old C++ app he inherited. Today we get a delightful smattering of bad choices. HRESULT CExAPI::GetPageCacheForFolder( IN CEntryID *p_cio_Folder, OUT CPageCache **pp_PC ) { CEntryID *p_cio_Local = new CEntryID( this, p_cio_Folder ); switch ( p_cio_Folder->m_uiType ) { case EID_TYPE_EMPTY: return S_OK;...

Tue May 14, 2024 14:23
CodeSOD: Accessed Nulls

"The attached class connects to an Access database," writes Nicolai. That's always a good start for a WTF. Let's take a look. public class ResultLoader { private static Logger sysLog = Logger.getLogger(ResultLoader.class); private static String url = "somePath"; /** * get the ResultTable from the Access database * * @param tableName...

Mon May 13, 2024 15:13
Error'd: Left Hand Right

Tim Y. is on Fire with this burn. "Competing teams inside Google? Or just the AI recognizing marketing tactics?"   Not to be outdone, the other big search conglomerate comes in for some anonymous criticism from a poster who says their name is "irrelevant". "I was suspecting for some time that bing is giving less and less reward points....

Fri May 10, 2024 13:57
CodeSOD: Reflect on Your Mistakes

While Java didn't invent putting a toString method in the base class of every object, it certainly made it mainstream. The nice thing about the method is that it allows you to turn any object into a string, though it's up to the implementor to decide what a good string representation is. But what if you want to ensure that the object you're handed is...

Thu May 9, 2024 15:24
Coded Smorgasbord: Minimal Commentary

Comments explain a lot about our code. And sometimes, the comments explain more than the code itself. Alastair found this lovely comment, which demonstrates an excellent, if confusing, understanding of a boolean "or": // Only add delivery option if it has no weight bands or at least one weight band. The developer has left the company, so no one...

Wed May 8, 2024 15:21
CodeSOD: Suspicious Contents

While poring through some VB .Net code, John noticed some odd things in their datamodel. For example, a different process would scan files, and log any "suspicious" files into a database. The program John supported would then report on that data. One of their classes had a property which looked like this: Public ReadOnly Property SuspectedItem As...

Tue May 7, 2024 14:32

Zbuduj własny kanał informacyjny

Gotowy, by spróbować?
Rozpocznij 14-dniowy okres próbny, karta kredytowa nie jest wymagana.

Załóż konto