There's really no reason not to do this straight up in a loop. It's probably better. But the conceptual model of the problem that I have doesn't really connect with that.
-
-
Show this thread
-
Mentally, what I am doing is applying a well-defined permutation to every element in a linked list, not walking through a string and building a new one element by element.
Show this thread -
I want a function doo-hickey to apply to each thing. I want to apply them to the collection of things all at once and return the right result. Ultimately, it's the same thing when it comes down to the code bits. But I like when my code looks like my mental model.
Show this thread -
There are some legitimate benefits to this approach. It makes it easier to debug. We've decomposed all of the logical operations into distinct parts, not one big mashup of imperative top-down code.
Show this thread -
It makes the exception handling clear: if an exception happens, it's because the input has an unexpected value, and not because, idk, we've iterated out of bounds or something. There's no code that leaks into the if statements. We don't need breaks.
Show this thread -
This is all to say I really wish Data Science as a field used a language that was more naturally connected to functional analysis.
Show this thread
End of conversation
New conversation -
-
-
I used to hate nested functions, but at least in Python they've grown on me for making code clearer.
-
I have made my piece with them by thinking of them as lambdas who have been given a name
-
I first learned about nested functions by studying ancient x86 of all places LOL. x86 has instructions with rarely-used arguments (ENTER/LEAVE) explicitly for making nested function vars easy to access. Prob meant for Pascal when that was popular.
End of conversation
New conversation -
-
-
Wow, sounds like the mainframe functional programming debates in the 70’s. Although I’m sure I’m way too out of date technically to comment further.
-
I think mainframes have come again. I lack the context the old stuff was written in, but it sure looks applicable to modern debates
End of conversation
New conversation -
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.