Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

OldAlias posted:

yeah but in the Linux “worse is better” way. if there are libs that handle your problem domain well then use it. if not then you’re on your own and do it yourself. it can be significantly easier to reason about with the caveat of an upfront cost of time, to formulate a solution and to understand anything. you could use fp features in otherwise OO langs I guess

list(filter(lambda x: x in big_butts, map(fart, butts))) feels fun to write even if it is less clear than a loop.

Adbot
ADBOT LOVES YOU

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

Cocoa Crispies posted:

that's really hard to read, you want:

code:
map(fart, butts)
|> filter(lambda x: x in big_butts)
|> list()

i agree, python list/dict comprehensions and map/reduce/lambda expressions are not the easiest thing to read.

i mostly use them as specific idioms rather than composing up a piece of fresh line noise, things like flattening a nested list, or reversing a mapping.

you can put additional whitespace in as when you are inside an argument as you aren't in semantic whitespace land anymore, but it's an open question of style.

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?
computerphile just posted their what is a monad video, which was somewhat helpful, but stay for the end for the presenter making bitchy spergy functional programmer comment about why they are called monads and not something more understandable for mere computer programmers.

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

gonadic io posted:

unless the comment "it's stupid and historical and literally everybody wishes they were called something else but it's too late now" he's wrong.

well it is what they are and calling them what they are gives credit to the mathematicians who discovered them

for me it's "oh we have this black box of a pure function how to do we get something useful out of it, and that interface is called a monad and it is kind of like wrapping up the function in a case switch which is something like typecasting and something like exception handling and oh god this would all be clear if you were smarter and/or went to college."

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

Symbolic Butt posted:

computerphile is kind of bad lol

dinkering with old computer is cool or hearing from ancients about the origins of things is neat

the guy who parrots lesswrong fears about AI is not so neat

  • Locked thread