News for hackers. Stuff that matters.
Re:Classes are a way of writing higher order functions by bitL on Wednesday September 09, 2020 @01:02PM (#24423076)
You have IDE for that in general. If you are writing all code in Sublime, then yeah, you have a problem.
Re:Classes are a way of writing higher order functions by symlinkk on Wednesday September 09, 2020 @01:18PM (#24423280)
If you need an external tool to understand code it’s an indication that something is wrong.
Re:Classes are a way of writing higher order functions by ragnese on Wednesday September 09, 2020 @01:41PM (#24423582)
I somewhat disagree. This will be true for pretty much any non-trivial code project. I'd love to see a language where I didn't need tools to understand what's happening, but that's impossible currently.

Do you really never need to see what a passed-in function actually does in your FP code? Never need to see what type an argument is in our fancy Haskell or Hindley-Milner-typed language?

Re:Classes are a way of writing higher order functions by Weebs on Thursday September 10, 2020 @10:57AM (#24432921)
I'd argue you're right, but when you're programming in something like Haskell that guarantees certain constraints are met just by glancing at declarations, these tools become less essential.

In FP, I tend to look at implementations to understand what they'll produce

In OO, I do this, but I also need to know _how_ since they might be changing the current context I'm working in. It's not enough to know that X method produces Y, I also need to remember that calling X implicitly modifies Z when I'm referencing Z

In an FP environment X can't modify Z outside of his context, so I don't have to care about how he produces Y. The cost of this is that someone needs to own Z and functions need to additionally return the new Z, but I think that explicit hierarchy helps in guiding towards a more understandable architecture

Re:Classes are a way of writing higher order functions by codygman on Wednesday September 09, 2020 @07:28PM (#24427182)
> Do you really never need to see what a passed-in function actually does in your FP code?

I'm hesitant to say always, but I can say:

- in imperative code I never feel comfortable without inspecting the passed in function

- in pure functional code, I rarely feel uncomfortable taking a pure function at it's word

Re:Classes are a way of writing higher order functions by pjmlp on Wednesday September 09, 2020 @01:48PM (#24423684)
If one refuses to adopt modern tooling it’s an indication that something is wrong.
Re:Classes are a way of writing higher order functions by bitL on Wednesday September 09, 2020 @01:39PM (#24423561)
Is that? If you don't write all your code with `cat`, is that an indication that something is wrong as well?