4 ms·
Realistically? Because if you're programming in Haskell, you're probably programming by yourself or with a few other smart people, so either you understand the
by mquander 17y ago
Realistically? Because if you're programming in Haskell, you're probably programming by yourself or with a few other smart people, so either you understand the idioms you encounter or at least you can trust them to be applied in a consistent and effective manner.
C++ is used more often as a common-denominator language for many programmers of varying skill who are collaborating on a project, and as you move toward that domain, transparency and safety start to become more important than power, since a big element of getting anything done is just not screwing each other over with unreadable code.
- eru 17y agoAnd you can define new operators in Haskell. So you can actually go out ouf your way and do not overload the existing ones.
- deleted 17y ago[deleted]
- JulianMorrison 17y agoAnd type classes force you to override related operators together. (With dependent types that Haskell doesn't have, the relationships between them could even be forced to adhere to mathematical axioms.)
- eru 17y ago> And type classes force you to override related operators together. You can get away with only implementing some of the functions in a typeclass. However you'll get a warning.
- mscarborough 17y ago'being smart' != 'reason to reduce readability'
- sofal 17y ago'accidental complexity' = 'essential complexity' / 'your intelligence' If you need the code watered down into a deluge of little baby steps to satisfy your own definition of "readability", that's fine. I personally don't find useless dissipation of program logic to be readable.
- Confusion 17y agoAnd have you ever read back your own program after a few months of doing something completely different? 'accidental complexity' = 'essential complexity' / 'your intelligence' You are forgetting accidental circumstances, like your current involvement with this particular code and the particular problems it solves. Code should read like a mathematical proof, exactly because it allows you to follow the steps in between.
- sofal 17y agoCode should read like a mathematical proof, exactly because it allows you to follow the steps in between. The requisite granularity of the between steps is completely subjective. If you're catering for the lowest common denominator, then you give up some succinctness, which may be more readable to someone unfamiliar with the concepts, but may just act as a time-wasting loss of abstraction that actually obscures readability to those who are familiar. You wouldn't want me to step through the proofs of associativity and commutativity of addition every time the rule is used, would you? That's why we just prove it once, give it a name, and assume a basic standard of intelligence/familiarity for those who have commit access.