Tag Archives: link

Link: DRY vs Write Explicit Tests

DRY vs WET | Arlo Being Bloody StupidWrite Explicit Tests – Following WET just asks “What is each test attempting to say? How could we say that most clearly?” An awesome example on re-writing a test into a much, much better one. It also demonstrates well that writing a good test is an iterative and challenging task – but the result is absolutely worth the effort.

Link: Refactoring to an Adaptive Model – Martin Fowler

Martin Fowler’s Refactoring to an Adaptive Model, 11/2015 – replacing imperative logic with a declarative one, with rules encoded in JSON so that they can easily be shared across platforms and updated without re-installation. A few other nice refactoring points too.

Most of our software logic is written in our programming languages, these give us the best environment to write and evolve such logic. But there are circumstances when it’s useful to move that logic into a data structure that our imperative code can interpret – what I refer to as an adaptive model. Here I’ll show some product selection logic in JavaScript and show how it can be refactored to a simple production rule system encoded in JSON. This JSON data allows us to share this selection logic between devices using different programming languages and to update this logic without updating the code on these devices.

Link: The madness of layered architecture

Johannes Brodwall: The madness of layered architecture – a nice critique of over-designed “enterprise” apps, why that is a problem (SRP, cost of code, unclear where to do a change, ….), why it is different from the successful layered network stack of Ethernet/IP/TCP/… (because in an app, all layers are on the same level of abstraction); bottom line: do not add a layer unless you have a really good reason (hint: the advice of a consultant/speaker does not count as one)

Improve This: Twitter Streaming And Transformation in JS (link)

In improve this we take a look at a reader submitted test, user interface, story or block of code and we try and improve it, without context, explaining what we did as we went.

In this issue, Mike sent a link to an event source to a realtime social media visualization.

Read the full original post.

Highlights: use of JSLint and JSHint, removal of unnecessary dependencies, nested callbacks, testing, refactoring  to split by responsibilities, … .