<div dir="auto">One important, sometimes difficult, part is to work out how to break up a big function into multiple documentable small ones. Finding good natural boundaries can be tough, and may require multiple attempts, but it's really great when it works out. Ideally, each piece represents a single idea, which makes independent sense without needing to know how it will be used. Each piece should ideally have a small enough implementation to be able to understand it easily, and should have a reasonably descriptive name.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Sep 19, 2020, 11:03 AM Misja Alma <<a href="mailto:misja.alma@gmail.com">misja.alma@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have been writing Haskell in my spare time for a couple of years now, but when I showed some code lately to a friend he remarked that he didn't find it very readable. Actually I agree, when I look at my own code of a couple of months old I have trouble figuring out too what exactly it is doing.</div><div><br></div><div>I'm coming from a Java and Scala background and there, especially for Java, are some generally accepted best practices that make sure that your teammates don't have too much trouble reading your code. E.g. write short functions with a single responsibility, use variable, class and function names that explain what they are meant for, etc.</div><div><br></div><div>I think some of those best practices, like short functions with single responsibility, are useful for Haskell as well. But Haskell is a different language than Java and has its own strong points and pitfalls regarding readability, so it probably needs different coding standards as well.</div><div><br></div><div>I have been looking on the Internet if I could find some tips about improving readability but all I could find was <a href="http://www.haskellforall.com/" target="_blank" rel="noreferrer">http://www.haskellforall.com/</a>. Although there are some useful tips in there, this site seems to be aimed at making Haskell easier to read for newcomers from other languages. What I am interested in are tips from real projects that are built by real teams.</div><div>Does anybody have any tips, or are there some sites or books that I could read about this topic?</div><div><br></div><div>Thanks,</div><div>Misja</div><div><br></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div>