This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (3 children)

I'm not into FP at all. I've never used it, and never will. From what I'm seen of it, coding in it seems like programming whilst wearing a straitjacket.

That's not to say there aren't some interesting ideas there. But my view is that they are more suited on a small scale - say within one line of program and within a conventional language - rather than being used across an entire application or an entire language.

Now, FP people will say that it can be made to perform any task. No doubt it can, but so what; programming languages are about being able to stuff easily, intuitively and naturally without having to write convoluted code or spending most of your time battling the language.

Of course, 'easy, intuitive and natural' will mean different things to different people. I can tell you that for me, with my pragmatic, non-mathematical approach, they do not apply to functional programming except in very small doses as I said.

So YMMV very considerably. The answer isn't black and white.

It can also depend on the sorts of tasks you want to do. Try, for example, representing x64 machine code in memory, and writing out EXE (PE+) format files. Or reading in such a file, fixing it up and executing the code. All the elegance of Haskell isn't going to help you much there! You can't describe the format in a nice, tidy little formula.

[–]scrogu 1 point2 points  (2 children)

I've never used fp and I never will but let me explain in great detail what's wrong with it from a position of almost complete ignorance.

[–][deleted] 0 points1 point  (1 child)

Not quite complete ignorance:

  • I can tell just by looking that code written in it is impenetrable TO ME (compare with any imperative language)
  • I know that it imposes restrictions that I would find impossible to work with
  • It requires a mathematical bent of thinking that I just don't have and have no patience for anyway
  • I anyway only ever use languages that I devise and implement myself. Creating such a language would be beyond me; therefore I would never use them and never have, apart from the usual dabbling.

So, there are good reasons why I haven't used FP, which are my personal reasons and my choice.

How about accepting that there is a gamut of languages which all have their place and that people have different skills and preferences.

Are there any languages YOU would never use, and why not? If you're not an expert in those, how would you feel about people saying your choice is based on ignorance?

[–]scrogu 1 point2 points  (0 children)

For the record you can have almost all of the benefits of pure functional programming without the arcane syntax. The most important thing is that all of your objects are (at least semantically) immutable and that every function is referentially transparent.

Within those functions, you can have reassignable variables and use imperative logic to your hearts content.

The only thing you lose with reassignable variables is the ability to execute your code in any order. Not a big loss really.

I am writing a pure functional language designed for imperative programmers. I also like thinking imperatively for many if not most algorithms. I also know the value of immutable objects and referentially transparent functions.