3 ms·
>This is what he was talking about when he mentions "more complex, less readable software." You're making a facile argument without realizing it. For example,
by jasode 9y ago
>This is what he was talking about when he mentions "more complex, less readable software."
You're making a facile argument without realizing it. For example, when you allow the ability to parameterize a thing, it can make the source code a little "less readable" while simultaneously reducing overall cognitive load.
Generics is the ability to parameterize _types_. As comparison, the language feature we are all familiar with is functions which allow us to parameterize _values_. Illustration of abstraction over _values_:
This is more readable (using technique of copy & paste):
fmt.Println("Hello World")
fmt.Println("Hello Jane")
The is less readable:
func greeting(x string) (string) {
return "Hello " + x
}
func main() {
fmt.Println(greeting("World"))
fmt.Println(greeting("Jane"))
}
Programmers may not think the function with passing parameters isn't less readable (because they are used to it) but it actually is. An extra layer of indirection will make the source text somewhat less readable but it's worth it if the net gain in comprehension, maintainability, correctness, etc is improved.
That's what parameterizing values via functions allows: it's simultaneously more complex and also more simple at the same time. It's complex at a superficial level but actually simpler at a deeper level. Programmers have embraced the additional "complexity" of "parameterized values" because it makes the language easier to use.
A similar analogy about "parameterizing types" can also be made.
>, he doesn't mention the language specification once.
Yes, if you do Ctrl+F looking for the exact phrase "language specification", you're not going to find it. However, if you understand the meaning of the quotes I pulled, that _is_ what Cheney is actually talking about.
- justin66 9y agoIf you're trying to address the topic of simplicity you're being awfully ironic about it.