Comment

Comment by stouset

As a general rule, if you're referencing the dictionary definition of a word to make your point, you're just playing semantic games.

You know what people also find complicated? Hundreds of lines code being repeated with superficial edits because of golang's lack of ability to abstract higher-level ideas. It's a stupid toy example, but for a very large number of people

    nums.take(20).select(&:odd).reduce(&:+)
is less complicated than

    sum := 0
    for i, v := range nums {
        if i > 20 {
            break;
        }
        if v % 2 == 1 {
            continue;
        }
        sum += v;
    }
The former is less complicated for those people (including me) because it expresses high-level intent rather than low-level implementation. Multiplied over a large code-base, the ability to express intent adds up to an enormous saving in mental overhead rather quickly. You can always drill down and focus on implementation where it matters, but with golang there's almost zero ability to separate a program's detailed implementation from a high-level description of what you're actually trying to accomplish.

The Ruby version of this is also less bug-prone (did you spot the bug in the go example?). And it's also easier to apply to new contexts: the former works automatically for infinite enumerations.

parent stouset 4 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton