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
Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug
it’s good that

TheFluff posted:

writing a node js app, op

javascript is awful regardless of how you write it, so I was looking up ways to write it in some less awful way and came across lodash-FP, which seemed to me to be pretty cool and good, so I used that, and it was pretty cool and good as far as javascript goes, so now I'm a currying liker

it’s good that you like fp in JavaScript because it’s not like it has integers

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Colonel Taint posted:

fp is cool until something doesn't quite work as you expect and you're left wondering wtf and you can't debug because your 'clever' and 'elegant' one-liner is actually wrapping 10 different things and all you can do is stare at it and think and hope some epiphany about what's wrong pops into your head.

The epiphany that should come to you is that all programming is garbage and you're wasting your life

*morpheus voice* what if i told u that if you use functional programming you won't have to debug (because you won't make bugs)

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

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

spending time doing fp in erlang made me better at ruby which is extremely oo

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

ultravoices posted:

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

that's really hard to read, you want:

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

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

gonadic io posted:

ive formally verified that my program is a piece of poo poo

yes i too us the formal verification tool `ls` to locate programs that are poses

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

atomicthumbs posted:

Programming in a functional style can also be accomplished in languages that are not specifically designed for functional programming. For example, the imperative Perl programming language has been the subject of a book describing how to apply functional programming concepts.[29] This is also true of the PHP programming language.[30]

step 1 to functional php is using the "render mathy" tool `rm` on all your php files

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Ludwig van Halen posted:

my dude functional programming has been around as long as C has had function pointers

functional programming predates c by almost 20 years

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

MALE SHOEGAZE posted:

no lie i'm going to miss scala though, i feel like FP is just starting to click for me

looks like scala is just starting to right click empty trash imo

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

Colonel Taint posted:

Is this true of all fp? Like I've mainly done programming in the small type stuff for course work in scheme, sml, and some racket so I haven't had to deal with this, but it sounds hosed up.

e: Possibly less hosed up than having to worry about link order with large C projects though, now that I think about it.

nah

erlang & elixir are 100% fine with functions in a module being out of order (otherwise you can't have functions that call each other)

ruby's fine with cross-file dependencies as long as the names can be resolved at runtime

rust is good

Adbot
ADBOT LOVES YOU

Cocoa Crispies
Jul 20, 2001

Vehicular Manslaughter!

Pillbug

fart simpson posted:

i think you can be out of order in haskell, too. and also in elm and purescript

most haskellers are out of order in some way

  • Locked thread