General guidelines and best practices for Mathematica usage and programming.
58
votes
4answers
3k views
How to compile effectively?
What are the best practices of compiling functions? I understand that this is a vague question, but let me list some aspects that might trigger useful answers. Some of these have already been answered ...
47
votes
4answers
2k views
Functions with Options
Suppose you want to create a function which has optional arguments.
Maeder's book "Programming in Mathematica" covers the topic extensively up to version 3, but some things have changed/evolved since ...
17
votes
2answers
452 views
Resource management in Mathematica
I am using a library that has functions like createSomeObject[] and deleteSomeObject[obj]. It is an interface to a C language ...
0
votes
2answers
77 views
Saving variables from nested function
There has to be a simple solution for my question:
I have three functions and each uses the output from the previous function as its input:
...
4
votes
1answer
383 views
Efficient backtracking with Mathematica
Backtracking is a general algorithm for finding all (or some) solutions to some computational problem, that incrementally builds candidates to the solutions, and abandons each partial candidate c ...
19
votes
2answers
488 views
What are the most common (usual) ways to make palettes with non-trivial functionality?
What are the best (most robust and most convenient) ways to create palettes that can be installed permanently (using Palettes -> Install Palette...) and are safe ...
12
votes
1answer
349 views
Error checking and trapping techniques with Throw and Catch
Mathematica provides several mechanisms for checking arguments and trapping errors in a function definition.
Typical methods are :
Definitions with argument patterns, definitions with ...
19
votes
2answers
443 views
What are recommended guidelines for developing packages?
This might be of general interest – I have different questions regarding naming conventions, contexts, subcontexts, shadowing, etc., but I do feel that they are closely related, thus I don't really ...
10
votes
2answers
360 views
How to unload automatically loaded packages?
I know that this has been discussed here (How do I clear all user defined symbols?), but my case is somewhat different. How does one unload packages during runtime that were loaded with the start of ...
