# Tagged Questions

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

61 views

### why the result not contain imaginary, I? [on hold]

Good day, First of all, sorry if my coding in this forum has mistake. I already learned it and this is the best try from me. May anyone help me troubleshoot my problem below. ...
45 views

### How to add new formula in existing formula in certain time?

Good day, May anyone help me to give an idea to edit the coding For as below towards my problems. ...
4k views

### How do I increase the readability of this code?

Below is some code I am working on; being a beginner. How can I increase the readability of the part behind Manipulate? I can't read my own code anymore, because it is simply too long and unordered. ...
128 views

### Coding using time from system(computer)

Please help me to solve this problem below. I want to run this coding based on the time given by the system. Given, A = ( { {E^(I [Beta]1 + I [Beta]3) Cos[[Beta]2t], E^(I [Beta]1 - I [...
189 views

### Replace For with If in Mathematica way

I have this code: ...
477 views

### How to generate this structure of a list without While and the like?

I need to create a list that holds, for given integer d, the elements $1,\ldots,d,d+2,\ldots,2d,2d+3,\ldots,3d,3d+4,\ldots,d^2$ where $\ldots$ is just denoting ...
394 views

### Writing functions with “Method” options

I'd like to implement several behaviors for a particular function using a Method option added to the function definition: ...
1k views

### Granular versus terse coding

While reading Leonid's grand answers to General strategies to write big code in Mathematica? I came across something that goes against my own practices. I do not disagree with the principle but the ...
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 ...
184 views

### stop notebook evaluation when Assert fails

I would like a notebook evaluation to entirely stop when an Assert fails, without quitting the kernel. Is this possible (e.g., by setting ...
282 views

### Good coding for a sequence of derivatives

People on this site keep telling me that good MMa practice avoids the use of loops. The code below calculates the same Table of derivatives two different ways, ...
154 views

351 views

### Is there a guideline about when to end expressions with semicolons?

Whether for nested Ifs or within scoping constructs like Module and Block, I never know ...
486 views

### Functional programming Style & Performance

Hello i have been spending time to convert my R tools into Mathematica Packages mainly because i like the functional programming style in Mathematica. In doing so it seems that i run into one ...
411 views

### Equivalent Nested Loop Structure

Consider the following examples: ...
215 views

### Should I end all definitions from packages with semicolon?

I noticed that if I open a .m file in Mathematica and click on the Run Package button, all the ...
5k views

### Guidelines on giving readable names to variables [closed]

I know that one cannot use underscore to a variable name, like degree_of_The_First_Polynomial. But for a long variable name, it ...
115 views

### Writing a function to mimic Characters

I am working my way through Programming Paradigms via Mathematica (A First Course) and have answered the following question in lesson 25: Write a function of one argument "s", a String, which ...
1k views

### Getting serious about Mathematica programming

I'm at a point in my Mathematica journey where I need to be a little bit more strategic about my coding. Presently, I have a bunch of notebook files organized using the filesystem of the OS and ...
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 ...
5k views

### Can one identify the design patterns of Mathematica?

... or are they unnecessary in such a high-level language? I've been thinking about programming style, coding standards and the like quite a bit lately, the result of my current work on a mixed .Net/...
249 views

### How to find the name of the current function

I would like to know the name of the current function from within that function. For example, consider the following code ...
348 views

### More structure in Source Code/Notebooks

Mathematica is great for small and quick projects and has a great syntax. However as soon as a project grows I run into trouble. How do you scale and maintain projects in Mathematica? What is beyond ...
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 ...