4 ms·
I agree that he's got a point, I just get annoyed when people feel the need to make their point in a way that questions the intelligence of other people. It's
by akeefer 18y ago
I agree that he's got a point, I just get annoyed when people feel the need to make their point in a way that questions the intelligence of other people. It's unnecessary and counter-productive. There are ways to say "one big advantage of functional programming is that it leads to more testable code" without also saying "and anyone that programs in any other sort of language is clearly an idiot."
- jim-greer 18y agoI also agree that he's got a point. I'd encourage him to build something so awesome with a functional language that the rest of us can't help but be blown away. Ejabberd is a good start, how about some more? It's not easy to develop things so useful & elegant that you win people over... but it's easier than arguing the Internet into submission from a mailing list.
- vlisivka 18y ago> I'd encourage him to build something so awesome with a functional language that the rest of us can't help but be blown away. Functional language helps a lot in building of side effect free code. But such code can be written even in pure assembler. I writing in such style in any language, including Bash. Sometimes I need to refactor somebody else code. Code functionality remains exact same after refactoring. Things that changed are: better code clarity, better reusability, and better testability as part of reusability. Unit tests creates additional contexts, in which main code can be used, thus they force to improve reusability of the code, thus code forced to make less or none side effects, thus programmer forced to rewrite code in functional style.
- kragen 18y agoHow do you write such code in x86 assembler? All the instructions I'm familiar with have side effects except for nop, hlt, and, arguably, push and call.
- vlisivka 18y agoIt is not a problem. Execution of any code in any language can have side effects, like garbage in memory or stack overflow or OutOfMemoryException. Usually, you just ignore these side effects. Use code convention to define which flags, registers, and memory areas, IO registers, etc. must be preserved by the called function. Just ignore any other changes.
- jlouis 18y agoActually, there are two views of functional programming: 1) Default to functional ideas: Variables are immutable, recursion is encouraged, etc; but you can get access to imperative code when needed (Call this the Algoritmically functional languages) 2) Functional is the norm: You can't write non-pure functions with side-effects at all. These are the Pure Functional languages. I am leaning towards 1 more than 2 personally, but many people would disagree with me on that one. The question is: Do you want a usable program written in class 1 or 2? Because there is a hell of a difference between them and how you build software for the two classes. Interesting class 1 projects, where you can get the source code, are: ejabberd, mldonkey, unison, harmony/boomerang, coq, twelf, isabelle, coccinelle, and mlton. Interesting class 2 projects could be xmonad, darcs, and GHC. Of these projects, some would be easily implementible in imperative languages, some would be hard but doable and some would be insanely impossible to do. Please note that all things on the list are useful and elegant. But they might not have a user-base as big as other projects.
- joe_the_user 18y agoA shame no one has replied to Jim with a strong app written in the functional language. The closest thing I know is the website which became yahoo stores. It was originally written in lisp (no really functional, I know). The lisp worked great when they had a dedicated lisp manager managing it. When Yahoo took over, the rewrote it in something else, not because the something-else worked better but because they couldn't find/manage the development in lisp. So functional might be failing this way. But it might just be hard to write big functional programming applications. I'd like to here more about this.
- d0mine 18y ago"An Algorithm for Compressing Space and Time" -- amazing performance improvements for "Game of life". (I can't find an old submition so here's a new one http://news.ycombinator.com/item?id=495438 http://news.ycombinator.com/item?id=495438 ) Hashlife algorithm might find some benefits from implementing it in a functional language.
- jlouis 18y agoIt does not question other peoples intelligence, but rather their knowledge of programming language paradigms. You can program functionally in any language by eschewing side-effects whenever you can. Only that in some languages it is way easier to program functionally than others (ML, Scheme, Common Lisp, Erlang) and in some it is even forced (Haskell). The "idiot" here is the one that can't see or understand that it is easier to program functionally in functional languages and that it leads to better programs by doing so. To see this, you need knowledge of functional programming. And sadly, many people do not understand its finer points because they have not spent time writing non-trivial programs in functional languages. If you know nothing about FP on the other hand, you could be lead into the concept of Dependency Injection, Design Patterns and whatnot, because your world is shaped around a statical subtyping system (In the case of Java). These concepts are not bad at all: they help Java programmers write better code (for most part) with fewer errors.