Most information here is in English. Only entries not relevant for the international audience are in Dutch.



 2005.03.25
How to Build a Better Mousetrap

This is a nice short article by Grace Pariante of Intuit that explains why the economic model of contemporary shrink wrap software encourages bad design.



 2005.03.09
Removing White Space from Source Code

Caffeinated wrote in Joel on Software:

After a brief discussion with the client's Lead Architect ("Every operator will have exactly *one* space before and after..."), I've realized something...

Source code should be devoid of any type of whitespace. No carriage returns, no spaces, no tabs.  It should be the job of the IDE to render the source as the developer sees fit.

Immediate benefits include smaller files, easier diffs, and an absence of trivial changes showing up in file compares. Of course, this means that file compare utilities will have to figure how to format and render source code.

Your thoughts?

I replied, after others proposed removal of spaces and using a prettifier purely for display:

I would fire you. No seriously. I do not want half-clever tools to mess with my carefully crafted layout automatically and without my consent.

There is only so much a prettifier can do. There is more spacing, than just the spaces in the left margin. Manual prettifying is essential for good maintainable code, although automatic prettifying can provide the first cut.

Storage overhead is a non-issue. Source code control and file diffing are, but hey, use a tool that removes duplicate spaces before running such tools.

You approached the problem exactly from the wrong end.

Son of Parnas replied:

>  I would fire you.

Your carefully crafted code must be really something to ruin someone's life over.

The idea that a program is just data and should be rendered according to a style sheet is an old one and valid one. It just hasn't been terribly practical until lately. I am not a big egoless programming fan, but a little less ego could be useful.

Me:

Style rules, company-wide, and egoless programming all appeal to me. We practice this in our company rigorously. From the source code alone here one cannot see who had written it. Everyone here is convinced that the style rules make sense. They have proven themselves over time, yet were always adapted when necessary.

Only too bad that automatic style sheets do not work. There is too much information in column wise mark-up. In reviews errors are discovered because lack of symmetry is easily spotted. Show me one tool that will take care of horizontal spacing in source code. I am not talking about simple indentation.

Automatic prettifying decreases the readibility of carefully crafted source code. That is any code that meets our style guide, not just my code written to my personal taste. Given this style guide, using a prettifier not only deteriorates code quality it also raises false alarms in source control and diffing. Break these rules too often and you are out.

So someone not agreeing with the style rules should either comply or explain why the other approach is better.

BTW another reason to use spaces in source code, even in places where it is not strictly necessary for the compiler, is that it can facilitate systematic searching with simple tools. Using unnecessary spaces, it is straightforward to search for all occurrences of object 'a' wihout getting too many false alarms.



 2005.03.08
The Battle between Archivists and Publishers

They live together in the same institution, the archivist and the publisher. Maintaining a historic archive and a content management system is too expensive, because all material then must be selected, filtered, classified, etc. twice. So from management there will be a strong push towards a single system. Who will win this battle? The archivist with his historically precise system based on format, or the publisher with his content management system based on the more malleable text? [complete article]



 2005.03.08
Duck typing

In comp.lang.eiffel Franck Arnaud noticed the following:

> The term was originally introduced by Dave Thomas, you can read his
> comments on it here:
http://www.rubygarden.org/ruby?DuckTyping

I note he does not explain why he needed to invent a new name
for structural subtyping!

I think Frank has a point. Dave should at least have mentioned the word structural typing and explain the difference. However, there is a difference between structural type equivalence and duck type equivalence. Duck type equivalence of two instances means that both instances accept the same method invocations. Whether these two instances are based on the same or similar classes is irrelevant. Structurally, these two instances can be completely different. Classes are only used for the construction in that they help to give instances a start set of methods. New methods can be added and old methods can be removed at runtime. Due to this dynamism, the structures (classes) that were used for declaration are largely irrelevant. Duck typing does not permit static typing.

Structural equivalence defines two types to be equivalent if they are constructed from the same classes in the same way. Typically, languages using structural equivalence do not allow dynamic adding or removing of methods. Therefore, knowing the structure is enough to determine whether an instance can be used as a valid actual parameter for a given formal parameter position. Contrary to duck typing, structural equivalence can be determined at compile time and, thus, programs are as far as this is concerned, type-safe.

Just to make things a little more scientific I think that duck-type equivalence should be called interfacial type equivalence. So we get these sorts of type equivalence:

  • nominal type equivalence (of two instances)
  • objective type conformance (of two instances)
  • structural type equivalence (of two types)
  • interfacial type equivalence (of two instances)

The name objective type conformance is my own mint, but the concept is familiar from many object-oriented programming languages: two instances are conforming if their types are nominally equivalent, or if the type of one instance is a class that inherits from the class that is the type of the other instance. Notice that objective type conformance is not a symmetric relation, hence the name conformance rather than equivalence. Since the relation is asymmetric, we also need special rules for LHS-s and RHS-s and covariance and contravariance. That complexity is not needed for the nominal, structural and interfacial type equivalences since these are completely symmetric. Although objective conformance is the most complicated in the list, it is also the most attractive one for most applications: it combines the aggressive type checking of nominal typing with the flexibility of structural typing.

The Carmen programming language that we are developing is an object-oriented language that uses objective type conformance.



 2005.03.07
Software Engineering Problems

Source of this drawing traced back to Mitch Denny's blog.



 2005.03.03
About three more or less esoteric programming languages

Lately, I have been reading a lot about programming languages. I do not want to withhold you from 2 nice aphorisms and one insight. Starting with the latter: reading about esoteric programming languages can be great fun, but see it as reading comics: it is a complete waste of time. That is what I thought about Whenever too, until I realised that this is a highly concurrent language which is by construction deadlock-free. Statements in Whenever are executed at some time in the future, or perhaps not at all, this at the system's discretion. The Holy Grail of concurrent programming found in the prank department of the department store! Now find a way to make sure that programs in Whenever terminate (-8

In comp.risks, Walter Dnes wrote these unforgettable words:

Perl used to be a "Practical Extraction and Reporting Language". Now it's
ballooned into something huge, requiring support libraries of its own.
Don't get me wrong, perl is an OK operating system, but it lacks a
lightweight scripting language.

And finally,

I Forth ♥



 2005.02.24
Dear Tech Support...


Recently I upgraded from Boyfriend 5.0 to Husband 1.0 and noticed that the new program began making unexpected changes to the flower and jewellery applications that operated flawlessly under Boyfriend 5.0. No mention of this phenomenon was included in the product brochure. In addition, Husband 1.0 uninstalls many other valuable programs such as DinnerDancing 7.5, CruiseShip 2.3, and OperaNight 6.1 and installs new, undesirable programs such as PokerNight 1.3, SaturdayFootball 5.0, Golf 2.4 and ClutterEverywhere 4.5. Conversation 8.0 no longer runs, and invariably crashes the system. Under no circumstances will it run NappyChanging 14.1 or HouseCleaning 2.6. I've tried running Nagging 5.3 to fix Husband 1.0, but this all purpose utility is of only limited effectiveness. Can you help?

Sincerely, XXX




Dear XXX:

This is a very common problem women complain about, but it is mostly due to a primary misconception. Many people upgrade from Boyfriend 5.0 to Husband 1.0 with no idea that Boyfriend 5.0 is merely an ENTERTAINMENT package. However, Husband 1.0 is an OPERATING SYSTEM and was designed by its creator to run as few applications as possible. Further, you cannot purge Husband 1.0 and return to Boyfriend 5.0, because Husband 1.0 is not designed to do this. Hidden operating files within your system would cause Boyfriend 5.0 to emulate Husband 1.0, so nothing is gained. It is impossible to uninstall, delete, or purge the program files from the system, once installed. Any new program files can only be installed once per year, as Husband 1.0 has severely limited memory. Error messages are common, and a normal part of Husband 1.0. In desperation to play some of their 'old time' favourite applications, or to get new applications to work, some women have tried to install Boyfriend 6.0, or Husband 2.0.

However, these women end up with more problems than encountered with Husband 1.0. Look in your manual under
'Warnings: Divorce/Child Support.' You will notice that this program runs very poorly, and comes bundled with HeartBreak 1.3. I recommend you keep Husband 1.0, and just learn the quirks of this strange and illogical system. Having Husband 1.0 installed myself, I might also suggest you read the entire section regarding General Partnership Faults [GPFs]. This is a wonderful feature of Husband 1.0, secretly installed by the parent company as an integral part of the operating system.

Husband 1.0 must assume ALL responsibility for ALL faults and problems, regardless of root cause. To activate this great feature enter the .......

command 'C:\ I THOUGHT YOU LOVED ME'. Sometimes Tears 6.2 must be run simultaneously while entering the command. Husband 1.0 should then run the applications Apologise 12.3 and Flowers/Chocolates 7.8.

TECH TIP! Avoid excessive use of this feature. Overuse can create additional and more serious GPFs, and ultimately YOU may have to give a' C:\ I APOLOGIZE ' command before the system will return to normal operations. Overuse can also cause Husband 1.0 to default to GrumpySilence 2.5, or worse yet, to Beer 6.0. Beer 6.0 is a very bad program that causes Husband 1.0 to create FatBelly files and SnoringLoudly wave files that are very hard to delete. Save yourself some trouble by following this tech tip! Just remember! The system will run smoothly, and take the blame for all GPFs, but because of this fine feature it can only intermittently run all the applications Boyfriend 5.0 ran. Husband 1.0 is a great program, but it does have limited memory and cannot learn new applications quickly.

Consider buying additional software to improve performance. I personally recommend HotFood 3.0, Lingerie 5.3 and Patience 10.1. Used in conjunction, these utilities can really help keep Husband 1.0 running smoothly. After several years of use, Husband 1.0 will become familiar and you will find many valuable embedded features such as FixBrokenThings 2.1, Snuggling 4.2 and BestFriend 7.6.

A final word of caution! Do NOT, under any circumstances, install Mother-In-Law 1.0.This is not a supported application, and will cause selective shutdown of the operating system. Husband 1.0 will run only Fishing 9.4, Golf6.1 and PubCrawl 5.2 until MotherInLaw 1.0 is uninstalled.

I hope these notes have helped. Thank you for choosing to install Husband 1.0 and we here at Tech Support wish you the best of luck in coming years.

We trust you will learn to fully enjoy this product!



 2005.02.23
lingua romana perligata

  MAXIMUM INQUEMENTUM TUM BIGUTTAM EGRESSO SCRIBE.
  MEO MAXIMO VESTIBULO PERLEGAMENTUM DA.
  DA DUO TUM MAXIMUM CONSCRIBEMENTA MEIS LISTIS.

  DUM LISTIS DECAPITAMENTUM DAMENTUM NEXTO
     FAC SIC
        NEXTUM TUM NOVUMVERSUM SCRIBE EGRESSO.
        LISTA SIC HOC RECIDEMENTUM NEXTUM CIS VANNEMENTA DA LISTIS.
     CIS.

This is not shouting, this is Latin.

This is the sieve of Eratosthenes in Lingua::Romana::Perligata. Perligata is in my opinion one of the most beautiful esoteric programming languages ever invented. Granted, nothing in Perligata is simpler than its successor of 2000 years Perl, but still. The base lingua for this programming language is not English, as is usual, but Latin. Parameters are not passed by position but by inflexion. Suffices indicate role, number, etc. Numerals are Roman, obviously. No punctuation, only the period, like in Latin. Everything that made Latin a weird language from the perspective of modern languages, is used in Perligata, including conjugations. Since Romans only had capitals, I took the freedom to convert from lower case to upper case. This is the same program in standard Perl:

  print STDOUT 'maximum:';
  my $maxim = <STDIN>;
  my (@list) = (2..$maxim);

  while ($next = shift @list)
     {
        print STDOUT $next, "\n";
        @list = grep { $_ % $next} @list;
     }



 2005.02.18
Very large urban display devices

  

In Paris you can play Pacman or Pong with your mobile telephone using the facade of the Bibliothèque Nationale as your display device! Computer-controlled lamps in the offices act as pixels. Add a few colored lamps in every office, and you have the biggest color display device in the world. This building hints in that direction.



 2005.02.15
Een nieuwe komputer aanschaffen

Tegenwoordig is het heel eenvoudig iemand te adviseren de juiste PC aan te schaffen. Het Internet is de grote gelijkmaker. Platformkeuzes van tien jaar geleden bestaan nauwelijks nog. Daarnaast dalen de prijzen zo hard dat het loont om meerder machines te hebben die gespecialiseerd in specifieke taken. [complete article]



 2005.02.14
Vierde artikel met beveiligingstips

Dit is het vierde en voorlopig laatste artikel over beveiliging van Windows PCs. Dit keer gaat het over de eerste installatie van de machine. Eerdere artikelen gingen over spam, hoaxes en wachtwoorden, over patching en veilig gebruik van accounts en over virussen.



 2005.02.10
Aan de Jonge Doctor,

Misschien een aardige stelling voor u tijdens het volgende familie-diner, met naar ik aanneem, nog meer buitengewoon doctorabele familieleden:

 
Stelling: Dat je een keer tegen een dikke boom heb gepist op een warme dag, maakt nog niet dat je verstand hebt van het tropisch regenwoud.
 



 2005.02.03
Picking the right implementation language and target language for a compiler project

Things you may need in a compiler: string manipulation, graph manipulation, garbage collection, reference formantics, recursion, associative arrays, hashing,...

Other things to take into account:

  • if you plan to bootstrap, take an implementation language that resembles your source language from the beginning (if it is a reasonable choice), otherwise you will have to write a lot of code more than once
  • search for compiler generators and libraries you may have to use. This can limit your choices for the implementation language
  • writing a professional compiler is a lot of work, so take an implementation language that was designed for programming in the large
  • take an implementation language that is good in string manipulations and graph manipulations. Remember that writing the parser is the trivial part
  • take the same language for implementation language and target language; this makes it possible to use your libraries in both the implementation code of the compiler and in the language environment
  • if it is within your power: take a target language that resembles the source language so that fewer formantic conversions are needed during the compilation
  • take a target language that is lower level than the source language; otherwise the code generator has to make a lot of dangerous assumptions due to the missing information

Careful readers will have noticed that I suggested:

  • source language ~= implementation language (facilitates bootstrapping)
  • implementation language = target language (facilitates dual purpose use of packages)
  • source language ~= target language (allows work reduction)

Obviously in the ideal case, your source language is identical to your target language, making the implementation language irrelevant (-8.

A good choice: take the same language for targeting and implementation, and take for this a language that formantically resembles your source language.

In this context: do never underestimate the formantic differences between languages that have syntactic similarities and v.v. E.g. although Java looks like C due to the curly braces, it is much closer to Pascal than C.



 2005.02.03
What is the meaning of semantics?

Semantics is a branch of semiotics, the study of signs. Other well-known branches are syntactics (the study of form) and pragmatics (the study of intentions of signs, or rather of their utterers). There are four other branches in Stamper's semiotic framework.

What people in computer science commmonly refer to as semantics is not dealing with the meaning of signs, but how a sign (e.g. a computer program or data structure) relates to other computer programs or data structures. For example, two data structures can be semantically equivalent, or a syntactically well-formed program can violate a semantic constraint which makes the program equivalent to the halt-program.

Although this is commonly referred to as semantics, this is in fact a sub-branch of syntactics, named 'formal semantics' (sic). In my research in this area I minted, the term 'formantics' to end this confusion.

However, in some areas of computing people indeed are referring to the meaning of signs by relating them to the outside world. Think of semantic nets and semantic modelling for databases. This is semantics proper.

More on this subject in my blog of 2004.04.23 at http://www.hello.nl/blogs/2004Q2.html.



All my blogs: