Quantcast
Channel: XPlorations Archives - XP123
Browsing all 118 articles
Browse latest View live

Image may be NSFW.
Clik here to view.

Incremental Design with Standards-Based Products

Products supporting standards have an all-or-nothing flavor. After all, who wants a compiler for only half of a programming language? We’ll look at guidelines that let you develop such products...

View Article


Semantics of FOR-NEXT Loops

I’ve been implementing the FOR-NEXT loop in a BASIC interpreter I’m building. It brings up some issues of programming language semantics. 10 FOR X = e1 TO e2 [STEP e3] 20 -- body 30 NEXT X...

View Article


Image may be NSFW.
Clik here to view.

Swimming in a Rich Domain

Many domains are shallow and impoverished, e.g., apps that exist to write well-understood fields into a database. A rich domain has many concepts (some contradictory); it has lots of history; and it’s...

View Article

Image may be NSFW.
Clik here to view.

A Dead End for Evolutionary Design

In traditional design, you identify the capabilities and characteristics of a planned system, then create an overall design that accommodates them. In evolutionary design, you grow the system one...

View Article

Image may be NSFW.
Clik here to view.

Refactoring: Replace Method with Method Object

Sometimes, when you try to break up a long method, you run into a problem: you have to pass a bunch of local variables into the new method, some of which are both input and output. One solution is the...

View Article


Image may be NSFW.
Clik here to view.

Refactoring: Extract Local Lambda

Extracting a local lambda turns a block of code into an anonymous inline function.  Motivation A local lambda can isolate code for improvement (the Isolate-Improve-Inline pattern – see References), or...

View Article

Image may be NSFW.
Clik here to view.

Iterative Enhancement and XP-Style Design

“Iterative Enhancement” is a model for iterative development, from Basili & Turner, described in 1975 (!). We’ll look at it, and compare it to XP’s approach. I’ve seen occasional mention of this...

View Article

Image may be NSFW.
Clik here to view.

Reduce Dependencies Using Lambda

When A depends on B (A → B), a change in B may force A to change as well. Dependencies are both good and bad: they let objects work together, but they make software harder to change. We can use lambda...

View Article


Organizing Fields and Methods

When you’re making a class, in what order do you put the fields and methods? We’ll look at several choices and some tradeoffs between them. Organizing Fields I’ve seen a few approaches to organizing...

View Article


Refactor: Inline-Adjust-Extract

Sometimes, we feel that something we extracted isn’t as good as it could be. The Inline-Adjust-Extract refactoring pattern can help fix that. It has three steps: Inline: put the extracted code back...

View Article

Image may be NSFW.
Clik here to view.

Time Troubles – Transitions

Time is a well-known source of trouble for programmers. We looked earlier at one type of time troubles: overflow. Today, I’d like to look at another time trouble: transitions. Here are the problems...

View Article

Image may be NSFW.
Clik here to view.

Threaded Code (and Composite)

Let’s look at the threaded code approach. It’s a less-well-known way to build an interpreter for a programming language. (The more common approach simulates each instruction.) Threaded code has a...

View Article

Image may be NSFW.
Clik here to view.

Pipelines – Confidence in Design

The other day, Kent Beck pointed out a skill that test-driven development (TDD) relies on but doesn’t give much guidance about: “behavioral composition”. This is the skill of dividing a big behavior...

View Article


Image may be NSFW.
Clik here to view.

Trees – Confidence in Design

Test-Driven Development (TDD) depends on assembling well-tested parts into a trustworthy whole. Some design structures make this easier. Today, we’ll look at trees. A tree is a structure consisting of...

View Article

TDD with a Function Pipeline

Our “geek” group tackled a problem a couple weeks ago, that one of us had heard suggested by Michael Feathers: given a sequence of numbers, tell how many non-zero runs it has. Ron Jeffries described a...

View Article


Image may be NSFW.
Clik here to view.

Swift Testing – A New Unit Testing Framework

Apple has introduced a new unit testing framework. It has a simpler syntax, much simpler assertions, parameterized testing, and more. Let’s take a look. You can find a bonus cheatsheet at the end of...

View Article

Image may be NSFW.
Clik here to view.

Run Tests Without an App — Step by Step with Xcode

I’m frustrated when unit tests run slowly. One way to speed them up in Xcode when developing using a simulator: isolate your model to a framework, and run your tests without a host application....

View Article


Image may be NSFW.
Clik here to view.

And-Or Trees

Suppose you want to represent a finite set of possibilities in a compact way. An And-Or Tree can do this, and is useful in several situations. An And-Or Tree has leaf nodes and interior nodes. The...

View Article
Browsing all 118 articles
Browse latest View live