Funtional Programming

What you, guys, think of it? Is it a meme? Is it worse that OOP? Can anyone tell me what's the difference between these two paradigms?

Other urls found in this thread:

en.wikipedia.org/wiki/Chomsky_hierarchy
en.wikipedia.org/wiki/Turing_machine
en.wikipedia.org/wiki/Lambda_calculus
file.scirp.org/Html/779.html
twitter.com/SFWRedditImages

>Funtional

retard

rude ;_;

bump(thread)

I'm looking for people to (in India) make and sell buttons that say, "DON'T BE TRACKED PAY CASH", in English and/or a local language, to resist the campaign against cash. Talk with a local company that makes buttons, buy a batch of 50 to 500 buttons for a quantity price, then sell them for 2 or 3 times that price.

p-p-p-pajēēēēēēēēt

Haskell is the only good programming language

i don't know anything about it but i always assumed it's a meme. useful for a few specific things.

What sets it apart from other languages? One thing I'm reading is that it's hard to write buggy code in it because its functions are all self contained and don't have side effects.

I wonder what is the best language for that, even if it's a language that restricts you, just a language that's braindead simple to maintain and avoid bugs. It seems like every single program I use I find bugs in. Which language would be best for this? Haskell?

What even is it?

bump

your asshole is dual functional

kek

Haskell and OCaml are nice languages.
Lisp is not necessarily focused on FP but it's interesting as well.

>You can't have bugs if your software doesn't have users

Seriously, anyone know if haskell is good for this?

The number one problem (for me) with software on Linux is how many bugs it has. Even if the language produces slower binaries or is very restrictive/slow to program in, it would be worth it to use if it meant very few bugs. Every DE I've used I keep a list of bugs in a text file

>What you, guys, think of it? Is it a meme?

It's a tool. Just like OOP or scripting langauges. A craftsman has more than one tool in his box.


>Can anyone tell me what's the difference between these two paradigms?

Oh well. There are many models for computing, logical models like SQL or formal languages like those:
>en.wikipedia.org/wiki/Chomsky_hierarchy

But there are two modells that are kinda special, because they are the most powerfull ones. Both are equally powerfull and where discovered at the same time, but work fundamentally different:
One is the "turing machine", the other one the "lambda calculus".

>en.wikipedia.org/wiki/Turing_machine
>en.wikipedia.org/wiki/Lambda_calculus

"C-style" languages (C, Java, Python..) follow more or less the turing machine modell.
"Functional languages" (Lisp, Haskell, Idris..) follow more or less the lambda calculus

In reality it's a little bit more complicated than that, because each functional langauge has elements of turing machines - and the other way arround modern turing-machine-like languages borrow interesting ideas from functional ones..


Short summary:

Turing-machine languages work with changing variables. Functions are consider control structures, that get passend some variables and return values or mutate data structures ("side effects"):

int x

function increment(a) {
a = a + 1
}

for x = 0 to 10 {
print(x)
}

Functional langauges avoid changing variables, data structures are immutable. Functions are not onle consider control structures, but they are objects themselves. For example you can pass a function as argument to a different function. You work without mutating data structures and avoid side effects:

int x = 10

function increment(a) {
return a + 1
}


function iterative_for(a, max) {
if (a

Rust or Haskell would be fine languages for avoiding commonly-made bugs.

Which would be better at avoiding bugs? I was looking at either one of those to learn next.

Rust and Haskell are so fundamentally different in what they try to be (and how), that you will never find a problem where you really have to chose between those two..

Think of them as a Car and a Boat: which is better? Depends on what you are trying to do..

>The number one problem (for me) with software on Linux is how many bugs it has.

Apparently you know nothing about programming. "Avoiding bugs" is like "winning a contest". Yes, it's what everybody is trying to do, but even the best sportmen will have wins and losses.

Haskell tries to aviod "some" bugs, but that doesn't mean you can't have severe bugs (Space Leaks, anyone?) or just programm the wrong thing or get data you were not prepared for and do something wrong.


Programms are never 100% bug free.

>Depends on what you are trying to do..
Well you could write a window manager in haskell or in rust. Xmonad was written in haskell. I don't care if haskell isn't fit for the job or if it will be slow, I want the language which is the absolute best at avoiding bugs of all kinds and try rewriting a portion of a DE in it. Every DE I've ever used has had a ton of them and I want to fix that.

>"Avoiding bugs" is like "winning a contest". Yes, it's what everybody is trying to do, but even the best sportmen will have wins and losses.
You're just moving words around man. Linux software is buggy as shit. I enjoy using it because it is better at many things than Windows, but definitely more buggy (for me)

>Haskell
That's not how you spell Lisp

> I want the language which is the absolute best at avoiding bugs of all kinds

There is no such thing. It just doesn't work like that.

You avoid bugs by becoming a better programmer (= experience, a.k.a. making mistakes) and by doing LOTS of testing.

Even systems like space shuttle control units where it's about life and death are not 100% bug free. They use differnt chips with differnt programms that run independently, so if one chip outputs crap, the majority will hopefully have the right result and overrule the rong one. And they watch over each other and can restart each other if one of them goes down.


It's really that complicated..

Yes, they are extremely easy to write tests for with 100% branch/statement coverage, you can also debug shit in repl very easy

Discovering PHP in 2017 must be hard for you.

> Linux software is buggy as shit.

Congratulation, you just won this year's retard award.

If you knew jack shit about programming, you'd realize that it's amazing how stable linux works, considering the complexity of the programms involved. You are like a littel kid that knows nothing about painting and looks at a VanGogh and say: "uhh, this guy on the side has a werid nose, the guy obvisouly cant't paint very well.."


But Haskell is just an everengineered Lisp..?
:^)

this is what autism looks like

>What sets it apart from other languages?
Type system and compiler optimizations

Literally the only language that allows you to write programs using formal computer science theory and perform well

Maybe I'm getting old, but fp languages and theorem provers makes me hard as fuck

Everyone should have done some functional programming. Not to the extend like writing a driver in Haskell but enough to understand when and how functional programming makes code easy to debug. My imperative programming became much better since I programmed a lot in functional programming languages. You learn a new way of thinking. I advise every programmer to do some programming in either Scala, Erlang, Haskell or Lisp. You'll be enlightened. Also I advise every functional programmer to do some programming in C++ and some hacking in C and assembly. Also a bit of Prolog isn't bad.

- t. FizzBuzzer


>Researchers have often commented on the high correlation between McCabe’s Cyclomatic Complexity (CC) and lines of code (LOC). (...) The models developed are found to successfully predict roughly 90% of CC’s variance by LOC alone. This suggest not only that the linear relationship between LOC and CC is stable, but the aspects of code complexity that CC measures, such as the size of the test case space, grow linearly with source code size across languages and programming paradigms.

>file.scirp.org/Html/779.html

Scala is basically master race, does everything Java can do OOP wise, with incredible functional support. Also play framework in scala makes going back to Java depressing af

b a i t

why the fuck would you bite to this

>samefagging this hard

We get it, you coudl clearly write better software than the linux community.

Oh no wait: You just have to rewrite Linux and it's tools in Haskell or Rust and everything would work perfectly, amiright?

Hahahaha..