(Web/View) Components: Should everything be a component?

An article, posted 7 months ago filed in components, design system, structure, todo, programming, development, front-end & html.

Recently I was reviewing a merge request of some front-end code, and a simple div, that changed a bit of the custom appearance of a block of text through a few custom classes, was changed in a call to a view component that then applied the same classes, passed onto the component through a more deeply nested hash.

> -
> + ’itis ](https://en.wiktionary.org/wiki/divitis) you get ‘TextComponent’-itis.. we don’t add better semantic or structural information to the page layout

Instead?

Keep the code as is. And perhaps create a ticket (or annotate it with TODO:) that you perhaps want to extract this ‘custom-class’ call into a true reusable component. While I don’t think there is something inherently bad with offering the option to override or add some custom classes to a component, a component should only be used if it adds structural meaning either from the developer's side of things or (better) from the consumer’s side of things (e.g. semantic output that can be p…

Continue reading...

Computer says yes

An article, posted more than 11 years ago filed in test, programming, fail, software, structure, testen, computer, little britain, computer says no, controle & unittesting.

Al weer 7 jaar geleden liet Robert Dijkgraaf in Zomergasten zien hoe alles weer uit van alles bestaat. Kleine onderdelen die samen weer grotere gehelen vormen die samen weer nog grotere gehelen vormen en zo verder, en terug. Hij illustreerde dit aan de hand van een alweer 30 jaar oud filmpje: powers of 10.

Powers of 10: Van 100 tot 1024 naar 10-14

Op hun eigen schaal lijken alle onderdelen waaruit iets bestaat weer mooie afgeronde dingen. En op een afstand lijken al deze onderdelen ook nog eens perfect samen te hangen.

Integrated Circuit (public domain image)

Ook in ontworpen zaken zie je dergelijke herhaling en samenhang. Een chip lijkt in detail wel een metropool. En de printplaat waarop deze bevestigd zit eveneens. En in een echte metropool bevinden zi…

Continue reading...

murb blog