Download EPUB

(Medium) The Role Of Affordance In Software Design

Gist 1 min read Original article

This article is too short to generate a summary.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters

// This is the Soldier API
class Soldier {
equipShootingGun(shootingGun) {
this.shootingGun = shootingGun;
}
equipWhiteGun(whiteGun) {
this.whiteGun = whiteGun;
}
stab(target) {
// This doesn't look quite right
shootingWeapon.shoot(target);
}
}
// ...
// This is the Soldier client
const mary = new Soldier();
mary.equipShootingGun(new handGun());
mary.equipWhiteGun(new Knife());
mary.stab(new Soldier()); // Shootin... wait!

Report this article

Keep this one

14 days free, no card. Then $60 a year ($5 a month, billed yearly) or $10 a month.

Your saves stay readable and exportable, even if you stop paying.