Earlier quoted context omitted.
Now that I've read your post, I'd say that impurity is much more similar to "goto" than with object orientation. A language with "goto" is not structured. It does not matter how often it's used, or how similar the rest of the language is to a structured one. The same is true for side effects. (Funny thing that the most used language has both.)
If code is structured or not is not really a property of a language, every function call is effectively a "goto" although with more convenient syntax. If your functions are partitioned in a strange way, you can just as easily produce spaghetti code. Same with nested if statements. You can write well structured code in Fortran 77 for example, even though most standard control structures involve a goto. Absence of a go…
“Mostly functional” programming does not work
191–200 of 205 posts
Re: “Mostly functional” programming does not work
#192Earlier quoted context omitted.
Now that I've read your post, I'd say that impurity is much more similar to "goto" than with object orientation. A language with "goto" is not structured. It does not matter how often it's used, or how similar the rest of the language is to a structured one. The same is true for side effects. (Funny thing that the most used language has both.)
If code is structured or not is not really a property of a language, every function call is effectively a "goto" although with more convenient syntax. If your functions are partitioned in a strange way, you can just as easily produce spaghetti code. Same with nested if statements. You can write well structured code in Fortran 77 for example, even though most standard control structures involve a goto. Absence of a go…
The fact that some code do not use a feature of the language does not help the computer generating a faster program.
Also, no, function calls are not equivalent to "goto".
Re: “Mostly functional” programming does not work
#193Earlier quoted context omitted.
Now that I've read your post, I'd say that impurity is much more similar to "goto" than with object orientation. A language with "goto" is not structured. It does not matter how often it's used, or how similar the rest of the language is to a structured one. The same is true for side effects. (Funny thing that the most used language has both.)
If code is structured or not is not really a property of a language, every function call is effectively a "goto" although with more convenient syntax. If your functions are partitioned in a strange way, you can just as easily produce spaghetti code. Same with nested if statements. You can write well structured code in Fortran 77 for example, even though most standard control structures involve a goto. Absence of a go…
Re: “Mostly functional” programming does not work
#194Earlier quoted context omitted.
If "in practice, you're not going to be able to get things right..." than what the hell? That just strikes me as crazy. Note that I am not necessarily against monads. However, this idea that they are both a good answer and require fairly extensive programmatic help seem counter. I realize we can never reduce programs to things which are trivial and easy to comprehend. However, any new paradigm/trick that will always…
Any kind of static typing (regardless of how primitive) is compiler assistance. Do you think that all static typing is worthless?
Note, I am all for extensive static analysis. To the point that I am excited about such tools as Coverity and friends.
I am beginning to take exception to requiring ever more from the programmer. To the point that a programmer can't "in practice" specify a program correctly without a type checker. (Which... is what the parent post says. Right?)
I would much rather have it such that "in practice" we can specify programs without help. Since that implies that we can "in practice" read and reason about programs without extensive help, as well.
Re: “Mostly functional” programming does not work
#195Earlier quoted context omitted.
Any kind of static typing (regardless of how primitive) is compiler assistance. Do you think that all static typing is worthless?
I'm not sure how that even follows from what I wrote. Note, I am all for extensive static analysis. To the point that I am excited about such tools as Coverity and friends. I am beginning to take exception to requiring ever more from the programmer. To the point that a programmer can't "in practice" specify a program correctly without a type checker. (Which... is what the parent post says. Right?) I would much rather…
Re: “Mostly functional” programming does not work
#196The software engineering world is in danger of repeating the mistake it made with objects two decades ago. Back then there were legacy "structured" languages like C and Ada, and new exciting "object oriented" languages like Smalltalk and Eiffel. C++ was promoted as a "middle way" that let you "choose the best tool for the job". This made the pure OO languages look extremist. So, it was argued, if you had a problem be…
Technical nitpick, Scheme isn't pure.
Re: “Mostly functional” programming does not work
#197Earlier quoted context omitted.
There is an element of truth to this. It is also how we get things like Heartbleed.
So, library code and critical infrastructure would fall outside of the "vast majority of cases". :) And again, the question there is "Did Heartbleed keep people from getting value out of OpenSSL?". The answer is no, even if the value provided wasn't as advertised. It was more useful to have something--anything!--than nothing.
Arguably, though the limited sandboxes in wide deployment are sufficiently full of holes that most code provides some access to something that might be considered critical infrastructure.
'And again, the question there is "Did Heartbleed keep people from getting value out of OpenSSL?". The answer is no, even if the value provided wasn't as advertised. It was more useful to have something--anything!--than nothing.'
Possibly. Belief that you're secure when you aren't can quite definitely be much worse than no belief that you're secure, but I'm significantly less sure that Heartbleed moved many people from "sufficiently secure" to "insufficiently secure" in many individual cases (the possibility exists, I just lack the data to make any determination).
Also, for many use cases, there exist (and existed then, of course) alternatives that are probably more secure. If "nothing" meant using those instead it was quite a bit better to have "nothing".
Re: “Mostly functional” programming does not work
#198Earlier quoted context omitted.
I'm not sure how that even follows from what I wrote. Note, I am all for extensive static analysis. To the point that I am excited about such tools as Coverity and friends. I am beginning to take exception to requiring ever more from the programmer. To the point that a programmer can't "in practice" specify a program correctly without a type checker. (Which... is what the parent post says. Right?) I would much rather…
Sorry, didn't mean "compiler assistance", I meant "programmatic assistance" (as in your original reply). I hope my post makes more sense with that change!
So, I would rather have a static analysis tool let me know that I am using data straight from the user, than I would generate a rather large type system that includes this. See GWT and the "SafeHtml" joy for an example of what sucks in programming.
Now, it can easily be argued that the problem there was Java not being quite strong enough, but even in languages like Scala, things can be difficult.
Of course, I have grown to love the Lisp world where people have pretty much agreed to write in the S expressions. Not because they are the most readable form, but because they really are ascii art of the structure of what you are trying to say.
So, yeah, I'm a jumble of conflicting feelings on this. :)
Re: “Mostly functional” programming does not work
#199I think that "Mostly functional" is actually the sweet spot. Going to any extreme makes some things horribly difficult and going to another does the same for other things. So, optimally, multiple paradigms coexist in the single codebase, applied where they're most useful. Functional programming with as many immutable bits as possible is definitely a good start. I generally do that for whatever problem I'm solving: I…
I agree with you in general about 'mostly functional' being a sweet spot, but I think there's also lots of room for pure functions and immutability in ui programming without bending over backward too much. For example, rather than creating a big oo hierarchy to model a ui, you can describe it declaratively as immutable data, then transform it with chains of pure and semi-pure functions whose only ultimate side effect…
Re: “Mostly functional” programming does not work
#200Earlier quoted context omitted.
hypocrisy: the practice of claiming to have moral standards or beliefs to which one's own behavior does not conform; pretense. "GHC can target some quasi-embedded platforms these days, but it's also possible to write embedded programs in (pardon the overloading) an embedded DSL that can compile to C." Haskell can't do any useful work without relying on C. Instead of having pride in what C can do, you have invented th…
You asked some questions, I answered them in an attempt to be helpful. Any conclusions you draw about my personal beliefs are spurious and roughly as well founded as your conclusions generally. For what it's worth, I write a bunch of C and I like C very much. I also like Haskell and have to say you really don't know what you're talking about here. I'm not interested in dealing further with these kinds of ramblings, a…
Your and the haskell community's puritan behavior.
> you really don't know what you're talking about here.
Can't Parsec English ? I define the word hypocrisy, from a dictionary no less.