93
votes
General strategies to write big code in Mathematica?
Preamble
I had a talk devoted specifically to this topic, on Second Russian WTC in 2014. Unfortunately, it is in Russian. But I will try to summarize it here.
Since this post is becoming too long, I ...
78
votes
Accepted
General strategies to write big code in Mathematica?
Managing the complexity, II: controlling complexity on the smaller scale
There are a few things you can do to control and reduce the complexity of your code, even on the small scale - long before you ...
47
votes
What are some common issues with fitting functions to data?
First, let's enumerate some of the functions:
Fit[] is the simplest of fitting functions. It has been introduced in v5, and hasn't been updated since v6 (as of v11)...
44
votes
General strategies to write big code in Mathematica?
Here are some advices from my experience.
Explore new ideas with the Mathematica frontend. Don't hesitate to use sections and subsections in the frontend to structure your work and experiment various ...
40
votes
Is manual adjustment of AccuracyGoal and PrecisionGoal useless?
Introduction
The first section below can be found in standard numerical analysis textbooks. Most current textbooks seem to assume a working environment such as MATLAB or a programming language such C,...
39
votes
General strategies to write big code in Mathematica?
Managing the complexity III: using powerful abstractions
In this section I will list a few techniques which allow one to write more modular code and better separate the concerns, by using certain ...
37
votes
Q&A Mathematica v.11 Neural Networks: A comprehensive look at Layers, Net Functions, and pioneering into this [[experimental]] code
Thank you for your summary. I would like to clarify and correct a few of your points.
however, Mathematica - being proprietary - does not make it clear as to which algorithms they choose to use to ...
26
votes
General strategies to write big code in Mathematica?
This answer is based on the original poster's statement that he has been using Mathematica for six months, and is now trying to build something a bit more complex. I do not take this to mean a large ...
21
votes
What are the most common pitfalls awaiting new users?
Fourier transforms do not return the expected result
Many users know a particular definition of the Fourier transform. When Mathematica returns an unexpected result and users cannot comprehend what ...
Community wiki
21
votes
Accepted
Package organization
The key point is not to set the usage message between BeginPackage and Begin["`Private`"], but just to mention the symbol.
A ...
21
votes
Accepted
Custom atomic expressions - modern tutorial
I have a new package for speeding up the construction of things like these which I discuss at the end
Atomic vs Valid
These are two related but distinct concepts. The former indicates that we can't ...
19
votes
General strategies to write big code in Mathematica?
As Leonid mentions in one of his answers one of the methods of managing complexity is using Domain Specific Languages (DSLs). In this answer I will provide links to documents, packages, blog posts, ...
19
votes
Q&A Mathematica v.11 Neural Networks: A comprehensive look at Layers, Net Functions, and pioneering into this [[experimental]] code
Layers
BatchNormalizationLayer
There are several layers introduced in v.11 that can not be used uninitialized, this is one of them. Input must be either a rank 1 or rank 3 tensor. To be honest, I do ...
18
votes
Package organization
It is possible, your code works. I don't see any downsides which aren't a matter of taste.
I like to keep usages next to definitions too. But I hate using full names, you can just mention symbols in ...
Kuba♦
- 137k
18
votes
Unexpected behaviors in built-in functions
...Q functions that can return something else than True or False
TL;DR;
Those exceptions ...
Community wiki
17
votes
General strategies to write big code in Mathematica?
Use an IDE like Workbench and remember good software development practices
Take a look at workbench which is a branded version of Eclipse, a very common Integrated Development Platfom (IDE). On the ...
17
votes
Accepted
Working with DynamicModule: SetDelayed + OwnValues
J. Fultz' answer indicates that it is not a bug but a feature which needs better documentation.
Get a habit of defining your procedures with [], e.g. ...
Kuba♦
- 137k
15
votes
General strategies to write big code in Mathematica?
(This answer is complementary to those of faysou, C. E., and Leonid Shifrin. It corresponds to one of the methods mentioned but not covered in the answer of Leonid Shifrin.)
For large development ...
15
votes
What are the most common pitfalls awaiting new users?
Understand the difference between Set (or =) and Equal (or ...
Community wiki
15
votes
How to use the Testing Notebook to test a package without shadowing?
What R.M. answer means is that Get as a part of the test will not help. The reason is that the content is parsed before Get is ...
Kuba♦
- 137k
15
votes
Accepted
Internal DynamicModule steals scope of external DynamicModule
This answer builds on @AlbertRetey's answer where, in the comments, you wanted some guidance as to how Wolfram creates robust controls.
Think very carefully about the division of labor between the FE ...
14
votes
General techniques for creating complex animations
If you have recurring requirements, such as stringing together multiple animation segments in sequence, it makes sense to write some helper code to deal with things like timekeeping. You can decide ...
14
votes
Q&A Mathematica v.11 Neural Networks: A comprehensive look at Layers, Net Functions, and pioneering into this [[experimental]] code
Thank you for the extensive summary on layers.
There are some points I would like to fix, in addition to @Sebastian 's response.
In CatenateLayer
It is the Net ...
13
votes
What are the most common pitfalls awaiting new users?
Association/<||> objects are Atomic and thus unmatchable before 10.4
...
Community wiki
13
votes
What are the most common pitfalls awaiting new users?
How to work always in WYSIWYG mode?
How to get in PDF format exactly what I see in my Notebook?
It is counterintuitive and undocumented, but Mathematica by default prints to PostScript printers and ...
Community wiki
13
votes
Accepted
Good clearing practices
I'd like to summarize the discussion that took place in comments, since I think this is an important question, and a common source of frustration when lingering definitions cause weird behavior that ...
13
votes
Q&A Mathematica v.11 Neural Networks: A comprehensive look at Layers, Net Functions, and pioneering into this [[experimental]] code
Useful functions
NetExtract
This is probably one of the more important functions. I mean, your weights are the nuts and bolts of your network. It has two arguments, net and then layers you want. You ...
13
votes
What are some common issues with fitting functions to data?
@Feyre's answer is excellent. I would add the following two items:
1. Overparameterizing a model.
When a model has parameters that are not estimable, errors and convergence problems arise. For ...
12
votes
Guidelines for planning custom GUI in Mathematica
Things to keep in mind when developing complex GUI in Mathematica:
Wolfram System general issues:
Styles management/inheritance system (StyleSheets and friend)
It is complicated, full of exceptions ...
Community wiki
12
votes
What are the most common pitfalls awaiting new users?
Omitting ; can cause unexpected results in functions
A missing ; somewhere inside a function is my number one reason for time-consuming debugging because there are no error messages indicating that ...
Community wiki
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
guidelines × 73front-end × 10
packages × 9
functions × 7
function-construction × 7
programming × 7
dynamic × 5
gui-construction × 5
options × 5
coding-style × 5
function-comparison × 5
machine-learning × 4
functional-style × 4
documentation × 4
performance-tuning × 3
syntax × 3
scoping × 3
variable-definitions × 3
wolfram-cloud × 3
stylesheet × 3
symbols × 3
reference-request × 3
clear × 3
development × 3
graphics × 2