News for hackers. Stuff that matters.
Re:Response to “Literate programming considered harmful” by ctz on Wednesday August 31, 2016 @08:15AM (#12397675)
> Enter Golang... a language smaller than even ANSI C. It's readable because if you've worked with Golang for more than a week, you basically know every language construct you'll encounter.

That's not really what readability is to me. For example, I consider this idiomatic golang code (from the standard library, no less) to be entirely unreadable:

https://golang.org/src/crypto/tls/handshake_messages.go#L297

For me readability is more about suitable levels of abstraction. Languages can affect that by making abstraction longwinded, or expensive at runtime, or hard to compose.

Re:Response to “Literate programming considered harmful” by panic on Wednesday August 31, 2016 @08:28AM (#12397749)
It's ultimately subjective, but I think that code is readable: the variables are well-named and each line says exactly what it does. Abstraction makes it easier for you to think you understand what the code is doing, but if you want to really understand what's going on, you also have to understand how the abstraction is implemented. Straightforward code like this can be understood directly, without having to dig through layers of function calls.
Re:Response to “Literate programming considered harmful” by catnaroek on Wednesday August 31, 2016 @08:42AM (#12397839)
If you think that code is readable, could you correctly write all pre/post-conditions in between statements?
Re:Response to “Literate programming considered harmful” by panic on Wednesday August 31, 2016 @09:20AM (#12398050)
I think that's a little different. Reading code almost never involves analyzing it to that degree. Usually you're just trying to figure out what part is broken or where you need to add some new functionality.
Re:Response to “Literate programming considered harmful” by catnaroek on Wednesday August 31, 2016 @09:24AM (#12398081)
The meaning of an imperative program is given in terms of Hoare triples. If you can't produce such triples on demand, then you don't understand the program in question.
Re:Response to “Literate programming considered harmful” by EdiX on Wednesday August 31, 2016 @08:48AM (#12397882)
> For example, I consider this idiomatic golang code (from the standard library, no less) to be entirely unreadable

Really? It's a binary parser that's parsing data from a byte array and stuffing the results into a struct, it seems pretty straightforward.