Counting the API arguments…

Today Matt posted a half-joking twit about the acceptable number of arguments that can be passed to a function…

I took the challenge VERY SERIOUSLY and decided to investigate.

In my old post I shared my collections of API prototypes that I had extracted from various Microsoft documentation and other sources over the years; so my task was really easy — analyze this data and find the best candidate APIs that meet the criteria.

I first looked at 2004-2007_apis.zip file that included the number of arguments in one of the columns. After merging all this data into a single file, loading it to Excel, and sorting it in a descending order by the number of arguments I immediately got my first candidate:

It takes 17 arguments :-O

I then looked at 2013_apis.zip file as well — this time I had to write a simple script to parse the file and count number of arguments for each function and then save the results to a file. Same as before, I then loaded it to Excel, sored it in a descending order by the number of arguments and now I had my final candidate:

– it takes 21 arguments šŸ™‚

Now, there may be other functions that take even more arguments as an input, but I bet they are quite rare. If you find one tough, please let me know and I will update this post.

Bonus

The longest api name I have ever encountered is this (1077 characters):

  • ZN5boost12accumulators6detail14build_acc_listINS_6fusion12mpl_iteratorINS_3mpl6v_iterINS5_6v_itemINS1_19accumulator_wrapperINS0_4impl18lazy_variance_implIdNS0_3tag4meanEEENSB_13lazy_varianceEEENS7_INS8_INS9_11moment_implIN4mpl_4int_ILi2EEEdEENSB_6momentILi2EEEEENS7_INS8_INS9_11median_implIdEENSB_6medianEEENS7_INS8_INS9_22p_square_quantile_implIdNS0_10for_medianEEENSB_28p_square_quantile_for_medianEEENS7_INS8_INS9_8max_implIdEENSB_3maxEEENS7_INS8_INS9_9mean_implIdNSB_3sumEEESC_EENS7_INS8_INS9_8sum_implIdNSB_6sampleEEES12_EENS7_INS8_INS9_10count_implENSB_5countEEENS7_INS8_INS9_8min_implIdEENSB_3minEEENS5_7vector0INSH_2naEEELi0EEELi0EEELi0EEELi0EEELi0EEELi0EEELi0EEELi0EEELi0EEELl0EEEEENS4_INS6_IS1R_Ll9EEEEELb0EE4callINS_9parameter3aux8arg_listINS1Z_15tagged_argumentINSB_11accumulatorENS0_15accumulator_setIdNS0_5statsIS1E_SC_SZ_SQ_SE_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_S1H_EEvEEEENS1Z_14empty_arg_listEEEEENS3_4consIS1F_NS2A_IS1B_NS2A_IS18_NS2A_IS14_NS2A_IS10_NS2A_ISW_NS2A_ISR_NS2A_ISN_NS2A_ISF_NS3_3nilEEEEEEEEEEEEEEEEEEERKT_RKS1T_RKS1V

it’s from the sample:

  • 8005F35D2C2642B33ADB77CBD100BF64CC7DB611FA789AE18BFFF3F91B26AB40_4E8BA4874E4D7B99C0BDF31EFBB4051DCDB2F29D

Additionally, the API name that includes the most words in it (11) is:

  • AccessCheckByTypeResultListAndAuditAlarmByHandle

What Champagne to drink?

Reading articles about criminals enjoying (I really hope they are not just flexing) drinking the emperor of all Champagnes aka Dom PĆ©rignon, makes me feel that they are potentially missing out on so many opportunities! Not only Dom PĆ©rignon is not the only champagne that is worth drinking, drinking the same champagne all the time is actually very boring, and let’s be honest – very uninspired. It’s also very self-limiting – c’mon… how do you know you are drinking a superb champagne if you cannot even compare it against others?

This short intro aims at making you a bit more curious about Champagne!

Personally, I’d suggest trying Veuve Clicquot (Yellow Label or Rose), it’s actually a favorite of mine. Price is usually around 4 times lower than Dom, but this champagne is simply fantastic:

Next, try MoĆ«t & Chandon – it’s another classic, very popular in UK and on cruises – in fairness though: while I can drink it, I must say this is not my favorite, BUT it it is still a very good champagne:

Another interesting champagne to try is Laurent Perrier Rose – mind you, it’s a very unusual taste, but I love it:

Winston Churchill’s favorite – Paul Roger – is actually not my cup of tea, as I find it a bit too sour for my taste, but apparently UK Tories love it, so it may be worth trying it, even if just to test if there is any bit of UK Tory in you (j/k). Jokes aside, it’s a really decent champagne!

Another one that is pretty good is Bollinger. Also known as the official James Bond champagne it is definitely one you should try (even if not my fav):

Tattinger is strange to me. Can’t put my finger on it, but I quite like it, and since I don’t know why, this is why I am recommending it:

Last, but not least — try Ruinart and Dom Ruinart. This brand is my totes and ultimate favorite, some even think it’s better than Dom PĆ©rignon and I kinda know why — when you drink it you may get that ‘feel’ of complexity that Dom PĆ©rignon is so famous for:

The other ‘super posh’ champagnes are:

  • Armand de Brignac Ace of Spades Champagne – it’s imho definitely overpriced and not worth it
  • Louis Roederer Cristal – decent, but not very inspiring
  • Louis Roederer <any other sub-brand> – again, not my cup of tea, because too much on an acidic side
  • Krug Champagne (including its Rose version) – the most intriguing champagne I have ever tasted; do not buy it until you tried a number of other champagnes first, just to fully understand why drinking this champagne it is one of the most exquisite experiences out there…

There are more, but let’s get you started! Serve them chilled, and drink responsibly! While we may all agree that Dom PĆ©rignon is the Cobalt Strike of champagnes, you can only know for sure if you can actually compare it against the others…

Last, but not least… many of these exquisite brands offer ‘vintage’ or ‘seasonal’ batches that are priced extra, so extra that it sometimes hits many thousands pounds sterling, per bottle. They are often marked by the year (f.ex. Dom PĆ©rignon 2012 or Veuve Clicquot Vintage 2012) to highlight an especially good harvest season. Some are just ‘special’ (aka more expensive) spin-offs f.ex. Veuve Clicquot Grande Dame that I actually don’t like at all. And some are just obvious celebrity trips/flexes (f.ex. Dom Perignon / Lady Gaga edition, Armand de Brignac Ace of Spades as a whole). I tried some of these and I don’t find them convincing enough. I think it’s just a marketing ploy, really, to squeeze us all out. Having said that, you may still want to get familiar with terms like ‘brut’, ‘cuvee’, ‘Blanc de Blancs’, ‘vintage’ vs. ‘non-vintage’ and at least recognize basic types of grapes f.ex. chardonnay (white) and pinot noir (red).

The funniest bit is that I am not a wine sommelier and I actually don’t drink much wine, because… I really don’t like it. I love Champagne though and I have no idea why. Although, I don’t think of it too much because I know what Napoleon, allegedly, said about it: In victory, you deserve champagne. In defeat, you need it. Could not agree more: we all deserve and need it.