482

626

As you may already know, *Mathematica* is a wonderful piece of software.

However, it has a few characteristics that tend to confuse new (and sometimes not-so-new) users. That can be clearly seen from the the fact that the same questions keep being posted at this site over and over again.

Please help me to identify and explain those pitfalls, so that fewer new users make the mistake of walking into these unexpected traps.

Suggestions for posting answers:

- One topic per answer
- Focus on non-advanced uses (it's intended to be useful for beginners/newbies/novices and as a question closing reference)
- Include a self explanatory title in h2 style
- Explain the symptoms of problems, the mechanism behind the scenes and all possible causes and solutions you can think of. Be sure to include a beginner's level explanation (and a more advanced one too, if you're in the mood)
- Include a link to your answer by editing the
**Index**below (for quick reference)

## Stability and usability

### Learn how to use the Documentation Center effectively

### Undo is not available before version 10

### Don't leave the Suggestions Bar enabled

### The default $HistoryLength causes Mathematica to crash!

## Syntax and semantics

### Association value access

`[]`

vs`[[]]`

### Basic syntax issues

### What the @#%^&*?! do all those funny signs mean?

### Understand that semicolon (;) is not a delimiter

### Omitting ; can cause unexpected results in functions

### Understand the difference between

`Set`

(or`=`

) and`Equal`

(or`==`

)### The displayed form may substantially differ from the internal form

### Mathematica's own programming model: functions and expressions

## Assignment and definition

### Lingering Definitions: when calculations go bad

### Understand the difference between

`Set`

(or`=`

) and`SetDelayed`

(or`:=`

)### Understand what

`Set`

(=) really does### Attempting to make an assignment to the argument of a function

### Assuming commands will have side effects which they don't:

### How to use both initialized and uninitialized variables

## General guidelines

### Avoiding procedural loops

### Understand the difference between exact and approximate (Real) numbers

### Using the result of functions that return replacement rules

### Use Consistent Naming Conventions

### User-defined functions, numerical approximation, and NumericQ

### Mathematica can be much more than a scratchpad

### Understanding

`$Context`

,`$ContextPath`

the parsing stage and runtime scoping constructs### How to work always in WYSIWYG mode?

## Graphics and images

### Why do I get an empty plot?

### Why is my picture upside-down?

### Plot functions do not print output (Where are my plots?)

### Use

`Rasterize[..., "Image"]`

to avoid double rasterization

## Tricky functions

### Using

`Sort`

incorrectly### Misunderstanding

`Dynamic`

### Fourier transforms do not return the expected result

Association/<||> objects are Atomic and thus unmatchable before 10.4

2@belisarius, Can I suggest to have a similar guide like "Effective use of notebooks for beginners?" – carlosayam – 2013-12-31T06:44:04.087

1@caya Of course. I find it very interesting. You can post it as a (CW) question. – Dr. belisarius – 2013-12-31T15:55:00.613

@carlosayam, I looked through your profile, but couldn't find it. Did you ever ask the notebook question? – LSpice – 2015-04-24T02:50:25.663

1Fantastic. Someone should also add an answer for how to retrieve elements from multi-dimension arrays. Another suggestion would be to Optimize of graphics and plots for print or save to readable format. Will help students do their assignments on Mathematica. – Rene Duchamp – 2015-06-26T23:02:45.977

While adding, do you remove answers as well? I've went through the batch and find it interesting overall. There are some however, some newer association posts for example, that aren't helpful to a new user. In my opinion he or she should be drawn in with understanding of the practical common basics. – BoLe – 2016-07-09T12:07:53.100

This is actually a kind of silly question, but how can one format their question like @Mr.Wizard did? – SumNeuron – 2016-08-28T15:18:21.317

@SumNeuron You can click

– Mr.Wizard – 2016-08-28T19:27:06.647editto see the markdown code used in the post itself. For general instruction see http://mathematica.stackexchange.com/editing-help"As you may already know, Mathematica is a wonderful piece of software.", oh yes: we know. Yet, this product has the ability to enchant you over and over, and... over, endlessly. It goes beyond wonderful. I am proud to be (a tiny) part of this community. – nilo de roock – 2019-06-15T10:51:31.520

6Few suggestions: 1. old definitions in memory and "overloaded" functions like

`f[x_]:=a; f[x_Integer]=b`

; 2. Forgotten underscore in patterns`f[x]=a`

3.`Set`

vs`SetDelayed`

; 4.`m = {{1, 2}, {3, 4}} // MatrixForm`

and then`Eigenvalues[q]`

; 5. Plotting complex function produces empty plot without any warnings. – Nick Stranniy – 2013-01-24T22:23:52.8202I want to throw

`$HistoryLength`

in there, a memory management in general category including`MaxMemoryUsed`

and`MemoryConstrained`

etc – ssch – 2013-01-25T00:03:53.8831Suggestion: Don't mess with

`Dynamic`

before you can master`Plot`

. Be real and patient. You are learning a new language, it doesn't matter if you are a C master – Rojo – 2013-01-25T01:09:49.2835Suggestion: If appropriate to the problem, force Mathematica to use approximate numerical algorithms to avoid the computational overhead of their symbolic counterparts. There are several ways to do this (e.g., NIntegrate vs. Integrate, using real approximate numbers instead of integers in equations, etc). – Cassini – 2013-01-25T03:51:57.497

4

Suggestion: http://mathematica.stackexchange.com/q/18483/193 (Using the result of functions that return replacement rules)

– Dr. belisarius – 2013-01-26T07:46:50.763By a long mile, my biggest problem as a beginner was the tendency of the Front End to work for a long time and then crash. I cannot tell you how much time this wasted, because then I usually had to quit the application from Activity Monitor. After I installed a modified version of a previously circulated quit-on-any-message handler, the problem mostly went away. That is why I strongly believe stop on message should be a default-on feature of the Mathematica Front End. – Ralph Dratman – 2013-01-30T06:23:45.073

6Maybe there should be a (short) answer about security. Most people don't realize mathematica has a large set of functions that are capable of taking over your computer entirely, or as a more specific example, activating your webcam (

`CurrentImage`

). – Jacob Akkerboom – 2013-08-08T11:19:41.763