• Anders429@programming.dev
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    I’m a bit confused about the premise of the article. Does anyone assert that typing speed is a bottleneck at all? I’ve been in the industry for years, and have never heard that claim.

    I do agree about the whole “less code is not always more”, but I get confused when the author keeps bringing it back to typing speed.

    • PowerSeries@lemmy.ca
      link
      fedilink
      English
      arrow-up
      1
      ·
      10 months ago

      I’ve watched some slow typists program, and I think I have the answer. If it takes you a while to type the code out, you are much more likely to stick to the first approach that works, and not rewrite it as much.

  • lysdexic@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    10 months ago

    From the article:

    (…) but recently, another type of criticism seems to be on the rise.

    The code that I suggest is too verbose. It involves too much typing.

    This reads like a one-sentence strawman. Describing code as “too verbose” is really not about the risk of carpal tunnel syndrome. It’s about readability and cognitive load.

    The blogger seems to almost get the point when he writes the following:

    In short, the purpose of source code is to communicate the workings of a piece of software to the next programmer who comes along. This could easily include your future self.

    The purpose of source code is to communicate (…) to the next programmer who comes along.

    If you make the mistake of going the “enterprise quality java code” meme approach, you’re making the next programmer’s life needlessly harder.

    The blogger then tries to make his case with verbose code, and makes the following statement:

    Which alternative is better? The short version is eight lines of code, including the curly brackets. The longer version is 78 lines of code. That’s ten times as much.

    I prefer the longer version. While it takes longer to type, it comes with several benefits. (…)

    This is yet another strawman. The longer version is awful code, not because it’s longer but because it’s needlessly jam-packed of boilerplate code. Ignorign basic things like interfaces and contracts, It’s been proven already that bugs in code are directly proportional to the number of lines of code, and thus the code the author prefers is likely to pack ten times more bugs.

    The shorter code in this case would not be the 78-loc mess that the author picked as the thing he prefers. The shorter code in this case would be something like onboarding the project onto Project Lombok to handle all-args constructors, property methods, and even throw a builder in for free. This requires onboarding Lombok to the project, and add two annotations to the short example. Two lines of code, done.

    After the blogger fails to make his case, he doubles down on the typing non-sequitur:

    Perhaps you’re now convinced that typing speed may not be the bottleneck (…)

    This is a blog post that fails to justify a click. It’s in the territory of “not even wrong”.

  • vettnerk@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    10 months ago

    Typing speed matters in programming the same way hammer hits per second matters when building a house. There’s a little bit more to it.

  • onlinepersona@programming.dev
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    I agree, typing is not a bottleneck, repeating yourself is. All that boilerplate code in the example, shouldn’t have to be written. It’s wasted time.

  • a1studmuffin@aussie.zone
    link
    fedilink
    English
    arrow-up
    1
    ·
    10 months ago

    I discovered this very quickly after breaking a finger. One-finger typing didn’t slow me down at all. Turns out my brain was the bottleneck.