News for hackers. Stuff that matters.
Re:Motivation – Keli Language by HelloNurse on Monday August 31, 2020 @12:51PM (#24333311)
I'd prefer readability to suffer because the fold over a monad needs something clever that requires a bit of reasoning to understand than because vast amounts of "readable" boilerplate (for example, trivial getters and setters) hide a needle in a haystack.
Re:Motivation – Keli Language by mattmanser on Monday August 31, 2020 @03:49PM (#24335266)
Maybe in the 00s, but these days most languages have collapsed boiler plate down massively.

This comes across as an old fashioned view (bordering on extremely old-fashioned).

Re:Motivation – Keli Language by munk-a on Monday August 31, 2020 @07:56PM (#24337129)
I haven't seen evidence of reduced getters & setters in my day to day yet - they still seem pretty prevalent when OOP comes into the picture. I'd even say they got a bit worse because now it's excessive getters and setters with gigantic JavaDoc style comments all around them. If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window.
Re:Motivation – Keli Language by mattmanser on Tuesday September 01, 2020 @06:55AM (#24340398)
What are you talking about? Get setters used to be 10 lines long like:

    int id;
    public int Id
    {
        get {
          return id;
        }
        set(val) {
            id = val;
        }
     }
They're now one liners, and obviously necessary

    public int Id { get; set; }
I don't keep up with Java any more, but C# has super short shortcuts for assignment like:

    public int Id { get; set; } => generateId();
If you, or your company, are misusing a completely optional documentation feature, which you definitely should not be using to annote obvious stuff like IDs, that's your problem, not OOPs.

Switching to a functional language won't save your monitor, you'll still be forced to write bad code if doing stupid things like that are in your style guide.

Re:Motivation – Keli Language by Sharlin on Tuesday September 01, 2020 @04:13PM (#24346464)
Your comment is entirely specific to C#. Java has no such shortcuts, its setters and getters look identical to how they looked in 1994:

    private int id;
    public void setId(int id) {
        this.id = id;
    }
    public int getId() {
        return id;
    }
Re:Motivation – Keli Language by csirob on Tuesday September 01, 2020 @12:05AM (#24338455)
> If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window.

I honestly believe we're in a dire need for a more up-to-date metaphor that lets us better express our anger at a computer, due to monitors becoming paper thin and lightweight in the past decade or so.

Re:Motivation – Keli Language by webmaven on Tuesday September 01, 2020 @12:14AM (#24338497)
> > If I see "@returns id integer The ID" one more time I'll be tempted to throw my monitor out the window.

> I honestly believe we're in a dire need for a more up-to-date metaphor that lets us express our anger at a computer, due to monitors becoming paper thin and lightweight in the past decade or so.

My experience may not be representative, but I believe I have encountered variants of "hurl the keyboard at the monitor" more often than "monitor out the window".

OTOH, that phrase doesn't account for laptops.

Re:Motivation – Keli Language by csirob on Tuesday September 01, 2020 @12:21AM (#24338535)
> OTOH, that phrase doesn't account for laptops.

It is also not anger-ready for people working on tablets with rubber keyboards attached.

Re:Motivation – Keli Language by HelloNurse on Tuesday September 01, 2020 @11:32AM (#24342888)
Hitting the desk with a fist of moderate force is harmless and rattles lightweight modern computer equipment very satisfactorily.
Re:Motivation – Keli Language by panzerklein on Tuesday September 01, 2020 @06:13AM (#24340144)
Putting fist through the monitor?
Re:Motivation – Keli Language by qppo on Monday August 31, 2020 @01:12PM (#24333563)
folding over a monad (or any other combinator) doesn't require extra reasoning or anything clever, that's the point.
Re:Motivation – Keli Language by JadeNB on Monday August 31, 2020 @02:55PM (#24334742)
I think HelloNurse's point was less that a fold is inherently clever or subtle (as you say, it isn't), and more that, if there is something clever or subtle involved, the lesser verbosity of the fold makes it easier to see than would a more familiar, boilerplate-heavy approach in which the clever or subtle point could be lost.
Re:Motivation – Keli Language by chrischen on Monday August 31, 2020 @04:33PM (#24335625)
It does if you are unfamiliar to the pattern. It probably has more to do with experience with the patterns used rather than readability.