Curious Perversions in Information Technology
7k followers 5 статия/седмица
CodeSOD: A Poorly Pruned Branch

Juliano had this very non-WTF bit of PHP code: if (!$path) { //do stuff } else { //do other stuff } After another team member made a commit, however, the code turned into this: if (1 == 2) { //do stuff } else { //do other stuff } Now, generally, when I see 1 == 2 type expressions, I just assume that this is a templated, generated...

Wed May 15, 2024 14:17
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

Създайте своя емисия с новини

Готови ли сте да опитате?
Стартирайте 14-дневен пробен период, не се изисква кредитна карта.

Създаване на акаунт