Skip to content

Comment on Grace Hopper and UNIVACparent

Comments

Well, I wasn't suggesting it as a universal law because obviously some programmers don't work for pointy haired bosses. Some work for themselves and others for another programmer...and what programmer thinks Cobol is so cool they would use it by choice?

In the life cycle of a significant program, which is more important how easily it was initially written, or how easily it can be read and understood over the years?

Because no one can write write a self-documenting Regex, Regex's are only easier to write because any need to document programs is ignored. The extension of this practice is an argument is that code should not contain a lot of comments because comments tend not to be maintained. As Larry Wall noted, Laziness, Hubris, and Impatience all play their role - He being the person responsible for a language so obfuscating as to garner a reputation for author's being unable to understand their own programs {heavy on Regex a coincidence or correlation?}

As Perlis said "It is easier to write an incorrect program than understand a correct one." Particularly if the language makes it harder to read the correct program and speeds up the process of writing the incorrect one. Flomatic and Cobol are verbose for exactly the same reason that some programming languages have static type systems and nobody really takes claims about their verbosity seriously because we recognize the tradeoff of keystrokes for clarity.

Hopper was a Naval officer. She took programming seriously and she understood human nature. They're both reflected in her approach to programming languages. She realized that people can die if a program on the fire control computer is incorrect and a 16" artillery shell falls short onto friendlies or long onto a maternity ward. Nothing promotes the importance of clear communication for robustness like combat - as in civilian life you never know who might be dead or retired or reassigned when the code needs to change.

BTW, I was being a bit tongue in cheek. On the other hand, programmers have been known to use obfuscation as a means for protecting their jobs, and bosses being able to read code is the primary argument for using technical people as managers rather than those with general experience as managers. Programmers are no less immune from creating fiefdoms than anyone else.

Actually I don't accept your premise that a wordy, English-like language is easier to read. Code must be both comfortable to read & write (i.e., elegant). If we assume our reader knows both language A & B, then 1 line in language A is definitely easier to read than the equivalent 10 lines in language B. Just because language B looks more familiar does not mean the precise semantics come across better. A small set of keywords is easier to fit in your head. Furthermore, in the more verbose language you are forced to spend energy that could also be spent in thinking about whether the code is correct.

Regular expressions can be properly documented in a multiline style with comments etc. For a non-trivial regular expression, the previous example holds: converting the regular expression to a sequence of if-else statements would easily take 10x the number of lines. On top of that, regular expressions are implemented efficiently. That said, I do believe comments are necessary and don't think Perl is a good language to use.

The argument about static typing and verbosity is moot, because static typing does not have to be manifest typing, since type inference can provide the advantages of static typing without the verbosity.

Regarding taking programming seriously, I don't believe that has very much to do with the language, but rather with the software engineering process, cf. http://www.fastcompany.com/28121/they-write-right-stuff

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.