file: module and character special files

Matthias Lang matthias@REDACTED
Tue Mar 2 14:37:53 CET 2004


The "should file:open()" return 'eisdir' can be considered in
political terms. You could say:

  "The documentation says 'eisdir' only happens if the file is
  a directory. The right way to handle the current situation is
  to use file:read_file_info() to determine the file type rather
  than relying on a bug. 

  Breaking backwards compatibility only punishes people who did
  the wrong thing. So it should be done."

But you could also argue that the role of the maintainers is to
minimise harm, and the harm done to existing, large projects far
outweighs the inconvenience of confused newbies.

Here's a longer discussion of the same idea, which happens to mix in
the question of typing:

  | From: Fergus Henderson (fjh@REDACTED)
  | Subject: Re: Does political orientation affect language choice ?
  | View: Complete Thread (28 articles)
  | Original Format
  | Newsgroups: comp.lang.functional, comp.lang.misc
  | Date: 2003-02-17 06:47:07 PST

[...]

  | For example, here are two moral principles identified by Lakoff:
  | 
  |         The Principle of Reward and Punishment
  |         --------------------------------------
  |         People who do the wrong thing deserve to be punished.
  |         People who do the right thing deserve to be rewarded.
  |         It is immoral to punish someone for doing the right thing.
  |         It is immoral to reward someone for doing the wrong thing.
  | 
  |         The Principle of Altruism and Harm Minimization
  |         -----------------------------------------------
  |         People who do the wrong thing need help.
  |         People who do the right thing are usually
  |         capable of looking after themselves.
  |         It is immoral to harm those who need help.
  |         It is a moral imperative to help those who need help.
  | 
  | Most people would agree that there is some validity to both of these
  | principles.  However, sometimes we are forced to choose between the two.
  | People whose politics are to the right of the spectrum tend to give
  | greater weight to the first of these principles, and those on the left
  | give greater weight to the second.
[...]

  | Some of the arguments for and against strong type systems can be
  | phrased in ways that directly appeal to these principles.
  | 
  | For example, one argument against the use of strong static type systems
  | is that it encourages a lack of discipline.  Without static typing,
  | programmers who make mistakes are punished for them, and as a result,
  | they learn the discipline necessary to write correct code.
  | Static typing eliminates this, rewarding those who do the wrong thing.
  | Furthermore, some static type systems restrict language expressiveness,
  | which punishes those users who have done nothing wrong (written no type
  | errors).  As you can see from these arguments, strong static typing
  | can be considered to violate the Principle of Reward and Punishment.
  | On the other hand, there are also some strong arguments that it
  | conforms to the Principle of Altruism and Harm Minimization.
  | The relative weight people place on these principles thus affects
  | their choice of programming language as well as their political
  | orientation.

Matthias
(changing the manual to at least say that 'eisdir' doesn't necessarily
mean it's a directory seems like a universally acceptable solution.)



More information about the erlang-questions mailing list