9 ms·
Richard Gabriel’s famous essay “Worse is better” (https://www.jwz.org/doc/worse-is-better.html https://www.jwz.org/doc/worse-is-better.html) is an interesting p
by lewisjoe 7y ago
Richard Gabriel’s famous essay “Worse is better” (https://www.jwz.org/doc/worse-is-better.html https://www.jwz.org/doc/worse-is-better.html) is an interesting perspective on why Lisp lost to C. In a way, the same arguments (simplicity vs consistency vs correctness vs completeness) can be made for why functional programming lost to OOP.
But those philosophical perspectives aside, personally I find my brain works very much like a Turing Machine, when dealing with complex problems. Apart from my code, even most of my todos are simple step-by-step instructions to achieve something. It’s easily understandable why like me, other non-math folks would prefer a Turing Machine over Lambda Calculus’ way of writing instructions.
This could be why OOP/Imperative was often preferred over FP.
- zygimantasdev 7y agoPersonally my thinking changes from Turing Machine to more math like with each year I do functional programming
- slig 7y agoBeware: JWZ doesn't like people visiting his website from HN.
- geitir 7y agoThe fact to he took the time to do that shows who the real man-child is
- Ygg2 7y agoThat, or he hates the HN hug of death.
- dspillett 7y agoNah, just having a problem with the hug of death would be an explanation for redirecting to a polite static message saying "sorry, my site can't handle the load when HN links to it". What he has done instead is excessively diskish.
- wil421 7y agoWhat has he done? Everyone’s commenting he doesn’t like HN but when I clicked the link everything looks fine. Serious question.
- rgoulter 7y agoIt redirects to an image with a hairy testicle and gives a low opinion of HN readers: https://web.archive.org/web/20191014203443/https://www.jwz.org/images/2016/hn.png https://web.archive.org/web/20191014203443/https://www.jwz.o...
- robjan 7y agoYou must be using Brave or a browser plugin which doesn't send referral headers. If you use a normal browser, it displays a testicle in an egg cup with a silly phrase complaining about the demographic of HN users.
- wil421 7y agoI’m using iOS safari with AdGuard. It’s probably AdGuard.
- dorfsmay 7y agoI open everything for which I don't need to be logged in, in an incognito window, and this page worked fine.
- dspillett 7y agoAn incognito window doesn't quite count as "if you use a normal browser". Unless your not using incognito is the unusual case for you, which it isn't for most users. Given a choice between changing my browsing behaviour to see his content or just blocking it so it (the testicle redirect or the other content) will never both my vision again, I go for the latter option.
- deleted 7y ago[deleted]
- gitgud 7y agoThe fact that it's the only site I've seen that demonstrates the ability to read HTTP referral headers from hacker news shows who the real hacker is...
- dspillett 7y agoAh yes, I didn't remeber at first why that domain was added to my hosts blacklist.
- hyperpallium 7y agoIn an old textbook I haven't been able to find again (browsing in another uni's library) regarding the Entscheidungsproblem I read that Church wrote to Turing, saying he thought the Turing Machine waa a more convincing/natural/intuitive representation of how mathematicians thought about algorithms than his own lambda calculus. Maybe he was just being modest, or like John McCarthy, just didn't see or believe its potential. Note that this was before computers or programming, and that there's no formal proof that a Turning machine can encode any computation - so its convincingness was important.
- strangenessak 7y ago> personally I find my brain works very much like a Turing Machine Exactly this. How baking a cake in FP looks like: * A cake is a hot cake that has been cooled on a damp tea towel, where a hot cake is a prepared cake that has been baked in a preheated oven for 30 minutes. * A preheated oven is an oven that has been heated to 175 degrees C. * A prepared cake is batter that has been poured into prepared pans, where batter is mixture that has chopped walnuts stirred in. Where mixture is butter, white sugar and brown sugar that has been creamed in a large bowl until light and fluffy Taken from here: https://probablydance.com/2016/02/27/functional-programming-is-not-popular-because-it-is-weird/ https://probablydance.com/2016/02/27/functional-programming-...
- antisemiotic 7y agoAnd then you actually try to write it in a functional language, and end up with something like: cake = map (cool . bake 30 175) . splitIntoPans $ mix [ butter, sugar, walnuts ]
- p33p 7y agoI think partial application and pipe operators make this so very intuitive though: [butter, sugar, walnuts] |> mix() |> splitIntoPans(pans = 3) |> bake(time = 30, temp = 175) |> cool(time = 5)
- strangenessak 7y agoWe can improve the syntax further [butter, sugar, walnuts] mix() splitIntoPans(pans = 3) bake(time = 30, temp = 175) cool(time = 5) Hmm, wait a second.....
- pkilgore 7y ago[butter, sugar, walnuts] ^^^ Somewhere wanted type CakeIngredients but missing record field "Flour" If imperative style programming came with type inference on the level of the Ocaml compiler sign me up. For now, though, I can spare a few cycles in exchange for correct programs.
- hyperpallium 7y agoEven in maths, I find a solution in terms of the problem easier to understand than one in terms of the previous step. Even when the recursive form is a more natural representation, like arithmetic sequences: start at s, increase by d with each step: a(0) = s, a(n) = a(n-1)+d a(n) = s + n*d The analytical form seems simpler, neater, more "right" and more efficient to me - even though, if you want the whole sequence, the recursive form is more efficient (given tail-call optimisation). I suspect I'm just not smart enough. fp can be much shorter, and the execution model isn't actually hidden, just unfamiliar (and unintuitive and unnatural - for me). Consider: all suffixes of a list. In jq: while( length>0; .[1:] )
- jt2190 7y agoLately I’ve been thinking that a lot of code style debates center around an explicit versus implicit axis. Imperative is more explicit, and, in one sense, easier to see what’s going on since it lays everything out step by step. On the other hand, those same steps are a mix of essential steps (that deal with the problem being solved) and accidental steps (that deal with computer and code in order to get the job done.) It seems to me that OOP, Functional, and Relational programming models try to abstract away the accidental steps, but like all abstractions there are limitations. I suspect that once familiar with one of these models, imperative seems awfully tedious, however now the code is more obscure to those not well versed in the paradigm, thus we have a trade off between ease of use for many and optimal for some.
- hyperpallium 7y agoImplicit also means a tradeoff in estimating performance, an instance of an abstraction leaking. I've been trying to think of a totally clean functional abstraction, i.e. that's functional under the hood, but there's no way to tell. Perhaps in a compiler?
- hyperpallium 7y agoAbsolutely, explicit vs implicit is part of imperative vs. functional. And doing more with less information is elegant - and has a deeper significance in terms of Occam's Razor, that simplicity tends to closer to the truth, and therefore generalizes better. And, like pg's take, shorter code means less code to write, to read, to modify. There can be leakage, when the given model is not perfectly accurate, and you need the true implementation details (this also happens for imperative code - it can be very helpful to have source of libraries) - in debugging, in performance, in working out how to do things. But I feel a general issue is that it might not be a good fit for the human code processing system... Our interactions in the real world are more like imperative programming - not just familiarity, but how we evolved. This issue is similar to how quantum physics and relativity aren't a good match to the human physics system, which seems to be the mechanical/contact theory. To convert things to recursion is like working out an inductive proof - you can do it, but it is harder and more work than just getting it done in the first place. A specific issue about this is that functional recursion is based on the previous step, whereas imperative code is usually based on the starting step. Like, build a new list at each recursion vs. indices into the input list. The latter is easier because it's always the same thing being indexed, instead of changing with each recursion.
- deleted 7y ago[deleted]
- watwut 7y agoThe link you shared now leads to this when clicked on hn: https://web.archive.org/web/20191014203443/https://www.jwz.org/images/2016/hn.png https://web.archive.org/web/20191014203443/https://www.jwz.o... When copied and pasted into next tab it leads to article.
- u801e 7y ago> Apart from my code, even most of my todos are simple step-by-step instructions to achieve something. > [...] > This could be why OOP/Imperative was often preferred over FP. Though this doesn't really explain why OOP is preferred over imperative (since the former doesn't really correspond to a set of step-by-step instructions).
- pryffwyd 7y agoThe latest no-OOP imperative language with any kind of market share is C. So everything that's terrible about C: unsafe manual memory, portability issues, tooling, no generics or overloading, horrible ergonomics, 2nd class functions, globals everywhere, etc, are all forever associated with imperative programming. OOP was born at the time of fixing all those problems, so those languages were a big improvement in ways that had nothing to do with OOP. Now that all the top languages are multi-paradigm, only a puritan would avoid OOP, and they'd have a tough time interacting with libraries and frameworks. So every codebase is a little wishy-washy and OOP wins by default. Imperative has no advocates left in industry or academia, so most people don't even think of it as a defensible design decision.
- fetbaffe 7y agoOne language that was not on the presenters list is SQL, very popular, but not OO nor functional. One thing lot of programmers do is to abstract SQL to OO style, even though SQL describes a relation that can be computed to a result, in some way similar to a function, but it seems that most prefer to look at is has a state, even though it doesn't. Sure, the tables where data is stored has a state, but the sum of the tables is a relationship in time & depending how you look at it you get different results. It is very hard to map relationships to OO correctly. It is probably easier for most people to think about the world as set of things rater than a relation in time. Many of our natural languages are organized around things.
- meijer 7y agoThe link is NSFW.
- TulliusCicero 7y agoThis is correct. Everyone I've met that insisted that functional programming is superior to imperative has been a big time math/CS nerd, the kind that goes to grad school and was confused when the iPad launched because hey it does nothing that a laptop doesn't already do! My experience doing functional programming is that hurt my brain, it just doesn't map as cleanly to how I think of things happening compared to imperative programming. It was just really painful to code in, and most of my classmates had the same opinion.
- Hercuros 7y agoIt’s mostly a matter of practice. I think that many people’s experience of functional programming is a (potentially poorly-taught) university course, during which there is not really enough time to really become comfortable with functional programming. Maybe it’s true that the learning curve is a bit (a lot?) steeper, though. But once you are comfortable with it, it’s not significantly more difficult than writing code in Java or Python. I also think that it’s worth learning even just for the sake of becoming a better programmer. It teaches you to think in a different way, which also translates to programming in imperative languages.
- gowld 7y agoOOP is nothing like a Turing Machine.
- hinkley 7y agoLisp lost in a much more profound way recently, and it's very rare to see anyone mention it, especially on the Lisp side of the conversation. Over the last 10 years or so, we have come to the painful conclusion that mixing data and code is a very, very bad idea. It can't be done safely. We are putting functionality into processors and operating systems to expressly disallow this behavior. If that conclusion is true, then Lisp is broken by design. There is no fixing it. It likes conflating the two, which means it can't be trusted.