Live data from Hacker News

I thought I understood recursion

functional.christmas

61–70 of 124 posts

Re: I thought I understood recursion

#61
post #7

> My background is in OO programming, mostly using C#. C# being the versatile language it is, I have had the perception that whatever you do in other programming languages, you can with a little more code and hassle achieve in C# as well. If need be, I can program C# using a functional paradigm. And, of course I use recursion all the time. I know all there is to know about recursion. IME there are two kinds of progra…

So if you consider some stack to be inferior (maybe because its highly inconsistent in its design or it only runs on closed and locked down platforms or whatever) you still should just dismiss it as 'oh its just a tool' instead of accepting that it's shitty and makes you miserable when working with it? Why wouldn't I want to work with best thing ever if it helps me keep my sanity every day? Do you want to use somethi…

That attack seems unwarranted, especially for the argument put forth above, which you really don't seem to have understood.

The argument is that, even when you compare between very good tools, each one of them will make your life miserable when you apply it to a problem for which it is not designed, and for which a different tool is a much better choice.

I.e. there's no "one tool that is the best thing" that can be applied to all your tasks, because the tasks are widely different so tools are necessarily limited. That doesn't preclude some tools designed for the same type of task being clearly worse than others of the same kind (your argument).

Re: I thought I understood recursion

#62
post #7

> My background is in OO programming, mostly using C#. C# being the versatile language it is, I have had the perception that whatever you do in other programming languages, you can with a little more code and hassle achieve in C# as well. If need be, I can program C# using a functional paradigm. And, of course I use recursion all the time. I know all there is to know about recursion. IME there are two kinds of progra…

In the end, it is all machine code.

All that recursion, lazy evaluation, monads, lambdas, virtual methods and coroutines. In the end, they are all stack manipulation and jump instructions. High level languages are just a more convenient way of writing assembly.

I like to take that approach when comparing languages. What a program might do in term of machine instructions, and see how I can make another language output similar instructions. The one that can do it the more naturally wins.

Re: I thought I understood recursion

#63

"It is rather an attempt to get my head around functional programming, and to me Haskell doesn’t seem to have any practical application beyond that." Cardano/ADA's core Ouroboros protocol was entirely written, with formal proofs, in Haskell. It is by far the most serious attempt at proof of stake in the crypto industry. I think what you're really saying is, you won't find many jobs out there w/Haskell as a requiremen…

The crypto industry at its current stage is far from any practical purpose. It's just unfortunate that "Haskell in Practice" is associated with crypto BS.

Re: I thought I understood recursion

#64
post #10

Earlier quoted context omitted.

It's not obvious to me why choosing the right tool for the job is better than choosing the right job for the tool.

Don't know if you're serious, but for the most devs, the job is chosen for, not by, you

I have worked with a couple of devs who decide to pick and choose what they work on. Usually they are seen as important by management / company owners and not team players.

Re: I thought I understood recursion

#65
post #7

> My background is in OO programming, mostly using C#. C# being the versatile language it is, I have had the perception that whatever you do in other programming languages, you can with a little more code and hassle achieve in C# as well. If need be, I can program C# using a functional paradigm. And, of course I use recursion all the time. I know all there is to know about recursion. IME there are two kinds of progra…

I have mixed feeling on this.

I see what you are saying but I have also seen plenty of Python code written by what are clearly Java developers. And Framework collectors who have learned learn the very basics of Django before they moved onto something new - and hence written a load of overcomplicated crap that could have been done a lot cleaner if they had learned the framework in more depth. Learning some things in depth definitely has benefits.

Re: I thought I understood recursion

#67
It looks much more functional if you get familiar with LINQ.

    var allPossibleNumbers = Enumerable.Range(3, max-3);
    var possiblePrime = allPossibleNumbers
            .AsParallel()
            .Where(n => Enumerable.Range(2, (int)Math.Sqrt(n))
                                  .All(i => n % i != 0)
            );
(from https://codereview.stackexchange.com/questions/6115/sieve-of... )

Re: I thought I understood recursion

#68
post #53

Earlier quoted context omitted.

The fifth rule of recursion is that it is not really recursion if it isn't tail-call optimised.

So a recursive tree search is not really recursive?

Oh no, it is really recursive -- it's just not "real recursion" (TM). ;)

Re: I thought I understood recursion

#69

Earlier quoted context omitted.

So if you consider some stack to be inferior (maybe because its highly inconsistent in its design or it only runs on closed and locked down platforms or whatever) you still should just dismiss it as 'oh its just a tool' instead of accepting that it's shitty and makes you miserable when working with it? Why wouldn't I want to work with best thing ever if it helps me keep my sanity every day? Do you want to use somethi…

The things that make work pleasant are a sense of purpose, feeling valued, being stretched, having autonomy, personable colleagues, a good physical environment, decent equipment. These are far more important than what language you happen to be using.

Those are the lowest common denominator of things that make work pleasant. To that list I would add:

* opportunities for growth in both breadth and depth (perhaps that falls under “being stretched”)

* opportunities to mentor and to be mentored

* a voice in the philosophy, goals, direction, and projects of the team or even the company

* flexible work hours, abundant vacation time, and a culture that makes full use of both

Re: I thought I understood recursion

#70

"It is rather an attempt to get my head around functional programming, and to me Haskell doesn’t seem to have any practical application beyond that." Cardano/ADA's core Ouroboros protocol was entirely written, with formal proofs, in Haskell. It is by far the most serious attempt at proof of stake in the crypto industry. I think what you're really saying is, you won't find many jobs out there w/Haskell as a requiremen…

>You just have to look harder to see where it's being used. This is where advocacy slips over the line into a kind of blind faith evangelism -- with an added pinch of pedantry peculiar to our field. I will state without proof that every language ever invented is currently being used for something practical somewhere. E.g. someone has a useful shell utility they wrote in Brainfuck that they run every day and that they…

I'm not sure that holds up. Real people working at real companies are writing real code in Haskell every day. I found several job postings in London that advertised Haskell as a requirement / nice to have. Haskell is also taught and used extensively at my alma matter, and is in fact the first language you will be introduced to at a CS/SE degree.

How is that in any way, shape, or form comparable to Brainfuck?!

Post reply on HN