Linked Questions

604 votes
19 answers
158k 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 ...
159 votes
9 answers
15k 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 ...
Ali Hashmi's user avatar
  • 9,060
124 votes
7 answers
18k 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 ...
Cassini's user avatar
  • 5,636
90 votes
6 answers
4k 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 <...
user13253's user avatar
  • 8,674
21 votes
5 answers
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
1 answer
2k 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 ...
Ajasja's user avatar
  • 13.8k
12 votes
3 answers
2k 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 ...
sacratus's user avatar
  • 1,616
8 votes
2 answers
501 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?
M.R.'s user avatar
  • 31.8k
7 votes
2 answers
439 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 ...
faysou's user avatar
  • 11k
0 votes
2 answers
207 views

How to construct an IF statement within `Manipulate` with various stopping statements

Take the following data: ...
Tugrul Temel's user avatar
  • 6,409
3 votes
1 answer
113 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 ...
faysou's user avatar
  • 11k