Hacker News new | ask | show | jobs
by wingo 4958 days ago
An interesting perspective here:

"MCNP is written in the style of Dr. Thomas N. K. Godfrey, the principal MCNP programmer from 1975-1989 ... All variables local to a routine are no more than two characters in length, and all COMMON variables are between three and six characters in length ... The principal characteristic of Tom Godfrey's style is its terseness. Everything is accomplished in as few lines of code as possible. Thus MCNP does more than some other codes that are more than ten times larger. It was Godfrey's philosophy that anyone can understand code at the highest level by making a flow chart and anyone can understand code at the lowest level (one FORTRAN line); it is the intermediate level that is most difficult. Consequently, by using a terse programming style, subroutines could fit within a few pages and be most easily understood. Tom Godfrey's style is clearly counter to modern computer science programming philosophies, but it has served MCNP well and is preserved to provide stylistic consistency throughout."

This from MCNP4c chapter 2, section B, quoted here: http://wingolog.org/archives/2005/04/09/101. Alas, the link in that article is dead.

FWIW, I neither agree nor disagree with Godfrey's style.

1 comments

Here's the whole book that that article quotes: http://public.gettysburg.edu/~bcrawfor/physics/nnscat/C700.P... (~10MB)

And an earlier edition with the same quote: http://mightylib.mit.edu/Student%20Materials/books/mcnp4b.pd... (~5MB)