oop babbies pls go
>>46870125
missed one
>>46870125
>oop babbies pls go
>posts ocaml, js, and f#
I've got homework to do in haskell. That's the extent of my functional language experience.
Seems like it's pretty wack.
Imperative programmers care about the end results.
Functional programmers care about masturbating over code.
>>46870333
Functional programmers care about writing less code that is readable and intuitive
>JS
ayy
>>46870341
Exactly.
>muh beautiful lambdas and special-snowflake implementation dialects
This is why FP will never be taken seriously outside of academia.
>ocaml, clojure, f#, erland, haskell
what the fuck is javascript doing there
also, what's the purple one on the top left?
>>46870390
>what the fuck is javascript doing there
For shitposting reasons
>>46870390
because javascript is the only successful LISP
OOP: a fedora is a hat.
Functional: a fedora is not a hat, but there's a function that can turn a fedora into a hat.
>>46870390
it's elixir
>js
functionally retarded
>>46870125
penor programming language
>>46870387
see how much nicer it is?void shit() {
int[] nums = new int[100];
for (int i = 0; i < nums.length; ++i)
nums[i] = i;
for (int i = 0; i < nums.length; ++i)
nums[i]++;
}
void good(){
IntStream.rangeClosed(0, 100).map(i -> i+1);
}
>>46870125
Why is functional programming better than object oriented programming?
>>46870492
best is when they are combined
>>46870498
>what is scala
>>46870553
yup, scala is great
>>46870498
Learning Haskell right now and I really can't see what OOP offers other than syntax.
>>46870622
does haskell have traits?
>>46870631
Assuming you're talking about Scala, Google tells me that they're "Similar to interfaces in Java".
I can't say too much but they're probably very similar to type classes in Haskell.
>>46870469
Implying you couldn't have done it using a single loop.
>>46870670
yes, but I'm showing 2 operations here
you can pass the array and stream around in the same way but the functional version is readable
im an oop babby who knows php and js. which functional language should i start with? i know they both technically have some functional properties but id like something more parenthesis heavy i guess
>>46870387
>This is why FP will never be taken seriously outside of academia.
Except all the companies that are already using it. Get fucked you ignorant fanboy.
>2015
>still parroting stupid shit
>>46870387
>FP will never be taken seriously outside of academia
oh lawd
>>46870387
>FP will never be taken seriously
>>46870663
a class can have any number of traits, and traits can have fields & methods with implementations
seems like in haskell a List of a typeclass can't contain multiple different items, but in scala, traits are simply polymorphic (List[HasAddMethod] can have any instance of any class that has that trait)
>>46870738
not that guy, but I'm not sure what you're trying to get at with that List example
>>46870764
this
https://stackoverflow.com/questions/25956658/the-purpose-of-type-classes-in-haskell-vs-the-purpose-of-traits-in-scala
OOPers eat shit
http://www.pitheringabout.com/?p=693
>learning Haskell
>tfw no idea how to google <$> and all of the other symbol functions
>>46870782
OK, I see what you're saying
I'm not familiar with Haskell, but I gather you're pointing out the lack of OO-style type classing
>>46870870
never tried haskell
;_; i have a list of ~20 books/things i want to learn
fuck
You dont need dedicated functional languages anymore, regular programming languages like D, Go and Swift have the same functional features. Recursive functions are a deprecated way of iterating through collections, recursive functions are just as error prone and verbose as imperative looping constructs like for/while loops. Mapping functions and list comprehensions do the same thing as recursive functions more cleanly and implicitly. And since mapping functions (like foreach) are really methods on collections, it really is an OO way of accomplishing the same thing as recursive functions. So when you add high order functions, lambdas, closures to safe languages like D, Go, Swift, they are capable of the same functional programming
>>46870469int le_fedora_strawman(int i) { if (0 < i && i < 100) return i + 1; }
Now with 99% less memory usage.
>>46871367
no, create a collection of values
>>46871213
ssh, let them continue their "having a hammer and everything looks like a nail" ways
>>46871213
>And since mapping functions (like foreach) are really methods on collections, it really is an OO way of accomplishing the same thing as recursive functions
>pulling stuff out of your arse so you look smar on the interwebs
>>46870207
Pro tip: 99.9% of Scala users are former Java devs who does not employ functional methods in their codes
>>46871513
shame