Live data from Hacker News

Functional Programming Is Hard, That's Why It's Good

dave.fayr.am

81–90 of 112 posts

Re: Functional Programming Is Hard, That's Why It's Good

#81
post #6

FP is becoming the new OOP. People who don't understand its original meaning are misinterpreting it and incorrectly expounding its usefulness. Newcomers are not grasping how it fits into the bigger picture. Be cautious.

http://harmful.cat-v.org/software/OO_programming/ e.g. "The phrase "object-oriented" means a lot of things. Half are obvious, and the other half are mistakes." -- Paul Graham

I don't think pg really understands OO. He seems to associate it with boilerplate getters and setters ala Java.

This is the best description that I've found:

OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things - Alan Kay

Re: Functional Programming Is Hard, That's Why It's Good

#84

Earlier quoted context omitted.

one of the cardinal rules of OO is: "each unit (method, object, whatever) should do exactly one thing"[3]. this rule is universally ignored in all the big OO codebases I've seen[1]. applying this rule with discipline, forces you to have a better understanding of what your code is actually doing. I think, that applying this rule even in OO languages forces you towards "functional-style in the small, object-oriented in…

That's not a cardinal rule of OO or even a rule of OO.

It is if you don't want to write side effect riddled 'objects'.

Re: Functional Programming Is Hard, That's Why It's Good

#85
post #50
post #40

Earlier quoted context omitted.

Just for record. Type system for OOP was developed during some 25 years: http://lucacardelli.name/Talks/2007-08-02%20An%20Accidental%... Lambda calculus was introduced in 1936 and in 1948 it was given simple type system (along Fortran one, which, in turn, was introduced in 1958, ten years later). Year after Simula-67 was introduced, logician Hindley presented a polymorphic type system with type inference for lambda-c…

Unfortunately, I don't think type theory has a whole lot to do with programming or software engineering. The most practical languages (as measured by popularity, which seems to be the best way to do it over a period of decades) do not have sound type systems, nor even particularly interesting ones theoretically.

"Unfortunately, I don't think type theory has a whole lot to do with programming or software engineering. The most practical languages (as measured by popularity, which seems to be the best way to do it over a period of decades) do not have sound type systems, nor even particularly interesting ones theoretically."

That is hilarious! I just showed this to my black, British cat, Mr. Fluffer Wickbidget, III, and he spit out the milk which he had been lapping from the palm of my hand.

You should sit down with the brilliant Hongwei Xi, the creator of the amazing ATS programming language, and see what he thinks of your jocular comment. If you're lucky, he might explain to you the reality of his Applied Type System, which not only provides for a very practical use of types, with the side benefit of theorem proving, but has also been shown to be almost as fast as C.

http://www.ats-lang.org

Re: Functional Programming Is Hard, That's Why It's Good

#86
post #42
post #2

The thing that got me really interested in learning Haskell was the realization that something like 90% of the nasty bugs that I fixed in production over the years would be have been impossible in a pure functional language. The thing that slows me down is the prospect of actually getting paid to write Haskell, and my doubts about it's ultimate suitability for iterate-quickly, fail-fast software world. But reading th…

>doubts about it's ultimate suitability for iterate-quickly, fail-fast software world. Lest you doubt: http://thesz.mskhug.ru/svn/hiersort/doc/hhm-eng.pdf We did a cycle-accurate prototype of MIPS CPU with some twists. In Haskell. For Haskell to shine in prototyping you have to apply it to some critical and new task, where type system works with you, preventing errors. The novelty is crucial, I think. You will have t…

"You will have to explore the solution space with the help of some sort of theorem prover (type system)."

Have you tried ATS (Applied Type System)?

http://en.wikipedia.org/wiki/ATS_(programming_language)

Re: Functional Programming Is Hard, That's Why It's Good

#87

Earlier quoted context omitted.

http://harmful.cat-v.org/software/OO_programming/ e.g. "The phrase "object-oriented" means a lot of things. Half are obvious, and the other half are mistakes." -- Paul Graham

I don't think pg really understands OO. He seems to associate it with boilerplate getters and setters ala Java. This is the best description that I've found: OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things - Alan Kay

Quote fight

"object-oriented design is the roman numerals of computing." -- Rob Pike

And Rob shared an office with Bjarne for quite a while.

Re: Functional Programming Is Hard, That's Why It's Good

#88
I have done a few real, production projects with Haskell, and I've come to realize that a lot of interest in it is hype. The paradigm is neat, the language is relatively well designed (considering that it's an academic committee language) and the implementation is passable.

Programmers sadly forget that the greatest challenge of software creation very often happens outside of your text editor: it happens in the domain, in architecture, specification and communication. If you succeed in those, your project will succeed, no matter which language* you chose. If you fail in them, no amount of strictness in your programming language will save you.

* unless of course it's Java

Re: Functional Programming Is Hard, That's Why It's Good

#89
post #52

Earlier quoted context omitted.

>Is it that hard to see different uses for different languages? Okey. How about language that could encompass all of them? The thing about such language is that it have to be functional one, at the core. Be it Lisp, or Haskell, or Agda2. Let's look at Haskell. It has OO: http://homepages.cwi.nl/~ralf/OOHaskell/ Everything in mainstream OOP languages and then some, all in Haskell type system. It has BASIC: http://hack…

As for C++, it's domain shrinks every year. Mobile seems to be generating a resurgence of interest in C++. Squeezing every last bit of performance out of tightly constrained CPU and RAM matters again.

So surely Forth should make a resurgence, it has the most code density, the fastest runtime and the lowest error rate.

The only metric is loses on is its high score in impenetrability.

Re: Functional Programming Is Hard, That's Why It's Good

#90
post #51

Earlier quoted context omitted.

I think you should learn Brainf*ck. It has awesome mental/intellectual benefits to you as a Erlang lover. No, but really.... ! And if you don't you will suffer! Muahaha!

Erlang is easy to read and makes a lot of sense, without requiring much brainpower... if you'll take a few days and read about it. I think its kinda silly that people will just ignore a language because it doesn't look like java/C/pascal. Its not like the syntax of erlang is stupid, or pointlessly obtuse.

I write Erlang every day and love it, but I have to agree with most of the points raised by http://damienkatz.net/2008/03/what_sucks_abou.html
Post reply on HN