"Why F?" by David Epstein @Imagine1, Inc.

发信人: leavy (☆星河☆), 信区: Fortran
标 题: "Why F?" by David Epstein @Imagine1, Inc.
发信站: 南京大学小百合站 (Mon Aug 30 17:49:08 2004)

Why F?
David Epstein
Imagine1, Inc.
When I told somebody at Supercomputing '97 in San Jose that F was ``designed
for education'', she replied, ``What exactly does that mean?'' Apparently, th
e claim ``designed for education'' is used elsewhere, so I was being challeng
ed for some sort of
proof.

``Great. Where do I find more information about F?'' This was her response wh
en I gave her the following background.




--------------------------------------------------------------------------------

My First Bug
It took me over twenty four hours to find and fix my first programming bug. I
had missed a single character on a punch card and had no idea what was meant
by the message

7: incorrect statement

It seems the professor forgot to inform us about deciphering error messages,
so I had no idea what or where the error was. I had misspelled the word INTGE
R (forgot an ``E''.) After dropping my program cards and resorting several ti
mes, it took the aid
of a student that had passed the class the previous semester to locate the er
ror.

In F, if you misspell the word INTEGER, we tell you, ``You misspelled the wor
d INTEGER.'' (There was obvious interest at this point in the conversation, s
o I continued on that point.)

You will note that we know when a word is misspelled, but we do not automatic
ally fix it. That would essentially result in an extension to the language. I
nstead, we report it and require the student to fix it. We can, however, fix
it within the
compiler so no further error messages result. This is extremely important on
constructs such as IF, since a beginner is likely to look at the last error m
essage instead of the first; reporting that the ENDIF statement does not have
a matching IF
statement serves only to confuse the amateur.

If you miss a comma or a colon, we can tell you exactly what is missing. As w
ell, there are no curly brackets (``{'',``}'') or semicolons in F. We emphasi
ze words, like POINTER. If something is a pointer, you use the word POINTER.
Pointers can only
point at targets, which require the word TARGET.

Error Messages
There probably is really only one answer needed for your question--ERROR MESS
AGES! The single most important feature required by the absolute beginner is
good error messages. Having written compilers for the world's largest compute
r company, I know
that error messages are usually saved for the end--hastily thrown in after th
e testing for ``getting it right''. As well, many different developers have w
ritten these error messages, so consistency is not likely.

One problem with the choice of teaching today's most popular professional pro
gramming language for INTRODUCTORY PROGRAMMING is that the software is design
ed for professionals. The message

syntax error

is often enough for a professional if it points to the offending line. What l
anguages like F and Pascal can offer is an increased probability that everybo
dy gets a chance to program--not just ``the smart kids''.

F_world
By the way, having designed F to be both simple and powerful, we were able to
design a tutor called F_world (currently available on the free Windows 95/NT
download) that walks a beginner through the writing and running of their fir
st program. [Note
that this version requires a password, which is in the README file.] Instead
of simply printing ``hello world'', which often takes pages of explanation in
introductory C, C++, and Java textbooks, the F_world program will add number
s until zero is
entered.

The F_world ``beginner'' program uses a program, a module, a subroutine, and
sixteen of the F statements. That's about half the number of statements in th
e entire F language!

I have personally watched dozens of beginners use F_world to write their firs
t F program in about 30 minutes. The longest it has taken was around 45 minut
es. About 75% get it right. The youngest F_world graduate was an eight year o
ld. He did it faster
than his parents.

Warning
Beginners have a better chance--programmers tend to start typing as soon as t
hey get a window, or the glance over the F_world directions and miss too many
steps (I have to give this warning as my customers are usually instructors o
r programmers and
they forgot what it was like to not know how to program.)

Java
Everybody I talk to is interested in teaching Java, but don't know how to sta
rt. F was designed the same time Java was designed. The similarities between
F and Java are amazing. The core design choice in each language is that proce
dures must be
encapsulated in some more powerful mechanism. In F, every function and subrou
tine must be in a ``module''. In Java, every method must be in a ``class''.

The two languages diverge when it comes to inheritance, but that is often not
taught in the first semester anyway. Indeed, the high school AP test uses a
subset of C++ and inheritance is one of the excluded features. F modules are
a wonderful tool for
teaching data encapsulation, and that appears to be a focus for the first sem
ester computer science class.

We have written an article, featured in 1997 September MacTech magazine, ``Th
e F Programming Language Tastes Like Java.'' Hardcopies of this article are a
vailable (send me email).

A Northern California university will be teaching a combination of F and Java
in their CS1 (introduction to computers) class this spring semester. We will
be sure to point to the results.

Conclusion
I make sure not to let the customer walk away thinking that F is just a toy l
anguage, only good for beginners. F is extremely powerful, particularly for n
umerical programs. I like to use F, however, for general applications. I wrot
e the front end of
the F compiler in 30,000 lines of F, on a 486 DX2/66 portable with 12 MBytes
of memory. Minimal changes were made to get this code to run on PC Linux, Uni
x, and Macintosh (from back-slash ``/'' to forward-slash ``/'' to colon ``:''
and a few others for
the Mac).

F is portable! F is compiled. I like to say, ``Runs efficiently everywhere''.

Imagine1 is actively looking for schools (all levels) interested in teaching
F. Be sure to contact us (info@fortran.com) for more information.


--
※ 来源:.南京大学小百合站 bbs.nju.edu.cn.[FROM: 172.16.66.171]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值