Hi all,

I'm impressed with the quantity and quality of the responses - no shortage of opinions here.

I had thought of many of the benefits of using abbreviations, symbols, keyboard punctuation and alike. Another (alluded to in the fist reply), is the internationalization that non-natural-language specific "keywords" provide "+" is understood by many that wouldn't know "plus."

On the down side, how many different symbols do you know for "and" "or" "not" etc..., all in the same general discipline?

Saving keystrokes I find less compelling - for one thing, my early impression of F# is that code accomplishing the same thing as C# code, tends to be far more efficient, due to the paradigm used (and would still be, if less ambiguous terms were used).

In the flow of MikeGale's points, anther consideration is how many keywords/reserved-words a language (and implementation) uses. I very much liked Forth. It used some symbols and abbreviations in the basic minimal vocabulary; but that was a very limited set of building blocks. The programmer was encouraged (and free), to create the rest of the edifice with meaningful and expressive terms.

A point in favor of terms using a natural language semantics, is in knowledge worker verification. I've heard F# has an advantage in this regard, already. How much more so, if it avoided terms known only to the initiated?

In all, there are pros and cons, costs and benefits either way. Is there any chance of of a Common Language Intermediate (for F#), that would allow the coder to choose "rec" or "recursive" "int" or "integer"? It's beyond my powers and interest to do the doing of it; but are there good reasons not to offer the option?

Thanks again for all the replies,

BRN..

By on 11/22/2009 1:54 PM ()

Well, the F# base syntax is still pretty light. Many constructs are written in F# itself. There's nothing about F# that demands "|>" be "fun x f -> f x" -- you can define it or redefine it as you see fit. Many other constructs are, at some level, just syntactic sugar (if-then/while, etc.).

Your point about "integer" is easily rectified:

1
2
3
4
5
6
 

type integer = int

let a : integer = 1

As far as wanting to have a slightly different syntax on the front end: the full source code is provided :). The reasons I can think of for not offering the option is not only that it adds complexity to the language, but now that F# is commercial, I imagine we'll need a lot better than "why not" as justification. There's documentation, Visual Studio editing, compatibility (someone might be using "recursive" as an identifier, for example), and on and on. That would have to be offset by some real solid evidence that providing long keywords provides enough value to justify the costs.

I'm not convinced that changing "rec" to "recursive", "val" to "value", "sig" to "signature", "fun" to "lambdafunction" ("function" is already used for "fun x -> match x with ..."), and so one are really going to increase the overall readability. Any sizable amount of code will probably use F# idioms like |>, >>, << and so on anyways that you're going to have to "get in the flow" again regardless of a handful of keyword names. (BTW, this is the same reasoning I have against using 'T, 'U versus 'a 'b -- the slight benefit of .NET consistency is overwhelmed by the huge differences in the languages anyways.)

By on 11/22/2009 5:47 PM ()

As one solid example of MikeGale's points regarding switching languages to back up my previous post: What's more likely to cause confusion: "let rec foo ..." or "if !someFlag then..."?

By on 11/22/2009 5:52 PM ()

Hi Brian - here's a kindred spirit, commenting on google's "go" language, over in slashdot...

I don't like how this language uses "func" instead of "function",

therefore this language is terrible and everyone who uses it or thinks

about it in any way except for about it sucking is also terrible.

:)

By on 11/22/2009 3:09 PM ()

Hi JM,

Some people just have a way with words.

Actually, the closest was the response about how the many syntax/lexicon learning/re-learning curves get in the way of getting anything done.

Good tools can help - if VS 2010 does F# right, that will help a great deal. Think anyone would still be writing code in BASIC if not for Visual Studio? For an example of how big a difference a tool can make, I ought to turn off the inline spellchecker, and let you try to decipher that code!

Just skimmed the /. link - hope my post didn't cause you a "Oh no. Not here too!" moment.

BRN..

By on 11/22/2009 3:49 PM ()

Having had to use JavaScript, one of the most annoying things (well apart from general syntax and lack of a nice type system and tools) was that lambdas are done via "function". An 8 character keyword for something so incredibly common. I'm still not totally pleased with having "fun ->" either. I think I'd prefer "\."

In general, I find more verbose syntax to be more mentally taxing when reading source, as there's simply more "noise". Even VB uses "Sub" instead of "Subroutine", right?

Judging from COBOL, I'm not sure I'd infer that compactness of source code was an overriding goal in decades past.

By on 11/22/2009 12:00 PM ()

Hi Michael,

When in school, COBOL was one of about 1/2 dozen programming languages in our (Systems Analyst/Programmer), curriculum. I actually enjoyed the English-like nature of COBOL (except for colliding with the reserved words list).

We wrote code - literally - (in pencil, character by character), on pre-printed forms; which were given to data entry personnel, who would type them into punch cards, which were passed along to the main-frame computer operators to run as over-night batch files. So, more room for source code, just meant cutting down a few more trees.

Each error (typo or logical), cost us a day, plus the time it took to find it in a hex dump - ambiguity had a definite price. On the positive side, we only worked in one language (except for the added JCL), at a time. Once you were "into" coding that language, you didn't have to deal with mental switch-backs. [Wonder which coding style, those that made a career of maintaining COBOL written by others, preferred to see?]

The 'precious" memory referred to early microprocessor based systems. The first computer I bought for myself came with 2K RAM, and source code was either typed in directly or "read" off an audio cassette.

Never worked in JAVA (though the concept of its promised universality was appealing). I'll take your word for its short-comings.

Anyway, I should get back to learning F#, with the syntax it has - even if the style makes it harder for at least some of us.

BRN..

By on 11/23/2009 9:48 AM ()

A key dimension in this how often you use the language.

Another is how many other languages you use.

I don't know what the spectrum of F# users is, but I find that I need to use an annoyingly wide range of languages to do what I do. Readability after a break is a big issue.

If I can pick up quickly after a fairly big "cognitive break" then a language stands more chance of getting used. If it takes too long to get back into it I might simply drop it.

(I can think of at least one language that I really like, but takes so much time to get back into that I haven't used it for a long time.)

I've not been using F# a lot recently (after I bought the early books I found syntax changing too much, I'm not one who wants to rewrite operational code...).

I have a feeling that F# is well designed in this respect, the significant white space is a good idea (though I like an option of tabs).

(I presume somebody, somewhere has researched this.)

By on 11/22/2009 12:31 PM ()

Also, although F# is a "new language" O'Caml compatability was a goal when the language was in development. Many of the terse keywords come from that ML lineage.

By on 11/22/2009 11:42 AM ()

"rec", "dim", etc., have true meaning only in the artificial language that they are supporting; as such, one could argue the reverse, that they should be called "plugh", and "gronk" so that any similarities to your organic language of choice are removed.

Though I don't want F# too turn into APL, I think the rationale is (a) typing less, and (b) reduced source bulk, and (c) being able to see the keywords (as above) as individual semantic units, more like single glyphs than English words.

Brackets are more explicit than tabs, but I certainly appreciate Python/F#'s choice of ascribing meaning to whitespace.

After going back to C# for a bit, I'm actually jealous that C# now has a more succinct lambda syntax than F# -- given how often it's used, I'd love to see the "fun" become optional in F# in favor of the infix arrow alone.

In in all, I think F# has a pretty great balance of terseness and understandability. (Though it took me a while to get used to :> & :?> over up/downcast/box, so go figure :))

By on 11/22/2009 11:29 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper