i've never used it... what's a good use case?
What do you call this in Ruby?
61–69 of 69 posts
Re: What do you call this in Ruby?
#62Meanwhile: Mathematica 10.0 for Mac OS X x86 (64-bit) Copyright 1988-2014 Wolfram Research, Inc. In[1]:= FullForm[x->y*z^w] Out[1]//FullForm= Rule[x, Times[y, Power[z, w]]] In[2]:= x\[UnionPlus]y\[RightTee]z Out[2]= x ⊎ y ⊢ z There's no reason your programming language shouldn't be able to tell you what these things are called in English without an external reference.
Some operators are so abstract that they don't really have a good name. Eg if you are talking about groups in general, how do you pronounce the group operation ∘? At uni, we usually just called it Kringel.
Also fun:
In[3]:= SpokenString[x\[SmallCircle]y]
Out[3]= "SmallCircle of x and y"
Which can be turned in to sound: Speak[x\[SmallCircle]y]Re: What do you call this in Ruby?
#63Earlier quoted context omitted.
We Google them, which is an impossible task for non-alphabetic symbols. :P
I wonder at what point people started to expect that search engines can instantly provide all the answers to everything worth knowing. The correct place to find a word you don't know is a dictionary. The correct place to find a symbol in code that you don't know is the definition in the source code (or language reference if it's baked in), or simply ask someone who knows.
Re: What do you call this in Ruby?
#64Earlier quoted context omitted.
Some operators are so abstract that they don't really have a good name. Eg if you are talking about groups in general, how do you pronounce the group operation ∘? At uni, we usually just called it Kringel.
The name can be arbitrary, as long as it's unambiguous. By the way, here's what mathematica says when I copy paste that and enter x∘y: SmallCircle[x,y] Also fun: In[3]:= SpokenString[x\[SmallCircle]y] Out[3]= "SmallCircle of x and y" Which can be turned in to sound: Speak[x\[SmallCircle]y]
Re: What do you call this in Ruby?
#65Earlier quoted context omitted.
Sperm comes from ejaculate. Ejaculation is a bodily function. Bodily function is likely not going to be proper in a professional environment.
Really? What about sleep/wake?
Re: What do you call this in Ruby?
#66Earlier quoted context omitted.
We're specifically talking about operators and finding a way to determine if they are universally known. If the wording bothers you, replace it with "We should only accept symbolic operators that are taught up to sixth grade".
Also prohibited: == (children learn =), &&, ||, |, ^, %, ++, --, != (children learn ≠), ~, >. & is maybe allowed. Sixth graders don't know about bitwise operations, but they know & means "and". That's stretching things a bit, though. Is [] allowed for indexing? When I learned about arrays in sixth grade... No, wait, I didn't learn about arrays in sixth grade. For that matter, I didn't learn about functions using ():…
Also, I despise the logic of "because it exists on a keyboard, it should be used". C is a terrible offender in this regard, with * and & used for no good reason.
10-years-old, or 6th grade, or whatever is an arbitrary number, but don't get caught up in the distinction. "90% of high school graduates" would institute a similar threshold, and probably be less controversial.
Re: What do you call this in Ruby?
#67This sums up what I dislike most about Scala (which is an even worse offender in this regard). A rule of thumb: if a 10-year-old wouldn't be able to intuitively read the operator, use words.
Pfft try Haskell sometime. Everything that's even remotely Applicative seems to have a tendency to export 20 variations of . Then there's Lenses, the coolest line noise you'll ever see.
Re: What do you call this in Ruby?
#68This sums up what I dislike most about Scala (which is an even worse offender in this regard). A rule of thumb: if a 10-year-old wouldn't be able to intuitively read the operator, use words.
People say that. But it's totally misguided IME. You're talking about scalaz. Normal Scala code has fewer symbols than Ruby aside from function lifting (the underscore). In fact, you've got Generics (square braces), curly braces for blocks, fatty arrows for call-by-name, functions parameters and pattern matching. Parens for methods and tuples. Underscore for function lifting. cons (double or triple colon). Stab by ar…
Re: What do you call this in Ruby?
#69Earlier quoted context omitted.
People say that. But it's totally misguided IME. You're talking about scalaz. Normal Scala code has fewer symbols than Ruby aside from function lifting (the underscore). In fact, you've got Generics (square braces), curly braces for blocks, fatty arrows for call-by-name, functions parameters and pattern matching. Parens for methods and tuples. Underscore for function lifting. cons (double or triple colon). Stab by ar…
The problem is that having Scalaz and its ilk underpinning a lot of libraries mean that, if you need to go down the debugging stack, you find yourself pretty quickly in squiggle soup.
Then I'd go back to the issue of: You might be using the wrong libraries if you find that frustrating.
I don't think any of the libraries I'm using in my current project utilize any typelevel stuff to a noticeable extent. I have seen it in my classpath, but haven't bothered to see where it's coming from and never run into any of it despite using CMD+B very frequently in IDEA.
You can go a pretty long ways with Scalatest, Akka, json4s, and maybe some commons stuff for REST service development. Play development isn't all that much different though.
If you're deep in science, maybe your library needs change. But then again I would assume less complaint over mathy concepts then. Maybe that's off-base.