Linked Questions

527
votes
19answers
131k views

Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
130
votes
9answers
11k views

General strategies to write big code in Mathematica?

I think after six months of exposure to Mathematica and the Wolfram Language I am fairly OK with writing short codes and snippets. However, what are some general strategies to use in order to write ...
111
votes
7answers
14k views

Struct equivalent in Mathematica?

I really miss having something like a struct in Mathematica. I know of (and regularly use) a couple of programming techniques which feel like a ...
78
votes
6answers
2k views

How to avoid nested With[]?

With[ {v1 = #}, With[ {v2 = f[v1]}, g[v1, v2] ] ] How to avoid nested With[] like the above? I'd like to use <...
21
votes
5answers
1k views

Is it possible to Print expressions in reverse order?

Let's say I'm debugging a program step by step and want to Print some expressions (using ShowIt, for example). Is there a way to output the result of ...
17
votes
1answer
1k views

How to Print to the Console

Background: Using the settings under Edit-> Preferences->Evaluation I can redirect all the Print statments to the console. What I'd really like to do is redirect just some specific ...
7
votes
3answers
1k views

How can one debug a module more elegant than just with Print?

This question is interesting mainly for beginners, but the answer i wrote to my own question could be also interesting for advanced users. Introduction: While writing huge blocks of code, especially ...
8
votes
2answers
413 views

How can I dynamically get a file whenever it is saved in Workbench?

I want to get a file once and only once at the start of a coding session. Then, whenever I save the file in the Wolfram Workbench, have it be gotten automatically. How can I construct such a utility?
7
votes
2answers
290 views

Delete contexts from a string representation of a symbol

I want to delete the string representing the context of a symbol. For info I need such a functionality in my ShowIt function defined here I'd like to know how I ...
2
votes
1answer
104 views

Printing grouped cells

How can I print grouped cells with CellPrint ? The closest thing I have to what I want to do is this ...