I swear there's a lot of software engineering "best practices" out there that result from people talking themselves into believing that necessary workarounds weren't anti-patterns of a language's quirks but rather features of it.
-
Show this thread
-
One cannot in good faith argue that the duck typing approach in the following answer is a sensible practice.https://stackoverflow.com/a/1952655
9 replies 3 retweets 24 likesShow this thread -
Replying to @EmilyGorcenski
well, no, it's not. the correct answer is "don't do that" :)
1 reply 0 retweets 1 like -
Replying to @eevee
Alas, recent comments suggest it is *the* pattern to use :(
1 reply 0 retweets 0 likes -
Replying to @EmilyGorcenski
i mean, don't check at all; just iterate it and if the caller gave you garbage it's their problem
1 reply 0 retweets 1 like -
-
Replying to @EmilyGorcenski @eevee
but more practical than a lot of people expect
1 reply 0 retweets 2 likes -
for sure. It's just that for a lot of data sci stuff it can be irritating
1 reply 0 retweets 0 likes -
Replying to @EmilyGorcenski @eevee
I'm curious, can you give me an example so I can understand your use case better?
1 reply 0 retweets 0 likes -
Ah, sure... implementig algorithms where things go from vector-like to scalar-like
1 reply 0 retweets 0 likes
What I really want is the type inference to be a little bit smarter and let me do smthing like foreach x in v:.... and have it be fine *without* having to write code around it, for style reasons more than anything
-
-
Replying to @EmilyGorcenski @eevee
hm, i'm still not sure i entirely follow (possibly too general), but that's ok
0 replies 0 retweets 0 likesThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.