Message Boards Message Boards

0
|
4994 Views
|
2 Replies
|
4 Total Likes
View groups...
Share
Share this post:

Why should I not write exponents using "ctrl6" instead of "^"?

Posted 9 years ago

Question about exponents

POSTED BY: dgdg grgrg
2 Replies

Did someone advise you to avoid using special formatting in Mathematica?

2-d typesetting can be a bit ambiguous at times. 2-d typesetting can contain formatting characters that do strange things. Characters like "InvisibleSpace" and "InvisibleComma" exist which won't affect how the code looks, but change its behavior. As a rule of thumb, if you're having trouble debugging typeset code, look at it un-typeset. I've seen plenty of code that doesn't work because of stray invisible characters that were inserted when someone used 2-d typesetting.

Many people use 2-d typesetting to make their code look more like math notation. That's not always good - programming notation and math notation try to solve different problems. People who use 2-d typesetting also tend to use subscripts. Subscripts are actually pretty ambiguous and this almost always leads to code that doesn't work. You also tend to see a slew of greek letter and special characters instead of understandable variable names.

I use typesetting sparingly and recommend against it for new programmers. But there's nothing actually wrong with using "ctrl6" instead of "^".

POSTED BY: Sean Clarke

If you want 2-dimensional typesetting in input, go ahead.

Some people find "^" a little quicker.

POSTED BY: Bruce Miller
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract