Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Do you really believe our brains are all the same?

One thing that all brains have in common is that they can learn. One thing that all feet have in common is that they can not learn. That's why your analogy doesn't work here.

>Functional programming is inscrutable by most.

As is musical notation, maths, foreign languages, CAD drawings and everything else that has to be learned before use.

I am not a huge proponent of FP as I'm not entirely convinced that the benefits of immutability always justify the restrictions imposed on algorithm and data structure design, both in terms of simplicity and performance.

But one thing I am convinced of is that whatever newbies may find inscrutable is entirely irrelevant unless you plan to cut costs by having interns write all your code for free before replacing them.



> But one thing I am convinced of is that whatever newbies may find inscrutable is entirely irrelevant unless you plan to cut costs by having interns write all your code for free before replacing them.

I completely agree. My standard in choosing a design or syntax is whether a reasonably competent (but not brilliant) programmer will understand this well if they are already generally familiar with the codebase (but unfamiliar with this particular module) and are in a particularly big hurry.

As a specific example, I was horrified the first time I saw Java's convention for setting fields in a constructor:

  public class SomeClass {
      private final int shoeSize;
      private final String favoriteColor;
  
      public SomeClass(int shoeSize, String favoriteColor) {
          this.shoeSize = shoeSize;
          this.favoriteColor = favoriteColor;
      }
  }
The constructor has a local variable with the same name as the instance variable. The syntax works because local variables shadow instance variables but not when explicitly referenced via "this." -- a moderately obscure part of Java syntax.

Normally, I would object if a developer created a variable name that shadowed another and expected the reader to keep it straight and not get confused. But when you do this REGULARLY, it becomes just another standard idiom. Most readers today (now that the practice has been standard for over a decade) wouldn't even blink. A complete novice might be confused, but the complete novice isn't my target audience.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: