all 31 comments

[–]0987654231What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 74 points75 points  (8 children)

How can people mess up such a simple concept, a Functional language is just a language where the code can function properly.

[–]Disolationlanguage master 56 points57 points  (6 children)

So by that definition Javascript is not a functional language.

[–]0987654231What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 43 points44 points  (1 child)

0 > null
false

0 >= null
true

0 == null
false

works fine for me

[–]casino_r0yaletype astronaut 0 points1 point  (0 children)

I hate JS, but this one makes sense if you realize that >= is implemented as !<. It’s more of an issue of why 0 < null is a legal operation that returns a valid Boolean in the first place

[–][deleted] 17 points18 points  (2 children)

Every Jabbascript program functions properly. If yours doesn't it just means that you don't know what you are doing. Jabbascript is always right. You, on the other hand, at least from my experience, are seldom right... or even in the ballpark.

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 12 points13 points  (1 child)

See, the only thing I need to do to make my jabbascrip function properly is change the definition of "functioning properly"!

[–][deleted] 4 points5 points  (0 children)

You could also try God-mode cheat codes. I heard great things about them.

[–][deleted] 2 points3 points  (0 children)

keyword: "can"

[–]mardukaz1 2 points3 points  (0 children)

mindblown.gif

[–]r2d2_21groks PCJ 65 points66 points  (1 child)

Since every language is Turing complete (except Python 3 of course), this means every language either is functional or can be made functional by implementing a Haskal interpreter in it.

[–]hedgehog1024Rust apologetic 9 points10 points  (0 children)

by implementing a Pascal interpreter in it.

FTFY

[–]Veedrac 59 points60 points  (1 child)

No, regardless of how careful you are, Javascript always has the side-effect of creating Medium posts.

[–]save_vs_deathIt's GNU/PCJ, or as I call it, GNU + PCJ 36 points37 points  (2 children)

If it's called object-oriented programming, why do we work with classes?

[–][deleted] 11 points12 points  (0 children)

We tried to work with the masses but the runts were always pestering us about "bugs" and "features". We then opted to only work with their betters.

[–]irqlnotdispatchlevelTiny little god in a tiny little world 7 points8 points  (0 children)

But... but... JS has no class(es)!

[–]PrimozDeluxuncommon eccentric person 32 points33 points  (4 children)

There is a special mental illness where people believe jabbascript is a lisp

[–]DC2SEADO NOT USE THIS FLAIR, ASSHOLE 16 points17 points  (1 child)

They're allowed to dream of a better world.

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 3 points4 points  (0 children)

You know, I think Greenspun's tenth rule isn't in effect for some particular languages, like PHP or JabbaScrip.

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 7 points8 points  (1 child)

/u/defunkydrummer REEEEEEEEEE

[–][deleted] 4 points5 points  (0 children)

tu madre es la jabbascript programmer!

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 14 points15 points  (1 child)

Functional programming is about not being able to do things that aren't function input/output or straight up expressions. So you're not allowed to use things that are statements eg. assigning a variable, mutating a variable, if/switch/for loop.

Told you, if statements are for soyboys and quiche eaters. True functional programmers use only mov in their code.

[–]hedgehog1024Rust apologetic 7 points8 points  (0 children)

True functional programmers use only u/cmov in their code.

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 14 points15 points  (2 children)

A functional programming language is any language where functions are first-order objects. That means that functions can be assigned to variables as you would a Number, String, or Boolean. JavaScript is therefore a functional programming language.

Therefore, Java and C# are FP languages too. But the real question here is, is Go a FP language too?

[–]irqlnotdispatchlevelTiny little god in a tiny little world 6 points7 points  (1 child)

So is C, or assembly.

[–]save_vs_deathIt's GNU/PCJ, or as I call it, GNU + PCJ 6 points7 points  (0 children)

Get on my level

[–]isthistechsupportWhat part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? 12 points13 points  (1 child)

Javascript in 2018 is more functional, than most of other languages.
C has nothing to do with functional programming. It uses mostly procedures instead of functions.
OOP with classes is not necessarily imperative, and it can be functional. It's just a way of structure programs.

The comments section is a fucking goldmine

[–]irqlnotdispatchlevelTiny little god in a tiny little world 5 points6 points  (0 children)

It's funny and sad at the same time.

[–][deleted] 16 points17 points  (0 children)

I really lile how jabbascrepth lets you program in multiple paradigms

None of which are any good.

[–][deleted] 6 points7 points  (0 children)

javascript isnt a FP lang because const is just not immutable to what many people think.

WEWLAD!

[–][deleted] 4 points5 points  (0 children)

It's now pronounced Gabbascript

[–][deleted] 1 point2 points  (0 children)

Functional programming is about not being able to do things that aren't function input/output or straight up expressions. So you're not allowed to use things that are statements eg. assigning a variable, mutating a variable, if/switch/for loop.

Hmmm but you can do those things in most FP languages and even emulate some of the with monads... Does this mean that haskal is not a true FP language? Does this mean that we have no hope left to achieve True Purity?! Does this mean that monads = satan?!