News for hackers. Stuff that matters.
Re:On F# code readability by crntaylor on Monday March 04, 2013 @12:58PM (#5319418)
I disagree with his example of 'unintelligible' code. He suggests replacing

    match list with
      | x::xs -> ...
with

    match list with
      | head::tail -> ...
to make it clear what the names are referring to. But in F#, something to the left of :: can never be anything other than the head of a list, and something to the right of :: can never be anything other than the tail of a list! Calling them 'head' and 'tail' doesn't add any extra information. It just adds more characters.

The names x and xs are entirely appropriate when you don't know anything about the values you're working with (not even their types). All you know is that x has a type 'a, and xs has the type 'a list. Giving them abstract names reflects the fact that you are writing an abstract function. If you are writing a more concrete function, use more concrete names (e.g. trade or blogPost or playerAction... but not head and tail!)

Also, I don't know any F#, but is he correct when he says that the order of declarations in a file matters, and that the order of files in a project matters? That sounds crazy to me. What is the benefit? Both Haskell and Ocaml get along fine without relying on declaration order to do type inference.

Other than that - good article, I agree!

Re:On F# code readability by mokus on Monday March 04, 2013 @02:20PM (#5320147)
I've long felt that very-short names like "x" and "i" should be treated like pronouns in English. They should only be used when the scope is fairly limited and there shouldn't be too many in use at once. There are probably other sensible guidelines I've missed here.

When used well they often make code more readable than "descriptive" names, just like most English text is more readable with pronouns than without. In any case, categorically claiming they are bad makes about as much sense to me as banning pronouns from English.

Re:On F# code readability by jamesaguilar on Monday March 04, 2013 @02:24PM (#5320182)
That's a really great rule of thumb. I think I might use that. x::xs might not be so nice if the body of the match has twenty lines in it, especially if y::ys also exists. That'd be the pseudo-equivalent of saying, "Joe and Sam were getting food and he wanted a burger but he wanted steak so he finally argued that they should go to Bob's Grill which had both and he agreed." (Not really, because the sentence is actually totally ambiguous whereas with variables it just involves an extra lookup for the reader.) But if the body is one or two lines, there's not much purpose in the extra characters.
Re:On F# code readability by Associat0r on Monday March 04, 2013 @02:01PM (#5319942)
> Also, I don't know any F#, but is he correct when he says that the order of declarations in a file matters, and that the order of files in a project matters?

> That sounds crazy to me. What is the benefit? Both Haskell and Ocaml get along fine without relying on declaration order to do type inference.

Here is great explanation on the benefits of this. http://cs.hubfs.net/topic/None/59219#comment-70220

Re:On F# code readability by mich41 on Monday March 04, 2013 @01:13PM (#5319526)
> Also, I don't know any F#, but is he correct when he says that the order of declarations in a file matters, and that the order of files in a project matters? That sounds crazy to me. What is the benefit? Both Haskell and Ocaml get along fine without relying on declaration order to do type inference.

IIRC in OCaml you have to compile modules in topological order wrt dependencies.

Re:On F# code readability by pash on Monday March 04, 2013 @05:10PM (#5321353)
> ... in F#, something to the left of :: can never be anything other than the head of a list, and something to the right of :: can never be anything other than the tail of a list!

Yes, but the names you assign in a pattern get used outside the pattern. Presumably there will be an x/head or an xs/tail on the right side of the arrow in your example, and it's there that meaningful names help.

That said, I'm quite fond of the x:xs naming convention. It's particularly useful when you're doing something with two or more lists in the same scope, and you pattern-match to produce multiple heads and tails. For instance (Haskell syntax, as I don't know F#):

  zip :: [a] -> [b] -> [(a, b)]
  zip (x:xs) (y:ys) = x : y : zip xs ys
  zip _ _ = []
This also illustrates when you might well disregard the trope of using "meaningful" names. The code above is polymorphic and will work for any types a and b, and for any values of those types, no matter what they represent. Functional programming really encourages this sort of generality. Yes, it's very much the case that, as the article's author wrote, "functional code tends to focus on applying generic transformations to 'things', and not that much on what the 'thing' might be."

But, if it helps to clarify what you're doing at the domain level, you can (and should) assign meaning through types and by renaming and adding restrictive type signatures to polymorphic code:

  data Child = ...
  data Chore = ...
  type Assignment = (Child, Chore)

  assign :: [Child] -> [Chore] -> [Assignment]
  assign = zip
This not only helps readers understand what's going on, it also enlists the type-checker in helping to ensure you've, say, assigned chores only to your kids and not to your pets.
Re:On F# code readability by pash on Tuesday March 05, 2013 @03:27PM (#5327103)
Whoops, I changed my example midway through and ended up with something screwy. The first case of the definition of zip above should of course read:

  zip (x:xs) (y:ys) = (x, y) : zip xs ys
Re:On F# code readability by kvb on Monday March 04, 2013 @01:08PM (#5319479)
I agree that using head::tail is usually not more readable, though I think that sometimes it is better to be a bit more descriptive than just x::xs (e.g. key::keys). It really depends on the context as well as the experience level of the people who will be reading the code.

It is true that the order of files matters. Presumably this is for the same reason that order matters within a file.

Re:On F# code readability by sdevlin on Monday March 04, 2013 @01:03PM (#5319449)
> Also, I don't know any F#, but is he correct when he says that the order of declarations in a file matters, and that the order of files in a project matters?

He is correct. (At least, this was true a couple years ago. I haven't used F# since then, but I doubt this has changed.)

I don't have enough F# experience to speak to any potential benefits of this restriction.

Re:On F# code readability by thomasz on Monday March 04, 2013 @01:46PM (#5319810)
It's a pain in the ass, and the only benefit I can think of is that it made the compiler easier to implement.
Re:On F# code readability by snprbob86 on Monday March 04, 2013 @02:07PM (#5320007)
Many languages require declare-before-use and co-declared recursive structures. Sometimes, they provide an escape-hatch like a forward-declaration. It also makes the compiler substantially faster and makes it far harder to accidentally introduce a layering violation in your design.

If you're a Java or C# programmer, or even a C++ programmer, you're used to cyclic relationships all over the place. Your Person class has a .Adresses property and your Address class has a .Residents property so that you can conveniently person.Addresses.Filter(address => address.Residents.Count > 1) and suddenly your Address class is tightly coupled to your Person class. Do this a few dozen times and before you know it, your software is a maintenance and refactoring nightmare.

Object-oriented programming encourages this design. Functional programming discourages it. Modern OOP compilers conveniently resolve circular dependencies (Java does, C++ doesn't without header games). Modern FP compilers force you to declare and contain your circular dependencies.

Lastly, declare-before-use makes a lot of dynamic and live programming scenarios viable. Lisps, for example, generally have a compilation unit of a top-level form. This way the REPL and a normal source file behave more similarly, if not precisely the same.

Re:On F# code readability by thomasz on Monday March 04, 2013 @02:38PM (#5320291)
I'm totally fine mandating explicit declarations for mutual dependencies, I'm just pissed that F# has no syntax for dependent modules.

It's just odd. Why can I declare co-dependent functions and types, but not modules?

Re:On F# code readability by snprbob86 on Tuesday March 05, 2013 @12:11PM (#5325712)
If they are co-dependent, then that, by definition, means that they are not independent. What value do you get by having co-dependent modules that you can't get by having a single module? If you want two public APIs with one common implementation that is co-dependent, you can have three modules where two depend on the co-dependent part. Without seeing a motivating use-case, I'm just going to assume that F# is succeeding in preventing you from making a bad design decision.
Re:On F# code readability by gtani on Monday March 04, 2013 @01:55PM (#5319893)
If you were writing for haskell/scala/ML'ers, x::xs, for C#ers, head::tail

I haven't been tracking closely but no Forward declarations was one of common complaints, along with organizing projects in subdirectoris (I think they have fixes for that now) and VS support in general

http://stackoverflow.com/questions/1378575/f-forward-type-de...

__________

Also Xamarin shd be releasing... soon

http://news.ycombinator.com/item?id=5251413

Re:On F# code readability by flaie on Monday March 04, 2013 @03:21PM (#5320616)
You're right about the fact that on the left on `::` can never be anything other than the head of a list.

But I'd like to add that throughout almost all OCaml code I've written and used to read, that type of matching was written:

    match list with 
        | h::t -> 
Wich reads easily `h` for `head` and `t` for `tail`. I'm surprised it hasn't been reproduced in the F# world.

`h::t` seems even better to me than `head`/`tail` or `x`/`xs` which for the second one, means nothing really to me.

Re:On F# code readability by mich41 on Monday March 04, 2013 @03:48PM (#5320804)
Maybe your code isn't famous enough. I've seen lots of x::xs's everywhere, but never a single h::t.

Personally, I always use x::xs in one-liners and something meaningful (no, neither head nor h is meaningful) in longer matches.

Re:On F# code readability by flaie on Monday March 04, 2013 @04:20PM (#5321050)
I've never mentioned my code as being famous. I've always used h and t in one-liners, maybe because of the person who taught me OCaml.

H and t can also be found in the official Caml and batteries source code, along with hd/tl, a/l and probably x/xs if it pleases you.

I can't agree more about naming variables correctly where it makes sense though.

Re:On F# code readability by sitharus on Monday March 04, 2013 @01:41PM (#5319758)
Yes, order of files in a project matters. If Things.fs contains type Foo and Main.fs uses it, then the project must look like

    MyProj
    |- Things.fs
    |- Main.fs
Visual Studio has a few functions to manage this order.

The benefit is faster compilation, because F# requires recursive types to be declared together, such as

    type Foo = A of Bar | B
    and Bar = {Baz: Foo}
this doesn't really come up that much.
Re:On F# code readability by lysium on Monday March 04, 2013 @03:08PM (#5320524)
> this doesn't really come up that much.

Unless, of course, if you don't know or expect that 'rule' and you are wondering, why your type is not visible in that other module for over an hour...

Re:On F# code readability by watt on Monday March 04, 2013 @01:04PM (#5319457)
Oh but it does.... I don't know first thing about F#, so "x::xs" looks alien and very unapproachable (and also will make the rest of method body confusing).

In my mind it's that code readability is at last being discussed, signals that F# might be nearing mainstream.

Re:On F# code readability by LeonidasXIV on Monday March 04, 2013 @01:11PM (#5319510)
> Oh but it does.... I don't know first thing about F#, so "x::xs" looks alien and very unapproachable (and also will make the rest of method body confusing).

I use OCaml and I think of it as idiomatic naming for pattern matching on a list, in a similar way to how iteration variables are often named `i`, although `index` might be more superficially clear, but in reality it is not really since one "knows" `i` is the interation variable, just like `x::xs` means `x` is an element and `xs` is a list of x'es, that is elementy of the same type as x. Pretty clear in my opinion.

Re:On F# code readability by sdevlin on Monday March 04, 2013 @01:08PM (#5319481)
Surely questions of readability should be decided with an eye towards experienced users of the language and not those who "don't know the first thing about F#".

I agree with the GP that x::xs is more appropriate.

Re:On F# code readability by watt on Monday March 04, 2013 @01:18PM (#5319566)
You will end up with just another fringe write-only language.
Re:On F# code readability by chc on Monday March 04, 2013 @01:31PM (#5319675)
I do not think that phrase means what you think it means. If the code is readable to somebody of average skill who has learned the language, it is not "write-only." The fact that you can't read code in a language you don't know shouldn't surprise you any more than the fact that I can't read a book in Vietnamese. My inability to read Vietnamese does not make it "write-only" — it's just a sign that I haven't learned the language.

As for "fringe," that may or may not be true. It's pretty subjective. But really, who cares? Back when Ruby was the weird new thing gaining visibility, I heard the same complaints about its idioms. Last I checked, it's still doing fine. I'm OK using "fringe" languages like Ruby.

Re:On F# code readability by chc on Monday March 04, 2013 @01:16PM (#5319547)
I do like the principle of thinking about code readability. But unless you're writing an introductory tutorial, your code should absolutely not be optimized for reading by people who know nothing about the language. You should try to make it readable for the people who will actually be working with the code.

Optimizing code for people who don't know anything about the language basically means sticking as close to the C or Python way of doing things as possible. If your language is significantly different from C, this is obviously not going to be a global maximum of readability.

Re:On F# code readability by abraininavat on Monday March 04, 2013 @01:11PM (#5319505)
Is readability to people who don't know the first thing about F# at all relevant? If that's the most important metric then we should write out all our programs in plain English.

Readability to F# programmers is what matters, along with a host of other concerns, such as terseness.

Re:On F# code readability by kvb on Monday March 04, 2013 @01:19PM (#5319569)
Actually, I think there's some merit to writing code that is readable to outsiders, for several reasons. First of all, with a not-quite-mainstream language like F#, you're more likely to have team members joining your projects who are lacking the relevant in-language expertise. Making code more readable for them without significantly harming readability for an expert seems like a fine tradeoff. Secondly, one benefit to F# is that the code can read almost like pseudocode, which opens up the possibility of having domain experts (that is, non-programmers) review code, in which case the same tradeoff also makes sense (see e.g. Jane St. Capital, where traders review some/most of their OCaml code).
Re:On F# code readability by papsosouid on Monday March 04, 2013 @01:17PM (#5319561)
>so "x::xs" looks alien and very unapproachable

And how is head::tail any better? That's like insisting for loops use "counter" instead of "i".

Re:On F# code readability by klibertp on Monday March 04, 2013 @03:45PM (#5320792)
It's better - in so many ways that I will necessarily offer you just a short summary of some of them.

Being able to figure out a meaning of something is crucial in programming. We spend much more time reading the code than writing it and most of the time during reading is spent on resolving the meaning of symbols. To be able to tell what a symbol means, one needs to take into account many things - from OS it's running on to language it's written in to declared variables in the scope. And much more, of course.

Now back to your example: to be able to understand `x::xs` I need to know that `::` is a cons operator. Or more precisely, to understand the meaning of `x` symbol I need to take into account another symbol.

On the other hand of the spectrum is something like this: `first_element_of_list :: rest_of_list`. To understand the meaning of the first symbol in this expression you need to know exactly one symbol - itself. That's one benefit. The second is that someone who doesn't know what consing is, let alone how it's written in OCaml, can still understand this expression. So that's the second benefit.

It's worth remembering that we do not write the code for ourselves nor for the computers. We write the code to be read by other humans (always - don't argue). As with any kind of writing, then, it's helpful to know the audience. If I was writing a tutorial on constructing lists in OCaml (for beginners), I would use the second example above. But if I was writing production code (so for me and my team to read) I would use something shorter, like `head :: tail` for example. And if I was writing a quick and dirty script for my personal use, or if I was contributing to the work of hardcore OCaml hackers I would probably write `x :: xs` - because in case of script I'd be convinced that readability doesn't matter and in second case I would be certain that everyone reading and working with the code I wrote would be already so used to the construction that they would read it without problems.

That's another thing to consider: after using a language for a long enough time we tend to internalize its idioms; when this happens we are able to treat bigger constructs as one symbol. This ability helps in reading the code quickly, but it's worth remembering that not everyone developed it. Also, because longer names do not hinder quick-reading of idioms for those who know them, that's not a counterargument to longer names.

As for loops... Well, I do - sometimes - use `i` as a variable name, but I tend not to. Most often, after a while I come back to the code and replace `i` with `idx`. But to even use `i` as a name in the first place it needs to refer to the nonnegative integer value. In Python you generally iterate over collection directly, so you write `for what_is_it in a_collection:` instead of for example: `for i in 1 to 10: an_element = a_collection[i]`. Anyway, I use single letter variables very sparingly and in the smallest scope possible.

What I want to say, I guess, is that descriptive names are important in good programming and that there is really no argument for using non-descriptive ones.

Re:On F# code readability by h_r on Tuesday March 05, 2013 @08:50AM (#5324409)
I've been learning Haskell lately but I've seen the same idiom in other functional languages. I was struck by two things you said: you have to know cons'ing to understand x::xs and each symbol, x and xs should be unambiguously named in isolation (words to that effect).

What I see in "x::xs" is one simple expression at a glance. It is the cons that is the central concept in being able to understand the expression. So my next thought was to wonder what on earth someone is doing programming F# if they don't understand the first thing about working with lists? Cons is what makes the abstraction even possible. If you don't get that, longer symbols surely can't help except maybe to hide the magic gobbledygook.

Re:On F# code readability by klibertp on Tuesday March 05, 2013 @12:48PM (#5326047)
"What I see in "x::xs" is one simple expression at a glance."

That's exactly what I wrote about in this: "after using a language for a long enough time we tend to internalize its idioms; when this happens we are able to treat bigger constructs as one symbol."

The thing here is that I don't believe that you would treat 'head :: tail' any different than 'x :: xs'. I believe that you would still see 'head :: tail' as one simple expression: I certainly would. If so then there is really no reason to avoid using 'head' and 'tail' as names.

"longer symbols surely can't help"

Do you know lisp? If yes, skip this; if not, read on.

I'll give you two example snippets of code in Racket. Both use exactly the same syntax and mean the same; read the first one and try to answer the question what the code does. The read the second one and try it again.

    (define (drt t)
      (define-values 
        (p l) (values 0 (s:l t)))
      (λ (dc x y a)
        (drc dc x y (s:s (s:r t p)) a)
        (set! p (add1 p))
        (when (>= p l)
          (set! p 0))))
Assume that `s:l`, `s:s` and `s:r` are provided from another module that you have only in a compiled form at the moment and that drc is defined in the same module but written in the same style. Can you tell what is happening here?

The second snippet looks like this:

    (define (draw-text text-string)
      (define-values (current-pos text-len) 
        (values 0 (string-length text-string)))
      
      (lambda (drawing-context coord-x coord-y angle)
        (define current-letter (string (string-get-char-at text-string current-pos)))
        (draw-char drawing-context coord-x coord-y current-letter angle)
        (set! current-pos (add1 current-pos))
        (when (>= current-pos text-len)
          (set! current-pos 0))))
Are you able to guess what this does now? Are you able to guess even a bit more than from the first snippet?
Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @01:00PM (#5326141)
>Assume that `s:l`, `s:s` and `s:r` are provided from another module that you have only in a compiled form at the moment

Why are you being so deliberately dishonest, and expecting a response like "oh, your strawman has totally convinced me to write shitty code, thank you so much first year CS student!"? The entire point is that x and xs are not defined elsewhere, they are defined by you, and used on a single line.

Re:On F# code readability by klibertp on Tuesday March 05, 2013 @01:14PM (#5326243)
"Why are you being so deliberately dishonest"

I'm not - that's how they are defined in Racket.

"and expecting a response like"

Why do you assume so? I'm really curious what is the difference in the readability to someone who doesn't know the syntax.

"first year CS student"

Ok, so I had enough: you're just a stupid troll. Not only you can't back your claims with arguments but now you're (for the third time, no less) using ad hominem "argument"; it's useless talking to you since you're too stupid to formulate sensible response and you're too bad a programmer to even have a chance of knowing something interesting.

"and used on a single line"

Oh, on a single line? That's fine then...

Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @01:19PM (#5326274)
>I'm not - that's how they are defined in Racket.

You are. The argument is that you should be using single letter variables for small scope, simple variables. Like the classics:

    for (i = 0; i < whatever; i++) {
        myarray[i] = something();
    }
and

    myfunction x:xs = dothing x + myfunction xs
When you decide to deliberately misrepresent that argument as "use single letter variables across modules" that is dishonest.

>Oh, on a single line? That's fine then...

Yes, of course it is.

Re:On F# code readability by klibertp on Tuesday March 05, 2013 @01:37PM (#5326393)
I'm still waiting for your argument as to why is one-letter name better than three-letters one. What is the difference, what makes it so much harder to understand the name with two additional letters? With a link to the source please.
Re:On F# code readability by papsosouid on Monday March 04, 2013 @05:17PM (#5321399)
You write bad code. If you are using anything other than a single letter for a simple for loop iteration, then you are making your code less readable, not more. Adding cognitive load to a trivial process is bad, not good.

You summarize your argument by saying descriptive names are important, but your examples do not support that at all. Descriptive names are important for things that need to be described. If I write a function "reverse_string" with a single string argument, that argument had damn well better be named "s". There is no longer name that can convey any useful additional information. Many longer names will be distracting, and make the code harder to read.

Re:On F# code readability by klibertp on Monday March 04, 2013 @05:37PM (#5321513)
"Many longer names will be distracting, and make the code harder to read."

Do you have any source for this? I really can't imagine this happening, seriously.

"You write bad code."

I see, it's one of those days when you just have to be a dick to someone. Ok, no problem, moving on...

To reiterate without needless things involved: can you prove that a) words between 1 and 6 letters of length are significantly harder to read for higher letter counts and b) having longer names, regardless of a, is not beneficial at all? If you can - please do.

Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @10:31AM (#5324975)
Given that 90% of experienced programmers fall on the side of "i or gtfo", the onus is on you to prove that "counter" is beneficial. Any time I see a long variable name, I naturally assume it is important, and has a large scope. When you lie to me with your code, that makes it harder to read, not easier.
Re:On F# code readability by klibertp on Tuesday March 05, 2013 @12:26PM (#5325836)
"Given that 90% of experienced programmers"

Is this your proof? Nice...

"is on you to prove that "counter" is beneficial"

And why not on you to prove that it's harmful? Because you don't have arguments?

"Any time I see a long variable name, I naturally assume it is important"

Very good habit, keep at it - and please define 'long' by the way. For me it means 14-20 characters; and short means 3 to 6 characters.

"experienced programmers fall on the side of "i or gtfo","

Well, these are probably the same people who claim that comments in code are bad. Both claims are simply stupid. Anyone experienced enough - and not dyslectic... - will tell you that readability counts, that you should never or almost never use any name shorter than 3 characters and that you should comment your code heavily. Whoever tells you otherwise - to put it simply - writes bad code or wants you to write bad code.

I find it amusing to see so many people mistaking familiarity for readability. Just because something is very familiar to you it doesn't mean that it's readable. It's a shame that people are unable to look at the matter objectively and hence they write bad, unreadable, hard to change and extend code.

Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @12:42PM (#5325986)
>Well, these are probably the same people who claim that comments in code are bad.

No, they are not. Please, copy this thread into a text file and hang on to it. Spend a few years actually reading and write code. Then come back and facepalm at yourself.

Re:On F# code readability by klibertp on Tuesday March 05, 2013 @12:57PM (#5326116)
I have been reading and writing code for twenty years now in about a dozen languages or so. How long do you think I should wait to realize how mistaken I am now? And while we're at it, how many years have you spent writing and reading code and in how many languages?

But that's a digressions, what's important is that you provided not even a single argument; not even one. You cannot expect to convince anyone without even trying.

Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @01:15PM (#5326254)
>I have been reading and writing code for twenty years now in about a dozen languages or so

I would strongly recommend that you stop admitting that.

>And while we're at it, how many years have you spent writing and reading code and in how many languages?

28 years, and I count 18 languages including logo and sh which you might not count.

>what's important is that you provided not even a single argument; not even one.

Yes I have. Ignoring it doesn't make it cease to exist. The vast majority of experienced programmers have already gone through writing code like you when they were beginners, and then realized it was bad and stopped. You can easily verify this yourself by noticing how the vast majority of experienced programmers tell you that you are wrong.

>You cannot expect to convince anyone without even trying.

I do not expect to convince you. You are attempting to convince others to write bad code. I am stating that you are a bad programmer, and that is why you find such resistance when you try to convince people to write bad code. The fact that you focus entirely on strawmen and demanding that other people prove you wrong rather than simply supporting your claims does not help your case.

Re:On F# code readability by klibertp on Tuesday March 05, 2013 @01:23PM (#5326295)
You know, saying that someone is a bad programmer without reading their code disqualifies you even before you say anything else. And the "majority of experienced programmers" is a "citation needed" thing. Donald Knuth seems to disagree with them, anyway.

I see no other resistance than from you, by the way.

Oh, and also: aside from "citation needed" your argument that "many people think the same" is an argument from authority, which is rather weak thing to do.

Re:On F# code readability by papsosouid on Tuesday March 05, 2013 @01:35PM (#5326379)
>Donald Knuth seems to disagree with them, anyway.

No, he does not. Read his code, it is full of single letter variables.

Re:On F# code readability by klibertp on Thursday March 07, 2013 @10:23PM (#5341917)
Unfortunately you're right on this. I read his various works long ago and had not very accurate memory of them.

As a final note in this discussion I'd like to say that you're probably misunderstanding me. I have never said that single-letter names are completely prohibited - just that they should be avoided when possible.

I actually went and did some analysis on the code I think is good: Underscore.js. This is what I found.

I excluded all language keywords like `var` and `if`. I then calculated how many unique names there are in the code and how many of them are 1 or 2 letters long. The result I got was 4%.

I then checked how many times each of the names was used and how many times 1 or 2 letter long names were used, Surprisingly I got almost the same result - 4%.

So, to conclude - if more than 4% of names you use are shorter than 3 characters than you're writing bad - or at least worse than Underscore.js - code. I'm not guilty of this, I checked my own code too. And how about you?

Also, on a more personal note - you're infuriating as a adversary in the discussion because of at least three things: you only answer to parts of arguments that are convenient to you, you don't openly state assumption you're making and you're mixing completely irrelevant things into the discussion. Please improve :)

Re:On F# code readability by waxjar on Monday March 04, 2013 @04:01PM (#5320900)
I don't know any F# either, but I know that in Ruby the order of files does matter. When you define a class that inherits from a class that lives in another file, you'll have to require that one first.