2

When I write small projects in Mathematica, I run into such problem: I know ways to implement the functionality of small parts, but having problem selecting the most Mathematica-style way to group them together, to be specific, it may concern the efficiency/connivence/convention about the styles. However, these question may fall into "too broad", "too localized", "opinion based" etc, that's why I'm asking.

For example, I am developing a program that analysis a large set of data, some possible questions about design could be:

  • Should I load the large data into a global variable, or make an object to access like obj["Property"]?

  • Should some settings about analysis written and initialized first at the beginning at the notebook, or make them options for specific function?

  • Should I use a traditional algorithm, or use an one-line pattern matching to do some operations?

  • Should I make all the code inside .m file, or leave some certain code in the .nb file?

  • To what extent should I preprocess my data (preprocess takes more time/memory in advance while process at function results in redundant calculations)?

(Of course I will describe questions more clearly in practice.)

My past attempts are "ask an approach I don't know how to write, and hopefully someone will suggest another method", and a successful example is: How to prevent substitution in a part of an expression? ,where Leonid gave me both. I imagine if I asked "what is generally a good way to write a parser for scheme in Mathematica?", and it will be closed. But I believe if I present the brief description of whole project, it's easy for others to get my intention.

  • 1
    I think these kind of questions would fall under the guidelines and programming tags. Checking the questions under these tags might give you some suggestions about how to formulate your questions in an on-topic way. Especially, not asking "Should I ..." but something more concrete (advantages, performance, readability, how to, ...) with a minimal working example should reduce the risk of being off-topic. – Karsten 7. Jun 19 '16 at 13:42
  • I am not asking that specific question, that is only an example, I am not needing any answers to any of the questions listed. To whoever want to close this post: I would like to know why this post itself is opinion based, since many questions about allowed questions exist on meta. – happy fish Jun 19 '16 at 13:49
4

This question is good example of one that should be closed because any answers can only be opinion-based. However, I will give my opinion.

The design issues brought up in this question are important ones, but no general answer can be given that will be the right answer for all Mathematica projects. Mathematica is simply too big a tool box, applicable to too many kinds of programming projects, that there is no single design paradigm that can apply in general.

Therefore, in my opinion, a question of the kind described above would only admissible to Mathematica.SE if it described the specifics of a project in considerable detail and asked a focused question on one (or maybe a very few) design issues. I would not want to see a project description followed by the question: What is the best overall design to implement this project?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .