Tag Info

New answers tagged

4

Linked lists: general discussion I would like to describe here a pattern which is IMO quite important yet seems to be generally under-appreciated and under-used in our community (and probably in Mathematica programming in general) - namely, linked lists. Linked lists are important for several reasons. Here is a (partial) list of benefits they can bring to ...


1

I'm starting to expand my comment to Szabolcs. Many illustrations can be found in my answer here http://mathematica.stackexchange.com/a/8617/66 that collects interesting questions and answers, I'm just trying to summarize here some techniques I often see used. Closures: a Module can return a pure function that depends on the Module's created symbols. The ...


22

Leaving the general discussion on design patterns for some later time, I will try to collect a comprehensive information on some specific design patterns / idioms, one pattern per post. This time it will be memoization Basic memoization What is memoization Memoization is a technique which enables a program to reuse parts of computations it has done ...


10

"Design patterns" are a standard approach to a class of problems. They may become idioms if the community adopts them. They may be simple, but non-trivial to figure out and identify (for oneself) as a pattern worthy of re-use. Here's one particular pattern I personally like to use: Example: the "TransformBy" approach There are functions which transform ...


4

One of my favorite Mathematica paradigms is what we used to call "self modifying code." Back in assembly language days (before the dinosaurs) this was considered a VERY BAD THING and was discouraged -- many modern languages forbid it. But it's a normal and common part of the Mathematica syntax. For example, say you need to implement a filter on an image, but ...


2

Necessary? No they are not necessary, but they are extremely useful, just as in any other programming system. I would say that the abstraction level of a programming language has no effect on the usefulness of design patterns. There must be hundreds, perhaps thousands, of Mathematica design patterns. I recently answered a question concerning table ...


12

This is just a beginning of some notions of what the patterns of Mathematica programming might be. Others should feel free to add or correct anything here. It might well be that I've simply misunderstood what patterns in software development really are. Pattern-based overloading to create polymorphous functions It's pretty common to use Mathematica's ...



Top 50 recent answers are included