6 ms·
"The Wolfram Language has about 5000 built-in functions. All have names in which each word starts with a capital letter." Amazingly, I get the impression they
by murbard2 11y ago
"The Wolfram Language has about 5000 built-in functions. All have names in which each word starts with a capital letter."
Amazingly, I get the impression they say it as a point of pride, rather than as an embarrassing design decision. Don't get me wrong, having a rich, large standard library is great, but unless you use some kind of hierarchical namespaces, it's impossible to deal with.
- brandonbloom 11y agoYou speak a language with three to six thousand "common" words and over one million total words. English speakers utilize no such hierarchical naming scheme, only practice. Typical Mathematica notebooks (I won't say "programs") use a fair bit less than one hundred of the common functions, plus a handful of domain-specific functions from that the greater set of five thousand. At any time, you can enter ?FunctionName to access documentation far more comprehensive than most languages offer. The UpperCaseForStandardLibrary and lowerCaseForYourCode convention actually makes a lot of sense in the context of Mathematica's primary use cases vs traditional software engineering projects. When I'm just trying to solve some problem in Mathematica, using my computer as a bicycle for the mind, I appreciate not having to putz with import statements or avoid name collisions.
- murbard2 11y agoThere's no reason to expect a language like English which evolved organically to have an elegant or efficient design.
- baddox 11y agoAnd thus, given the large amount of effective communication that occurs in English, there's no reason to expect that there is much of a downside in eschewing this particular language design approach that you propose.
- murbard2 11y agoAnd thus given the large amount of effective websites that are programmed in PHP, there's no reason to expect that there is much of a downside in using this particular design.
- PeCaN 11y agoWell, PHP is certainly efficient for programming websites. It just comes at the expense of everything else. Yes, bashing PHP is fun, and yes, I do it all the time. PHP may be a joke, but there are a bunch of PHP websites because PHP is a very, very fast way to program websites, even widely used ones. If you could program a simple website in Idris in 30 minutes starting from no prior knowledge, then a large amount of websites would be programmed in Idris (and the world would be a much nicer place). Since that's not the case, should we consider Idris a bad language with major downsides? Of course not, that's pointless, since it wasn't a language meant for building websites. PHP, however, is. Saying it has major downsides outside of its niche is somewhat irrelevant.
- murbard2 11y ago> PHP is a very, very fast way to program websites, even widely used ones Sure, and none of that has anything to do with its horrible design decisions and inconsistent naming. This ability to whip up web sites quickly is not something that PHP achieves as the cost bad design, it achieves it despite unnecessarily bad design.
- bachmeier 11y ago> given the large amount of effective communication that occurs in English I wasn't aware that anyone thought English was an effective language for communicating. It's horrible. Even native English speakers have problems communicating all the time.
- AnimalMuppet 11y agoFalse. Even native English speakers have occasional problems communicating.
- fdej 11y agoThis is less of a problem when you consider that peripheral functions tend to have verbose, descriptive names. Is GeoProjection really fundamentally worse than Geo.Projection? The upper case convention by itself greatly reduces the chance of collisions with user-defined functions and variables.
- murbard2 11y agoYes it is. Either all of your geography related function start with "Geo" followed by a capital. In that case you're basically using a namespace while reaping none of the benefits. You can't use the namespace to avoid repeating yourself in some local context, you can't rename it, you can programmatically inspect its content, etc. Either they do not, in that case you have an inconsistent mess.
- ori_b 11y agoOk. So they basically use a namespace. Now, your objection is that the implementation of the builtin functions repeats Geo too much? As a user, why should I care?
- deleted 11y ago[deleted]
- murbard2 11y agoNo, that's the weakest advantage, I've cited others. For instance, being able to rename the namespace is very important if you're using third party libraries which may have conflicting names.
- brandonbloom 11y agoHalf the reason for Wolfram Language's large standard library is that you should almost never need a third party library of any kind. If there was a third party library that was particularly useful to typical Mathematica use cases, Wolfram would just put it in to the standard library...
- wrsh07 11y agoAgreed. It makes me think of the amazing Guy Steele talk "Growing a Language." https://www.youtube.com/watch?v=_ahvzDzKdB0 https://www.youtube.com/watch?v=_ahvzDzKdB0
- frik 11y agoPHP has no namespace, inherits many C-functions and is quite popular. It's easier to recall a function name than recall the namespace and the function name, isn't it? With modern IDEs this is a none issue anyway. Though from my experience with Mathematica 5-7, the language feels a bit weird. Nevertheless it's quite an achivement that WolframAlpha (the AI search engine) runs on Mathematica code.
- onedognight 11y agoMathematica has hierarchical namespaces (known as Contexts) with backtick as the separator.
- williamjennings 11y agoIn most European languages, the hierarchical namespace of vocabulary is encoded into the system of prefixes and suffixes. The Camel Case coding style is used for a similar mnemonic purpose. Wolfram is designed for the representation of Mathematics, a subject which has to translate literally in as many languages as possible. When you work with such an arbitrarily named set of functions, it is helpful to keep a chart of function names keyed to symbolic representations.