Languages Humour


Quick Reference


God is a Structured Programmer?

For many years molecular biologists have been mystified by the fact that very little of an organism's DNA seems to serve any useful function.

I have solved the mystery.

The reason why only 30% of human DNA performs any useful function is that the rest of it is comments.

Once we decode a typical human genome, we see that the contents begin as follows:


/* HUMAN_DNA.H
 *
 * Human Genome
 * Version 2.1
 *
 * (C) God
 */

/* Revision history:
 *
 * 0000-00-01 00:00  1.0  Adam.
 * 0000-00-02 01:00  1.1  Eve.
 * 0000-00-03 02:11  1.2  Added penis code to male version. A bit messy --
 *                        will require a rewrite later on to make it neater.
 * 0017-03-12 03:14  1.3  Added extra sex drive to male.h; took code from
 *                        elephant-dna.c
 * 0145-10-03 01:33  1.4  Removed tail.
 * 1115-00-31 23:20  1.5  Shortened forearms, expanded brain case.
 * 2091-08-20 14:56  1.6  Opposable thumbs added to hand() routine.
 * 2501-04-09 19:04  1.7  Minor cosmetic improvements -- skin colour made
 *                        darker to match my own image.
 * 2909-07-12 02:21  1.8  Dentition inadequate; added extra 'wisdom' teeth.
 *                        Must remember to make mouth bigger to compensate.
 * 4501-12-31 12:18  1.9  Increase average height.
 * 5533-02-12 13:09  2.0  Added gay option, triggered by high population
 *                        density, to try and slow the overpopulation problem.
 * 6004-11-04 19:11  2.1  Made forefinger narrower to fit hole in centre of
 *                        CD.
 */

/* Standard definitions
 */

#define SEX male
#define HEIGHT 1.84
#define MASS 68
#define RACE caucasian

/* Include inherited traits from parent DNA files.
*
* Files must be pre-processed with MENDEL program to provide proper
* inheritance features.
*/

#include "mother.h"
#include "father.h"

#infndef FATHER
#warn("Father unknown -- guessing\n")
#include "bastard.h"
#endif

/* Set up sex-specific functions and variables
 */
#include "sex.h"

/* Kludged code -- I'll re-design this lot and re-write it as a proper
 * library sometime soon.
 */
struct genitals{
#ifdef MALE
   Penis *jt;
#endif
/* G_spot *g;   Removed for debugging purposes */
#ifdef FEMALE
Vagina *p;
#endif
}

/* Initialization bootstrap routine -- called before DNA duplication.
 * Allocates buffers and sets up protein file pointers
 */
DNA *zygote_initialize(Sperm *, Ovum *);

/* MAIN INITIALIZATION CODE
 *
 * Returns structures containing pre-processed phenotypes for the organism
 * to display at birth.
 *
 * Will be improved later to make output less ugly.
 */
Characteristic *lookup_phenotype(Identifier *i);

How to Determine Which Programming Language You're Using

The proliferation of modern programming languages which seem to have stolen countless features from each other sometimes makes it difficult to remember which language you're using. This guide is offered as a public service to help programmers in such dilemmas.

Of course this article does not represent my employers in any way!
--
Duncan Gibson, ESTEC/YCV, Postbus 299, 2200AG Noordwijk, The Netherlands
Preferred email: duncan@yc.estec.esa.nl or ...!sun4nl!esatst!duncan
Desperate email: dgibson@estec.esa.nl or dgibson@ESTEC.BITNET


Quiche Eaters Test

I daresay a number of you have seen or taken the 'Hackers Test': Well, in reply we'd like to post the 'Quiche Eaters Test'. Questions by Mark Harrison, and Pete Bevin....

Scores: Score 1 for every 'Yes': The mark is your Quiche-% Non-deterministic questions: Resolve non-determinism ad lib.

  1. Have you ever programmed in Orwell?
  2. ... in Modula-2?
  3. ... in Dijkstra's Language of guarded commands?
  4. Have you ever specified a program?
  5. Have you ever proved a program correct?
  6. Have you ever derived a program?
  7. Did it work first time?
  8. Did it ever work?
  9. Have you ever used language pre-processors such as Ratfor?
  10. Have you ever used Emacs?
  11. Is it your favourite editor?
  12. Do you use a windows environment?
  13. Does it have a pretty background?
  14. Have you ever done a practical?
  15. On time?
  16. Have you ever set a practical?
  17. Do you use a font more than 10 points high?
  18. Have you ever written a 'Towers of Hanoi' program?
  19. Was it less than 5 lines long?
  20. Did you time it for various n?
  21. Did the timings match your efficiency analysis?
  22. Does the thought of plain TeX horrify you?
  23. Have you read any Knuth?
  24. Do you own Knuth's "The Art of Computer Programming"?
  25. Have you done any of the exercises?
  26. Have you read 'Programming from Specifications'?
  27. Did you enjoy it?
  28. Do you take 6 letters to spell 'people'?
  29. Do you own any 'Business software'?
  30. Did you pay for it?
  31. Does the thought of solder horrify you?
  32. Have you ever read a CACM paper?
  33. Have you ever written a CACM paper?
  34. Do you read 'Program Now'?
  35. Do you subscribe to 'Program Now'?
  36. Do you consider the Usenet Oracle a waste of bandwidth?
  37. Do you use it anyway?
  38. Have you ever tried to prove NP=P?
  39. Did you succeed?
  40. Would you prefer a VGA-386 to a mono SPARC?
  41. Do you use DWIM?
  42. Do you have a cheese plant?
  43. Is it called Dijkstra (or similar)?
  44. Do you name your booths numerically?
  45. Do you serve on any committees?
  46. Were you elected?
  47. Are you allowed to meet clients?
  48. Did you understand q47 first time?
  49. Do you prefer ground coffee to machine coffee?
  50. Do you sleep at nights?
  51. Every night?
  52. Can you focus on 3-d objects?
  53. Do you think streamers are found at parties?
  54. Do you sit down at parties?
  55. Does everyone else?
  56. Do you own or have use of a Fax machine?
  57. Do you use a DTP?
  58. Have you ever produced a magazine?
  59. Did anyone buy it?
  60. Have you ever programmed a neural network?
  61. Did you think the last question was phrased wrongly?
  62. Do you read Sci-Fi?
  63. Do you know why HAL is called HAL?
  64. Do you beleive Arthur C. Clarke's denial?
  65. Have you met Edsger, Tony or Don?
  66. Have you met Niklaus?
  67. Can you tell one of his jokes?
  68. Do you think it's funny?
  69. Do you consider GOTO's harmful?
  70. Do you prefer recursion to iteration?
  71. Does your first name sound like a girl's, e.g. Carol?
  72. Do you want to do research?
  73. Have you ever done research?
  74. Have you ever written a computer language?
  75. Did it work?
  76. Was it impractically slow, but educational anyway?
  77. Do you refer to 'How computer programming used to be done'?
  78. Even when it's still done that way by 90% of industry?
  79. Do you view computing as a branch of mathematics?
  80. Of pure mathematics?
  81. Do you consider the insistence on results to be a problem with industry?
  82. Do you use your system clock to tell the time?
  83. Do you expect it to be right?
  84. Do you complain to the sysadmin when it's wrong?
  85. Do you consider brackets to be archaic as a method for providing structure?
  86. Do you know what referential transparency is?
  87. Do you understand Lambda expressions?
  88. Can you 'do' Lambda Calculus?
  89. Do you see it as part of your 'Cultural heritage'?
  90. Do you feel that computer terminology is too anthropomorphic?
  91. Did you understand the last question right away?
  92. Would you prefer to reason about a rayshader than run it?
  93. Do you consider rayshaders a frivolous waste of time?
  94. Do you consider colour a frivolous waste of time?
  95. Is black-and-white typesetting the only valid use of paper?
  96. Do you keep your appointments on computer?
  97. In Emacs Diary/Calendar?
  98. Do you keep your appointments?
  99. Do you wish you could do computation without having to touch a computer?
  100. Do you like quiche?

Scores mailed to me?.........

Mark


The Perl 5 Commandments

Original by Adrian Hilton
  1. Thou shalt run perl with the -w switch and 'use strict', that thy typos and cock-ups shall be caught, and thou shalt pay close attention to what it tells thou, yea even though thy program may appear to run normally.
  2. Thou shalt check the result of 'open' and do something intelligent if it fails, for Unix is a capricious system and thy file may not be there when you expect it.
  3. Thou shalt give serious consideration for doing the same thing for 'close' as strange and terrible things beyond the ken of man or woman may occur in the filesystem.
  4. Thou shalt use my() to declare thy variables in thy subroutines, for the notion of lexical scope was given to thee for a darn good reason.
  5. Thou shalt stay well clear of local() unless thou understandeth the subtle and many consequences of dynamic scoping.
  6. Thou shalt not tie thy scripts to one operating system without good cause. Remember that the world has a bounty of good operating systems, yea even some quite dire ones, and thy scripts may be required on some other platform in the distant future.
  7. Thou shalt not use GOTO; just because it has been given to thee does not mean that it is considered a Good Thing to Use.
  8. If thou cannot work out how to do something with perl, thou shalt consult the man(1) pages because they are there for a reason and thou canst use the '/' command to seek thy information.
  9. Thou shalt take advantage of the generosity of Wall and Schwarz in providing long variable names, and shalt name thy variables meaningfully that no hours will be wasted trying to understand thy code.
  10. Thou shalt use associative arrays whereever possible because they are the salt and light of perl. If thou dost not comprehend their methods, thou shalt RTFM.
  11. Thou shalt comment thy code wheresoever possible, for even if thou can understand what it does, it may not be Intuitively Obvious to many others. This is especially true if thou is fond of using obscure regexps.
  12. Thou shalt consider the m! ! alternative to //, especially when matching Unix pathnames, for backslashing is a grievous ugliness in perl's eyes.
  13. Thou shalt group thy constants in one place, easily accessible; it is a terrible burden on one's soul to trawl through your code looking for a constant which may be in error.
  14. Thou shalt provide helpful output to thy users when the -h or -help switches are supplied to thy program, for great is the turmoil in one's mind when one tries to remember the correct order of arguments.
  15. Thou shalt mediate upon thy regexps and consider all possible cases, that thy frustration may be minimised upon unexpected input.
  16. Thou shalt anchor thy regexps wheresoever possible, that thy regexp matching algorithm shalt not be required to count the atoms of the Universe before returning to thou an answer.
  17. Thou shalt program generally with a healthy paranoia of what the user may do.
  18. The comp.lang.perl.* newsgroups have been provided for thy edification and enlightenment. Read thou and learn. Pay particular attention to the koans of the gurus, for they have learned their craft along a long and arduous road.
  19. These newsgroups are a temptation to ignore the manual and post a question. Be thou aware that this is asking for a flaming. Read the FAQ and be thou mindful that they will not do thy work for you.
  20. Thou shalt not slurp up a file into an array by evaluating its handle in an array context, as it is Poor Practice and not easily distinguished from a Big Mistake.
  21. Thou shalt not make gratuitous use of $_ and @_ unless thou really knoweth what thou art doing.
  22. Thou shalt save pattern matches immediately after regexps as thou never knoweth when another regexp will pop up out of the woodwork.
  23. Thou shalt consider the notion of encapsulation and use subroutines wheresoever plausible. If thy subroutine is more than a couple of blocks long, thou shalt think hard about splitting it in two.
  24. Thou shalt hark back to commandment 11, for verily I am not kidding about comments.
  25. Thou shall especially ensure that the main code block reads like a book, for it is at the start of a file that a programmer new to thy code will begin to read.
  26. Thou shalt use the standard bracketing to please thy co-workers and ensure that time is not wasted re-formatting thy code.
  27. Thou shalt use array and hash references to store lists of lists, for surely an indexing scheme that useth split() and join() causeth much nausea to thy better-informed colleagues.
  28. Thou shalt NOT REINVENT THE SMEGGING WHEEL, and shalt consult CPAN to see if an older and wiser guru hath already written a module to do the work for thou.

Perl Aphorisms

Most important, you don't have to know everything there is to know about Perl before you can write useful programs. You can learn Perl "small end first". You can program in Perl Baby-Talk, and we promise not to laugh. Or more precisely, we promise not to laugh any more than we'd giggle at a child's creative way of putting things. Many of the ideas in Perl are borrowed from natural language, and one of the best ideas is that it's okay to use a subset of the language as long as you get your point across. Any level of language proficiency is acceptable in Perl culture. We won't send the language police after you. A Perl script is "correct" if it gets the job done before your boss fires you.

Larry Wall.


SUN MICROSYSTEMS SUES ISLAND OF JAVA*

Mountain View, CA -- Sun Microsystems today filed a trademark infringement against the island of Java* over the use of Sun's Java* trademark.

Responding to criticism that the island has been called Java* for centuries, Sun lawyer Frank Cheatham said "Yeah, and in all that time they never filed for a trademark. They deserve to lose the name."

Rather than pay the licensing fee, the island decided to change its name. They originally voted to change it to Visu Albasic, but an angry telegram from Redmond, Washington convinced them otherwise. The country finally settled on a symbol for a name -- a neatly-colored coffee cup which still evokes the idea of java. Since most newspapers and magazines will not be able to print the name of the island, it will hereafter be referred to in print as "The Island Formerly Known As Java*".

The Island Formerly Known As Java* bills itself as a cross-landmass island, but so far has only been implemented in production on the Malay Archipelago. Africa is been rumored to have implemented it on Madagascar, but it is still in alpha testing.

Lawyers from Sun would also like to locate the owners of the huge fiery ball at the center of the solar system. They have some legal papers for them..


Return to Languages index


Web pages maintained by Adrian Hilton