306 points · by jamespwilliams · 4y ago · 208 comments
Cmd+F, badger (Not found).
Cmd+F, mushroom (Not found).
https://www.youtube.com/watch?v=EIyixC9NsLI (video sfw, comments may be the usual YouTube battleground)
https://docs.oracle.com/en/java/javase/11/docs/api/java.base...
https://docs.oracle.com/en/java/javase/11/docs/api/java.base...
I did the exact same thing in Java for an internal library in order to provide type-safe Unit, Singleton<T1>, Pair<T1, T2>, etc.
Can't for the life of me find that class again.
https://www.slf4j.org/apidocs/org/slf4j/Logger.html#error(ja......)
> This form avoids superfluous string concatenation when the logger is disabled for the ERROR level. However, this variant incurs the hidden (and relatively small) cost of creating an Object[] before invoking the method, even if this logger is disabled for ERROR. The variants taking one and two arguments exist solely in order to avoid this hidden cost.
Speed and convenience, I'd imagine? IIRC, arrays are marshalled as SAFEARRAYs in COM and those things are quite heavy-weight, you'd really rather call a 31-parameter function and pass it 27 NULLs in places of extraneous parameters.
Today as of C# 4 you can for example have optional arguments. Not sure if this applies to this method which surely predates C#4.
https://github.com/dotnet/csharplang/blob/main/proposals/csh...
It got deprecated sometime around 8.0 and today it is not even supported (the giant switch got replaced by error message).
https://stackoverflow.com/questions/56623975/pl-python3-with...
When did you last call a function with more than 10 arguments, let alone 30?
Now I'm tempted to go through my code to find the max number of arguments I've used.
Normally, 30 is crazy. But in excel? Who knows...
Also, too many isn't a problem, they're optional, so in practice you'll be treating this as a varargs; there's not much cost to having a few more args. I haven't used this function, but I suspect I'd rarely call in directly anyhow, instead making sane wrappers for various apis you actually care about which in turn call this internally, making the direct call details even less relevant.
Anyone regularly calling a function with actually 10+ parameters is calling for a refactor though.
https://clojure.github.io/clojure/javadoc/clojure/lang/IFn.h...
I guess in Rust and Haskell they are not params of type "Object". Those languages try to maintain type safety where every they can.
https://hackage.haskell.org/package/product-profunctors-0.11...
> cl_map :: Default Zipper a b => (b -> r) -> a -> [r]
> A challenge from a Clojurist on Hacker News (https://news.ycombinator.com/item?id=23939350)
The referenced comment:
> I think the general feeling is that there are some code patterns that are safe and easy to do with dynamic typing, but impossible with simple type systems or more complex with more advanced type system.
> An example would be Common Lisp's `map` function [0] (it takes a number of sequences and a function that has as many parameters as there are sequences). It would be hard to come up with a type for this in Java, and it would be a pretty complicated type in Haskell.
is_computer_on_fire()
double is_computer_on_fire(void)
Returns the temperature of the motherboard if the computer is currently on fire. Smoldering doesn't count. If the computer isn't on fire, the function returns some other value.---
Though of course, the Microsoft engineer[ing committee] was entirely serious when they wrote the OP's function signature, while I imagine the Be engineer having a laugh while adding it to the SDK and then getting it into the official docs in print.
0. https://www.google.com/books/edition/Be_Developer_s_Guide/Wo...
[0]: https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
This is likely for JIT performance, with virtual method lookup. C# does the same thing with string.Format - https://docs.microsoft.com/en-us/dotnet/api/system.string.fo...
Wonder if they changed it at some point, or if I'm just misremembering.
I can see how this is not beautifull but works. Especially when its probably been there for 20 years already :D
http://dev.eclipse.org/viewcvs/index.cgi/org.aspectj/modules...
Yes, this bit me hard on first Rust-based project, to the point of abandonment. (A list that grow and shrink is absolutely not the same thing).
I've worked with a bunch of PMs on technical products, APIs, etc. and I've rarely met anyone discussing that level of detail or willing or able to make such a decision.
The engineers chose a way that worked and it's likely the best way supported at the time, given the other comments I've read here on HN.
"As a program manager at Microsoft, I designed the Visual Basic (VBA) strategy for Excel and completely speced out, to the smallest detail, how VBA should be implemented in Excel."
https://www.joelonsoftware.com/2000/10/04/painless-functiona...
https://developer.apple.com/documentation/contacts/cnlabelco...
People really do use these relation names instead of given name. Everyone in the family using different names, which is confusing to watch as an outsider as you can't learn their given names. It would be like watching everyone else in a family refer to a single person as "sister", "cousin", "niece", "aunt" etc. No-one uses their given name so you as an outsider aren't sure what to call them.
farmor - father's mother
farfar - father's father
faster - father's sister (abbreviated from "far syster")
moster - mother's sistem (abbreviated)
farbror - father's brother
I like to extend the basic set of these to older generations, so instead of "my mormor's father" it'd be "mormorfar". Very practical!
Not only that, but in some cases depending on their (the uncle and your father) relative age. I'm learning Hindi, so for example paternal uncle older than your father is your taaya (ताया, or taauu ताऊ) but younger than your father is your chaacha (चाचा).
Chinese has distinct words for relatives of the same generation (siblings, cousins) who are older or younger than oneself. Like "big brother" and "little brother" in English, but you always include the big/little part. "Younger" specifies that this cousin is younger than the person whose contacts book this is.
Female - Chinese has separate words for male and female cousins
The rest of the word salad specifies a relationship that is approximated by answering the question "is her (maiden) surname the same as my (maiden) surname?" in the negative — either she is a daugher of one of my mother's siblings, and doesn't share my surname because I have my father's surname, or she is my father's sister's daugher, and thus has her father's surname, which again is not the same as mine.
In English, your male siblings are "brothers", and female siblings are "sisters", regardless of age.
In Chinese, we differentiate between younger and elder siblings. Your elder brother is 哥哥, younger brother is 弟弟; elder sister is 姐姐/姊姊, and younger sister is 妹妹.
HasThisTypePatternTriedToSneakInSomeGenericOrParameterizedTypePatternMatchingStuffAnywhereVisitor
It inherits the following methods from class org.aspectj.weaver.patterns.AbstractPatternNodeVisitor: visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
https://www.javadoc.io/doc/org.aspectj/aspectjweaver/1.8.10/...
It really isn't complex.
妹 - female, same generation, younger than you.
表 - cousin outside your family.
CNLabelContactRelationYoungerCousinMothersSiblingsDaughterOrFathersSistersDaught - https://news.ycombinator.com/item?id=28712667 - Sept 2021 (132 comments)
CNLabelContactRelation​YoungerCousin​MothersSiblingsDaughter​OrFathersSistersDaughter - https://news.ycombinator.com/item?id=20341855 - July 2019 (176 comments)
I had developer write something like that once and I learned she does not know how to write loops.
How would you have named this class?
If another language uses the same word for their aunt or uncle, a decent way to represent that in English is `AuntOrUncle`.
If the word 'Sibling' didn't exist, `BrotherOrSister` could be used instead.
I guess stdarg.h like functionality would have been good for C#. Maybe some clean code purist argued against it because it is bad practice or something.
[0] https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
EDIT: Thanks for the downvotes. I am a professional software engineer for hire and in each company this is EXACTLY the issue: documentation. You want me to help you build software? Fine: give me your documentation. Complain about the fact that it takes 2 months to properly understand your software and business rules? Improve your documentation.
FWIW the place to look for documentation of Application.Run is here: https://docs.microsoft.com/en-us/office/vba/api/excel.applic...
MS technical documentation has always been more concerned with quantity over quality.
https://docs.microsoft.com/en-us/office/vba/api/Excel.Applic...
The args have to be object/variants, as it is the values for the sub that will be called and they can have any type. You would use generics today but keep in mind this is 1990s API.