Just a quick post assuring you, gentle reader, that I’m still here, that I’m very busy, and that posting will resume in the near – albeit unspecified – future.
Just a quick post assuring you, gentle reader, that I’m still here, that I’m very busy, and that posting will resume in the near – albeit unspecified – future.
Posted by Rafael Fischmann:
Rainer Brockerhoff wrote:
We’re back. Will post details and photos as soon as everything gets sorted out.
Late happy birthday!!
Just noticed my blogroll (the list of links to your left) was somewhat out of date; now it isn’t.
These are most of the links I look at daily… now that I resolved to do this only once per day, I find I spend less time each day in the NetNewsWire time sink.
The J-Walk Blog points (among the usual cornucopia) at one of the articles at Sentient Development, namely the one about Fundamentalism:
Imagine that you’re a psychiatrist. A new patient comes to see you and says that he regularly talks to an invisible being who never responds, that he reads excerpts from one ancient book and that he believes wholeheartedly that its contents must be accepted implicitly, if not taken literally.
The patient goes on to say that that the world is only 6,000 years old and that dinosaurs never existed. He brazenly rejects modern science’s observations and conclusions, and subscribes to the notion that after death he will live in eternal bliss in some alternate dimension. And throughout your meeting, he keeps handing you his book and urging you to join him, lest you end up after death in a far less desirable alternate dimension than him…
This ties in with some other things I’ve noticed recently; Italian scientists are acting against an attempt to ban teaching of evolution in schools, and believe it or not, there’s a creationist theme park in Florida…
On another topic, Dave Pollard has again written some impressive stuff, if you’re not familiar with his weblog I recommend the recent Avoiding the Landmines in Entrepreneurial Business and The Stock Market as Ponzi Scheme, to cite just a couple. Highly recommended.
Rael Dornfest points out this article:
If you think all ”hackers” are computer criminals, think again: A new generation is reclaiming a creative, do-it-yourself approach to everything from home electronics to home improvements.
…The spread of hacker culture is very much related to the spread of technology, which now pervades almost every aspect of life. Among techsters, hackers are the good guys, as opposed to the malevolent cybercriminals to whom they refer as ”crackers.”
…Said (Rael) Dornfest: ”The difference between a hacker and consumer is a consumer says, ‘I wish it would work this way.’ A hacker says, ‘I’ve got a screwdriver and a few minutes.’ “
Well worth the read.
Needless to say, I’m solidly behind this definition, being a screwdriver/soldering iron/whatnot-wielding practitioner since early childhood.
Traditionally the first program one sees or writes in a new computer language is the “Hello, world” program: a simple program that simply prints out, or sends, or extrudes, the string “Hello, world” through the most convenient interface. For instance, in PHP this would look like:
<?php echo "Hello, world"; ?>
For contrast, check out this cautionary counterexample of writing a “Hello, world” program using POSA (Pattern-Oriented Software Architecture):
<?php
/********************************************************************
Model-View-Controller implementation according to POSA
(Pattern-Oriented Software Architecture
http://www.hillside.net/patterns/books/Siemens/book.html)
********************************************************************/
class HelloWorldController {
private $model;
function __construct($model) {
$this->model = $model;
}
function handleEvent($args) {
$this->model->setStrategy($args[2]);
$this->model->addText($args[1]);
}
}
class HelloWorldModel {
private $text;
private $observers = array();
private $strategy;
function attach($observer) {
$this->observers[] = $observer;
}
function getData() {
$facade = new HelloWorldFacade($this->strategy);
return $facade->getHelloWorld().$this->text."\n";
}
function addText($text='') {
$this->text = $text;
$this->notify();
}
function setStrategy($strategy) {
$this->strategy = $strategy;
}
function notify() {
foreach ($this->observers as $observer) {
$observer->update();
}
}
}
class HelloWorldView {
private $model;
function initialize($model) {
$this->model = $model;
$model->attach($this);
return $this->makeController();
}
function makeController() {
return new HelloWorldController($this->model);
}
function update() {
$this->display();
}
function display() {
echo $this->model->getData();
}
}
/*********************************************************************
"Business logic"
********************************************************************/
class HelloWorld {
function execute() {
return "Hello world";
}
}
class HelloWorldDecorator {
private $helloworld;
function __construct($helloworld) {
$this->helloworld = $helloworld;
}
function execute() {
return $this->helloworld->execute();
}
}
abstract class HelloWorldEmphasisStrategy {
abstract function emphasize($string);
}
class HelloWorldBangEmphasisStrategy extends HelloWorldEmphasisStrategy {
function emphasize($string) {
return $string."!";
}
}
class HelloWorldRepetitionEmphasisStrategy extends HelloWorldEmphasisStrategy {
function emphasize($string) {
return $string." and ".$string." again";
}
}
class HelloWorldEmphasizer extends HelloWorldDecorator {
private $strategy;
function HelloWorldEmphasizer($helloworld,$strategy) {
$this->strategy = $strategy;
parent::__construct($helloworld);
}
function execute() {
$string = parent::execute();
return $this->strategy->emphasize($string);
}
}
class HelloWorldStrategyFactory {
static function make($type) {
if ($type == 'repetition') return self::makeRepetitionStrategy();
return self::makeBangStrategy();
}
static function makeBangStrategy() {
return new HelloWorldBangEmphasisStrategy;
}
static function makeRepetitionStrategy() {
return new HelloWorldRepetitionEmphasisStrategy;
}
}
class HelloWorldFormatter extends HelloWorldDecorator {
function execute() {
$string = parent::execute();
return $string."\n";
}
}
class HelloWorldFacade {
private $strategy;
function __construct($strategyType) {
$this->strategy = HelloWorldStrategyFactory::make($strategyType);
}
function getHelloWorld() {
$formatter = new HelloWorldFormatter(
new HelloWorldEmphasizer(
new HelloWorld,$this->strategy));
return $formatter->execute();
}
}
$model = new HelloWorldModel;
$view = new HelloWorldView;
$controller = $view->initialize($model);
$controller->handleEvent($_SERVER['argv']);
?>
I couldn’t resist quoting the whole code. The sharp-eyed observer will notice that the actual string is generated at the beginning of the “business logic” part and the rest is just handwaving. This quote from the author is also irresistible:
…And the program works. In spite of its deadness, it executes and produces a result. You might say it’s like one of those severed frog’s legs that twitch when you apply current.
This reminds me of a program I had occasion to look over recently; a friend wrote it as his final assignment for Java certification.
It exhibited all of the same symptoms: elegant formatting; repetition of dozens of function with slight variations in names and one or two lines in the body; frequent referral to buzzwords like model, controller, strategy, and so forth; complete obscurity of actual function. Indeed, I can’t recall what its ostensive purpose was, beyond making sure that the examiner understood that the writer had a thorough grasp of orthodox design patterns.
Space precludes going into details now, expect a longer rant later about the subject… 😉
I should have known better than returning to Theodore Gray‘s site when I had other things to do. This is a huge time sink; be careful!
Gray is co-founder of Wolfram Research, best known as the makers of Mathematica. He is the author of several books and is well-known for his amazing Periodic Table Table, for which he won the 2002 IgNobel Prize in Chemistry. As an old-time fan of the periodic table of elements, I was enchanted with the photos and stories about each element. I carried a small periodic table in my pocket all through secondary school and had it pretty well memorized at one time; before discovering computers I even considered working in chemistry.
There are movies and even sound samples, as well as interesting stories such as this visit from Oliver Sacks, one of my favorite authors. Highly recommended; make sure you’re prepared to stay glued to your computer for several hours.
The folks at the fascinating Language Log pointed out a Circolwyrde Wordhord (Old English Computer Glossary):
This glossary, which complements several printed sources of its kind, is intended for Anglo-Saxonists and other speakers of English for whom the language of the computer world has become alien and largely incomprehensible.
We learn, for instance, that a white-hat hacker is a searocræftiga, while a malicious hacker can be a feondsceaða, atorwyrht or even an inwitgæst. No doubt this will be very useful for any scholar who regularly sits at a weorcstede (workstation), exchanges hrædærendgewrit (e-mail), or needs to look at some oftgeacsunge (FAQ) on the woruldwidewebb. Not to speak of cneomæglicgifhordonweald (relational database management) problems, of course. Hm.