3

This subject itself is difficult to google, so I apologize beforehand for the hundreds of links I'm sure are hidden somewhere. This question was moved from the philosophy site as they told me that it fits better here.

So, it came with this question: Is fewer lines of code always better?, a somewhat subjective question about code (about best practices). Then I thought about it and now I'm really curious about it. I have some questions around this subject itself:

  1. Are there other words that show signs of a sentence that, while syntactically correct and apparently right, can be used to clearly see that a sentence might be logically wrong? Always/never in something that makes me read it slowly and double check about the validity of that sentence.

  2. Where/how can these words be used? If it's a definition, for example, always can be used (as long as it doesn't class with other definitions). But people don't normally talk with pure definitions, and there're many cases (in programming at least) that people overuse the words 'always/never', maybe for laziness or shortness sake. Another example (for programming), 'Global state is evil', which could be reworded as 'Never use global state'.

5
  • Personally I don't see any logical/semantic contradiction ? is denotes a question/predicate, on the subject fewer lines of code, and the statement is always better. Could you elaborate ? Jul 6, 2013 at 8:53
  • 3
    I think your question has a bit of a fundamental flaw in that it assumes predicate logic and discourse follow the same rules. Hyperbole is extremely common in discourse but we are able to recognize and deal with it. Thus, the scope of always or never would be bound by context; rather than meaning "for all X element of Y", always can, and commonly does, mean simply "in very nearly all cases". In linguistics, definitions are not rigid, they change with context and usage so there is absolutely no problem with interpreting always in this way.
    – acattle
    Jul 6, 2013 at 10:50
  • Logic is just a skeleton of language use and variability; as @acattle points out, they don't follow the same rules. Nevertheless, your instincts are sound. "Always/never in something that makes me read it slowly and double check" is exactly the correct reaction. Because always is a universal quantifier and never is a negative, and both are Operators, logically and semantically, which focus or bind another element and can be moved around by various syntactic rules; and using a negative and a quantifier in the same clause often causes Q-Neg ambiguity, as in All the boys didn't go.
    – jlawler
    Jul 6, 2013 at 13:28
  • See the Logic Guide and the Verb Phrase Guide for the relation between logic and syntax.
    – jlawler
    Jul 6, 2013 at 13:30
  • Be careful, the generalization that sentences containing always are always wrong will set you up for the same kind of criticism you might like to dish out.
    – user483
    Jul 8, 2013 at 0:02

3 Answers 3

1

I don't understand the relationship between the part of your question concerning economy of code lines and special words like "always", but it's possible you can find something of interest in the philosophy of Nelson Goodman, because Goodman dealt with both those matters.

The evaluation metric in linguistic theory, proposed in Chomsky and Halle's The Sound Pattern of English and elsewhere, requires us in our search for the best account of a language system to adopt the theory with the fewest symbols. I have heard that Chomsky was influenced to make such a proposal by Nelson Goodman, who was Chomsky's teacher.

Then also, Goodman invented a puzzle which many philosophers have worried about, which involves the superiority of certain words, or at least concepts, in the formulation of scientific laws. See the account of grue in the Wikipedia article. Grue "applies to all things examined before a certain time t just in case they are green, but also to other things just in case they are blue and not examined before time t." In formulating laws of nature, green is better than grue, in spite of the fact that before time t statements about what things are grue are empirically indistinguishable from statements about what things are green.

0

The universal quantifier words are like this -- all, no, none, everybody, nobody, each, every, never, always and so on. Some people insist that you have to follow an absolute universality definition of such words, so you can't say "Fred never leaves a tip" if Fred has been in a situation where tips are expected a hundred times and left a tip only once. Most people don't think that way, and would consider the counterexample to be not worth considering -- basically, it's not a datum. If Fred has tipped 5 times out of a hundred, I think it's misleading to say "never" and you should say "rarely".

So there could be competing theories of the meaning of "never", one being the absolute not-even-one-case interpretation, and the others allowing some number of counterexamples. At the level of individual behavior, you find people who act according to the "absolutely none" theory, and you find people who act according to less stringent criteria of non-existence. So either some people have a different meaning for "never", or else most people don't know the meaning of "never" or don't care about the meaning of "never". Ideally we would decide this empirically, but I am not sanguine about the probability that the experiment will be performed.

Your code examples point to something slightly different, since the question is about a continuous value (comparatively better), rather than a simple true/false distinction. If you have multiple evaluative principles, then they may also be hierarchically weighted -- this is what they do in Optimality Theory (well, used to, until that changed). "X is always better" means that the first evaluative cut rejects any non-X options, so any surviving possibilities must be X (and then the second-level principle would kick in to find the best of the all-X subset). So there is competition between "fewer lines of code is (always) better" and "more readable code is (always) better". Attaching "always" to one of these helps resolve the matter.

0
  1. Sentences with 'always' or 'never' aren't neccessarily inherently wrong. They just tend to make refuting the sentence very easy: You just need to think of one counterexample to disprove them. On the other hand, if the sentence used 'occasionally', in order to refute it, you'd have to show that it's actually never the case.

    If you are looking for other words that make it similarly easy to disprove a sentence, you are looking for other words denoting the frequency with wich they are true. A sentence like 'There is exactly one red Ferrari' is still easy to disprove, because you only have to find out that either there is no red Ferrari at all, or that there are more than one. (Which is only marginally harder to do than showing that there is at least one to refute 'There are no red Ferraris.', which is just another way of saying 'Ferraris are never red.')

    As you count up, things get harder. If you were to say 'There are exactly 295 cities starting with m', to disprove it, I'd have to count cities starting with m until either I reach more than 295 or until I am absolutely sure that there are no more cities starting with m that I haven't counted yet. Vague terms like generally, occasionally or often are virtually impossible to disprove, unless you can prove that the sentence is absolutely never true, which is usually not all that easy to do.

  2. If you mean by 'when can these words be used', 'when are these words used in such a way that the meaning of the sentence analysed by formal logic corresponds to the intended meaning of the speaker', they can be used anytime the speaker is convinced that something is unfailingly always the case (or never). That basically narrows it down to either definitions, or characteristics that derive from these definitions.

    E.g., if I say 'Fewer lines are always better' (understood as 'If you can get two blocks of code achieving the same output, it is always better to use fewer lines rather than more'), either I am defining 'good' in the context of coding, saying that good code is short (successfull) code (rather than, say, code that is easily readable), or I am assuming a definition of good code that makes it obvious that using less lines is always better (e.g. I pay my programmers by lines, cheapest (working) code is best, --> fewer lines are always better).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.