# Tagged Questions

Questions on how to write code in a better or different style, using Mathematica's capabilities for coding in multiple styles.

1k views

### Is this the most effective and efficient programming style for prototyping (a ray tracer) in Mathematica?

I am trying out Mathematica as a prototyping tool. As an initial exercise I have put together a brute force ray tracer, with a view to using Mathematica's built in probability distribution functions ...
199 views

### What is a good way to code long, complex, compilable algorithms?

The functional paradigm of the Wolfram Language used in Mathematica is all around wonderful. For intense numerics, Mathematica comes with the ability to Compile ...
210 views

### The guidelines for options or multiple arguments?

Where can I find some references concerning when to use options and when to use multiple arguments in designing and writing functions? Seems most built-in functions have arguments less than 3 and ...
127 views

### What can I do to improve the performance of my calculations?

I'm trying to express a simple probability problem in Mathematica, but am having trouble getting my calculations to execute at a reasonable speed. I have an object whose unknown location is modeled ...
142 views

### How do I add options to a built in function, which only apply to a certain class of argument?

I'd like to add an option to a built-in function that only applies when it is given an argument of a certain form. For example, something like this approach to extending ...
66 views

### Good coding for integral substituions

This question is aimed at improving both my coding and my understanding of MMa's capabilities. A lot of my code is still hacks and workarounds for things I don't know how to do properly. I want to ...
156 views

### How can I make my MM code more compact and readable? Can I put functions in different notebooks?

I'm doing some coding in MM9, but my program is getting quite large. It's mostly a bunch of functions defined at the beginning of it, but it's getting to the point where I have to scroll for a few ...
I need to find $h_{0j}$ for every $1\leq j\leq300$, where \begin{multline*} h_{0j} = \sum_{q=1}^{Q}g_qe^{-\lambda_q j\Delta}\frac{e^{\lambda_q\Delta}-1}{\lambda_q} + \sum_{p=1}^{P}\frac{e^{-\alpha_p j\...