News for hackers. Stuff that matters.
Re:Where and When Did the Symbols "+" and "–" Originate? by rmccue on Wednesday March 13, 2013 @09:38AM (#5368246)
More likely, it's because we don't have them on our keyboards. Programming languages are usually about reducing friction for programmers, but using the proper multiplication/division symbols would increase that for most people.
Re:Where and When Did the Symbols "+" and "–" Originate? by simonh on Wednesday March 13, 2013 @10:17AM (#5368501)
My best guess would be that we use * for multiplication because x being alphanumeric is a valid variable name.

regarding keyboard presence, this is one of the things that irks me about Mac keyboards is the absence of the # character. I write little programs and scripts on my mac infrequently enough that I have to look up how to type it every blasted time. That, and how to take screenshots. The "Print Scrn" key on PCs spoils me.

Re:Where and When Did the Symbols "+" and "–" Originate? by Uncompetative on Wednesday March 13, 2013 @10:35AM (#5368645)

    X = Y x Z

    B = T ^ F v T

    P = Q n R u S

    C = U cross V

    D = U dot V

    Area = Width by Height

i.e. just capitalising names means that you can define macros that operate as infix operators:

    L . R -> L dot R

    L dot R -> Dot[L, R]
Re:Where and When Did the Symbols "+" and "–" Originate? by jewbacca on Wednesday March 13, 2013 @02:48PM (#5370298)
What language are you referring to? I'm not quite sure I understand your examples.

--------

Related:

In Haskell, any 2-argument function can be used (or defined) infix by surrounding it with backticks, eg:

    add 2 3
is equivalent to:

    2 `add` 3
----

And you can use this to cleanly write curried functions (often predicates) with their arguments flipped, eg:

    vowelCount = length . filter (`elem` "aeiou")
----

Note that functions named with punctuation characters are infix by default, and one can be used/defined prefix by surrounding it with brackets, eg:

    (<$>) = fmap
    toUpper <$> "aeiou"    # => "AEIOU"
----

It's also convenient for resolving a subset of one of the harder problems in computer science: naming things. For a 2-argument function, use it infix and read it as a phrase in english. Which is clearer:

    ".jpg" `isSuffix` url
or:

    ".jpg" `isSuffixOf` url
You can also define functions' precedence and associativity (left/right) when used as an infix operator.
Re:Where and When Did the Symbols "+" and "–" Originate? by vorg on Wednesday March 13, 2013 @08:33PM (#5372289)
> And you can use this to cleanly write curried functions (often predicates) with their arguments flipped

But unicode in code is terser. Instead of `elem`, we could use ∈ [U+2208].

To flip parameters, we could use the bidi-mirrored glyph, i.e. ∋ [U+220B, the bidi-mirror of U+2208]. In fact we could even make it a feature of the language grammar to automatically detect whether a mirrored glyph is being used, and perform the transformation.

We could even automatically detect and transform canonically equivalent graphemes using the non-spacing version of `not`, e.g. ∉ [U+2209, canonically equivalent to U+2208,U+0338], and ∌ [U+220C, mirror of U+2209 and equiv to U+220B,U+0338].

Re:Where and When Did the Symbols "+" and "–" Originate? by kzrdude on Wednesday March 13, 2013 @11:43AM (#5369172)
Some apple keyboards have # printed, I'm surprised they don't all have it.
Re:Where and When Did the Symbols "+" and "–" Originate? by Moto7451 on Wednesday March 13, 2013 @12:53PM (#5369565)
I'm going to assume he has the British keyboard which has a pound symbol rather than the hash (or... pound...) symbol.

http://parkernet.com/applepro/images/wireless-british.jpg

Re:Where and When Did the Symbols "+" and "–" Originate? by simonh on Friday March 15, 2013 @05:37AM (#5379792)
Spot on. It never occurred to me this was essentially a localisation issue. Blasted annoying one though.
Re:Where and When Did the Symbols "+" and "–" Originate? by kzrdude on Wednesday March 13, 2013 @11:44AM (#5369181)
Editors should help the user to remap their keyboard keys.. We as users should move the symbols we need so that they are easier to type. For programming I've moved all of \{}[]() to the home row (with alt gr). Just one option of many but it demonstrates the concept..