Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Time to encourage meaningful type parameter names? Discuss
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 152 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Josh Suereth  
View profile  
 More options Nov 17 2011, 7:51 am
From: Josh Suereth <joshua.suer...@gmail.com>
Date: Thu, 17 Nov 2011 07:51:01 -0500
Local: Thurs, Nov 17 2011 7:51 am
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

Yet another thread that probably belongs on scala-debate.

AND to answer with my opinion :  I think using meaningful type parameter
names can make sense, but there's a balance to be had.
On Nov 16, 2011 1:53 PM, "Ken McDonald" <ykken...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Morris  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 8:13 am
From: Tony Morris <tonymor...@gmail.com>
Date: Thu, 17 Nov 2011 23:13:54 +1000
Local: Thurs, Nov 17 2011 8:13 am
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
On 17/11/11 22:56, Matthew Pocock wrote:

This is exactly the mistake I refer to. Now define your operations on
the data type. What do those operations (the important bits) say about
nodes and edges? Exactly, nothing, nothing at all -- now you're stuck in
a cognitive quagmire. Please allow me to politely decline your invitation.

--
Tony Morris
http://tmorris.net/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Pocock  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 8:58 am
From: Matthew Pocock <turingatemyhams...@gmail.com>
Date: Thu, 17 Nov 2011 13:58:11 +0000
Local: Thurs, Nov 17 2011 8:58 am
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

[I'm now subscribed to scala-debate - sorry if you got this twice]

On 17 November 2011 13:13, Tony Morris <tonymor...@gmail.com> wrote:

> On 17/11/11 22:56, Matthew Pocock wrote:
> > trait Graph[TheNodeType, TheEdgeType]

> This is exactly the mistake I refer to. Now define your operations on
> the data type. What do those operations (the important bits) say about
> nodes and edges?

There is no meaningful isomorphism that I can repeatedly apply to
Graph[Node, Edge] to get a Graph[Edge, Node] and then apply again to get
back to the original graph. The nodes and edges play distinct roles. Naming
them after these roles is useful documentation for the user.

> Exactly, nothing, nothing at all

It tells me a great deal about the graph API. It doesn't tell me anything
about the specific choices of concrete types for Node/Edge, but that is not
what type parameter names are for. It tells me what role they play in the
graph, which is what type parameter names are for.

> -- now you're stuck in
> a cognitive quagmire. Please allow me to politely decline your invitation.

No, now I have a documented type, using nomenclature that people are used
to, where people don't have to constantly look in 2 or 3 places to figure
out if A or B is the type that represents an edge or if it is the type that
represents a node. Most people are not compilers and find it easier if
definitions can be understood with the minimum of needing to correlate
terms with other definitions.

Honestly, I'm not getting what 'cognitive quagmire' I can fall into by
calling the type in my graph that is being used for nodes Node rather than
naming it A. It's a graph of nodes linked by edges ffs! We should be
calling the node type Node and the edge type Edge. Anything else
is obfuscation.

Matthew

> --
> Tony Morris
> http://tmorris.net/

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle
University
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scala-user] Time to encourage meaningful type parameter names? Discuss" by √iktor Ҡlang
√iktor Ҡlang  
View profile  
 More options Nov 17 2011, 9:03 am
From: √iktor Ҡlang <viktor.kl...@gmail.com>
Date: Thu, 17 Nov 2011 15:03:41 +0100
Local: Thurs, Nov 17 2011 9:03 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On Thu, Nov 17, 2011 at 2:58 PM, Matthew Pocock <

turingatemyhams...@gmail.com> wrote:
> [I'm now subscribed to scala-debate - sorry if you got this twice]

> On 17 November 2011 13:13, Tony Morris <tonymor...@gmail.com> wrote:

>> On 17/11/11 22:56, Matthew Pocock wrote:
>> > trait Graph[TheNodeType, TheEdgeType]

"The" can be dropped since it cannot be anything else.
"Type" can be dropped since it can only be a type, you don't write: "val
theThingVal = new Thing"

trait Graph[Node, Edge] <--- Looks great to me

--
Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
Experts

Twitter: @viktorklang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Time to encourage meaningful type parameter names? Discuss" by Matthew Pocock
Matthew Pocock  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 9:47 am
From: Matthew Pocock <turingatemyhams...@gmail.com>
Date: Thu, 17 Nov 2011 14:47:43 +0000
Local: Thurs, Nov 17 2011 9:47 am
Subject: Re: [scala-user] Re: Time to encourage meaningful type parameter names? Discuss

Hi,

On 17 November 2011 14:34, Philippe Lhoste <Phi...@gmx.net> wrote:

> On 17/11/2011 13:51, Josh Suereth wrote:

>> Yet another thread that probably belongs on scala-debate.

>> AND to answer with my opinion : I think using meaningful type parameter
>> names can make
>> sense, but there's a balance to be had.

> Yes.
> When I discovered Scala, I was disconcerted, not to say "shocked", by
> these one-letter type names. Looked like those old C programs where
> developers valued conciseness over expressiveness. You know, lines like: if
> (lh->v.u.s.aux == v->u.s.info)

Same here. I'd previously done a lot of Java and a few years of Haskell. I
found much of the haskell libs to be impenetrable due to single-letter (and
often non-mnemonic) type names, even after quite a while working with them.

> On the other hand, there can be some confusion between real types
> (classes, etc.) and abstract types (those used in collections, not knowing
> in advance what they would be); perhaps even potential clashes (?).

Agreed. I have type parameters rendered in italic and type alases as
italic+bold in intellij idea. I'm not a fan of Christmas-tree highlighting,
but this seems to help.

Matthew

--

> Philippe Lhoste
> --  (near) Paris -- France
> --  http://Phi.Lho.free.fr
> --  --  --  --  --  --  --  --  --  --  --  --  --  --

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle
University
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scala-user] Time to encourage meaningful type parameter names? Discuss" by Daniel Sobral
Daniel Sobral  
View profile  
 More options Nov 17 2011, 10:25 am
From: Daniel Sobral <dcsob...@gmail.com>
Date: Thu, 17 Nov 2011 13:25:41 -0200
Local: Thurs, Nov 17 2011 10:25 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
2011/11/17 √iktor Ҡlang <viktor.kl...@gmail.com>

> On Thu, Nov 17, 2011 at 2:58 PM, Matthew Pocock <turingatemyhams...@gmail.com> wrote:

>> [I'm now subscribed to scala-debate - sorry if you got this twice]
>> On 17 November 2011 13:13, Tony Morris <tonymor...@gmail.com> wrote:

>>> On 17/11/11 22:56, Matthew Pocock wrote:
>>> > trait Graph[TheNodeType, TheEdgeType]

> "The" can be dropped since it cannot be anything else.
> "Type" can be dropped since it can only be a type, you don't write: "val theThingVal = new Thing"

> trait Graph[Node, Edge] <--- Looks great to me

Except you just killed Node and Edge as trait/class names. At the very
least, I'd call them ANode and AnEdge.

--
Daniel C. Sobral

I travel to the future all the time.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
√iktor Ҡlang  
View profile  
 More options Nov 17 2011, 10:29 am
From: √iktor Ҡlang <viktor.kl...@gmail.com>
Date: Thu, 17 Nov 2011 16:29:03 +0100
Local: Thurs, Nov 17 2011 10:29 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

2011/11/17 Daniel Sobral <dcsob...@gmail.com>

trait Graph[N/*ode*/, E/*dge*/]

> --
> Daniel C. Sobral

> I travel to the future all the time.

--
Viktor Klang

Akka Tech Lead
Typesafe <http://www.typesafe.com/> - Enterprise-Grade Scala from the
Experts

Twitter: @viktorklang


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Simon Ochsenreither  
View profile  
 More options Nov 17 2011, 10:35 am
From: Simon Ochsenreither <simon.ochsenreit...@googlemail.com>
Date: Thu, 17 Nov 2011 07:35:52 -0800 (PST)
Local: Thurs, Nov 17 2011 10:35 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

Afaik C# prefixes type parameters with T and return type parameters with R
... but they also use I as a prefix for interfaces. The last holdout of
Hungarian notation?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Sobral  
View profile  
 More options Nov 17 2011, 11:42 am
From: Daniel Sobral <dcsob...@gmail.com>
Date: Thu, 17 Nov 2011 14:42:04 -0200
Local: Thurs, Nov 17 2011 11:42 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
2011/11/17 √iktor Ҡlang <viktor.kl...@gmail.com>:

>> > trait Graph[Node, Edge] <--- Looks great to me

>> Except you just killed Node and Edge as trait/class names. At the very
>> least, I'd call them ANode and AnEdge.

> trait Graph[N/*ode*/, E/*dge*/]

Won't show up on Scaladoc, so what's the point? Nope, I still prefer
ANode and AnEdge. :-)

--
Daniel C. Sobral

I travel to the future all the time.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Daniel Sobral  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 11:42 am
From: Daniel Sobral <dcsob...@gmail.com>
Date: Thu, 17 Nov 2011 14:42:55 -0200
Local: Thurs, Nov 17 2011 11:42 am
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
On Thu, Nov 17, 2011 at 13:35, Simon Ochsenreither

<simon.ochsenreit...@googlemail.com> wrote:
> Afaik C# prefixes type parameters with T and return type parameters with R
> ... but they also use I as a prefix for interfaces. The last holdout of
> Hungarian notation?

You should see that Uncle Bob has to say about prefixing interfaces
with I. Pretty funny! :-)

--
Daniel C. Sobral

I travel to the future all the time.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schmitz  
View profile  
 More options Nov 17 2011, 1:11 pm
From: Michael Schmitz <mich...@schmitztech.com>
Date: Thu, 17 Nov 2011 10:11:44 -0800
Local: Thurs, Nov 17 2011 1:11 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
We already have great entries in the scaladoc about type parameters.

http://www.scala-lang.org/api/current/index.html#scala.collection.Map

Peace.  Michael

2011/11/17 Daniel Sobral <dcsob...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Matthew Pocock  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 1:21 pm
From: Matthew Pocock <turingatemyhams...@gmail.com>
Date: Thu, 17 Nov 2011 18:21:15 +0000
Local: Thurs, Nov 17 2011 1:21 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

Yes.... Wouldn't Map[K, V] or Map[Key, Value] be more self-explanatory?
Peace.

2011/11/17 Michael Schmitz <mich...@schmitztech.com>

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle
University
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schmitz  
View profile  
 More options Nov 17 2011, 1:24 pm
From: Michael Schmitz <mich...@schmitztech.com>
Date: Thu, 17 Nov 2011 10:24:36 -0800
Local: Thurs, Nov 17 2011 1:24 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
Well, fair point with Map[K, V]--I'm with you there!

On Thu, Nov 17, 2011 at 10:21 AM, Matthew Pocock


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Alex Repain  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 1:34 pm
From: Alex Repain <alex.rep...@gmail.com>
Date: Thu, 17 Nov 2011 19:34:42 +0100
Local: Thurs, Nov 17 2011 1:34 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

2011/11/17 Matthew Pocock <turingatemyhams...@gmail.com>

> Yes.... Wouldn't Map[K, V] or Map[Key, Value] be more self-explanatory?
> Peace.

There will always be people to not catch [K,V] as [Key, Value], and others
to not catch what is Key or Value because they just don't know what a Map
is (let's say the hereby example is easier than the general case). Using
A,B,C and so on is a way to force the API user to know his tool, to
understand it, and to RTFDocumentation - of course yes, you'd better
document your code if it uses abstract {type names} or value names. As for
using longer names, I'd say as stated before : if your concepts are
abstract (pure mathematics, categories, formal systems in computer science)
then use abstract names. Else, just make sure it's not conflict-prone ...
Graph[N,E] seems just fine to me, Graph[A,B] is also fine. Graph[Node,Edge]
takes risk in conflicting with already defined types (as a Graph API user,
I would be tempted to code """type Node = Container[SomeType, AnotherOne,
...]""").

All the above IMHO.

Alex

2011/11/17 Michael Schmitz <mich...@schmitztech.com>

--
*Alex REPAIN*
ENSEIRB-MATMECA - student
TECHNICOLOR R&D - intern
BORDEAUX I      - master's student
SCALA           - enthusiast

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Time to encourage meaningful type parameter names? Discuss" by Rex Kerr
Rex Kerr  
View profile  
 More options Nov 17 2011, 1:45 pm
From: Rex Kerr <icho...@gmail.com>
Date: Thu, 17 Nov 2011 13:45:56 -0500
Local: Thurs, Nov 17 2011 1:45 pm
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On Thu, Nov 17, 2011 at 7:56 AM, Matthew Pocock <

turingatemyhams...@gmail.com> wrote:
> On 17 November 2011 12:11, Tony Morris <tonymor...@gmail.com> wrote:

>> It is extremely important to pick meaningless names. The moment you
>> project meaning is the moment you start making all those mistakes that
>> we so often see.

> Many times the types are not devoid of meaning. Consider:

> trait Graph[A, B]

Bad.  Now I have to remember whether your graphs have nodes first or edges
first.  I don't want to have to do that.

> trait Graph[N, E]

Good!  Now I don't have to remember!

> trait Graph[Node, Edge]

Why all the extra letters?  I already knew everything I needed to know.

> trait Graph[TheNodeType, TheEdgeType]

This is just mean.

Actually, these are all bad.  Shouldn't it be

trait Graph[N <: Node, E <: Edge]

where Node and Edge are some traits that define the minimal possible
interface required for something to be considered a node or an edge?  Maybe
even

trait Graph[N <: Node, E <: Edge[N]]

depending on the edge interface?

Now we can see why Graph[Node, Edge] is the wrong choice.  You have labeled
the types with _what you want_ without specifying that _they must be what
you want_.  The more you insist with your names that you will in fact put
the correct thing in that slot, the less likely you are to make the
compiler insist on your behalf, and therefore the more burden you are
taking upon yourself.

This is why I think the sweet spot is [N,E].  You want _some_ mnemonic
because you want to know for yourself (as well as the compiler knowing)
that nodes come before edges.  But [Node, Edge] is deceptive, and also
steals the name Node and Edge away from what you probably really want
(which are Node and Edge traits or classes).

  --Rex


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scala-user] Time to encourage meaningful type parameter names? Discuss" by Seth Tisue
Seth Tisue  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 1:56 pm
From: Seth Tisue <s...@tisue.net>
Date: Thu, 17 Nov 2011 13:56:15 -0500
Local: Thurs, Nov 17 2011 1:56 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On Thu, Nov 17, 2011 at 1:45 PM, Rex Kerr <icho...@gmail.com> wrote:
> This is why I think the sweet spot is [N,E].  You want _some_ mnemonic
> because you want to know for yourself (as well as the compiler knowing) that
> nodes come before edges.  But [Node, Edge] is deceptive, and also steals the
> name Node and Edge away from what you probably really want (which are Node
> and Edge traits or classes).

+1

--
Seth Tisue | Northwestern University | http://tisue.net
lead developer, NetLogo: http://ccl.northwestern.edu/netlogo/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Erik Osheim  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 2:01 pm
From: Erik Osheim <e...@plastic-idolatry.com>
Date: Thu, 17 Nov 2011 14:01:00 -0500
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On Thu, Nov 17, 2011 at 01:45:56PM -0500, Rex Kerr wrote:
> This is why I think the sweet spot is [N,E].  You want _some_ mnemonic
> because you want to know for yourself (as well as the compiler knowing)
> that nodes come before edges.  But [Node, Edge] is deceptive, and also
> steals the name Node and Edge away from what you probably really want
> (which are Node and Edge traits or classes).

Agreed.

I find the single letter convention actually makes the use of generics
more obvious to me and easier to reason about. If I had to figure out
whether everything that looked like "Node" was a type parameter or a
concrete type I would be sad. [1]

-- Erik

[1] Before Scala I had no background in languages that had type
parameterization, so (as far as I can tell) I don't have an earlier
attachment to this style.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
HamsterofDeath  
View profile  
 More options Nov 17 2011, 2:05 pm
From: HamsterofDeath <h-s...@gmx.de>
Date: Thu, 17 Nov 2011 20:05:07 +0100
Local: Thurs, Nov 17 2011 2:05 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

i have almost never seen a case where a single letter or letter + number
wasn't enough. if you use a class with type parameters, you use actual
types. if you are inside the class having the class parameters, you have
to take a deeper look anyway or are the author and should know enough
already. taking a quick glance at the declaration won't slow you down.

Am 17.11.2011 19:45, schrieb Rex Kerr:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael Schmitz  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 2:26 pm
From: Michael Schmitz <mich...@schmitztech.com>
Date: Thu, 17 Nov 2011 11:26:07 -0800
Local: Thurs, Nov 17 2011 2:26 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
+1


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Time to encourage meaningful type parameter names? Discuss" by Tony Morris
Tony Morris  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 2:42 pm
From: Tony Morris <tmor...@tmorris.net>
Date: Fri, 18 Nov 2011 05:42:08 +1000
Local: Thurs, Nov 17 2011 2:42 pm
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

Write a few of your graph operations. Use the type parameters as if they
were nodes or edges. Notice how you can't. The proposal is akin to
projecting meaning onto universally quantified variables of a logical
proposition. We say, paraphrased:

For all c such that c is an element of the set Cars...

Notice how we call the variable c, not car or any other particular meaning.
Doing so would degrade readability to the extent that it may distract from
the fact that this variable should contain no further context than its
existence. The constraint of set membership is simply an application to an
operation, no different to a list sort operation requiring ordering on its
elements.

It is extremely important that type variable names contain no context (that
is, call it what you want but I won't be projecting an imaginary context
onto it). I am only motivated to point this out because one day someone is
going to bring this point up IRL and I am going to have to deal with it. I
don't want to; this elusive insight that I am apparently missing according
to "the naming guys" is repeatedly shown to be a failed thesis and now it
is crawling into the least welcome of places (type variables).

Please modify the thesis for practical purposes.
On Nov 17, 2011 11:58 PM, "Matthew Pocock" <turingatemyhams...@gmail.com>
wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scala-user] Time to encourage meaningful type parameter names? Discuss" by Simon Ochsenreither
Simon Ochsenreither  
View profile  
 More options Nov 17 2011, 2:48 pm
From: Simon Ochsenreither <simon.ochsenreit...@googlemail.com>
Date: Thu, 17 Nov 2011 11:48:59 -0800 (PST)
Local: Thurs, Nov 17 2011 2:48 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

D seems to prefix an ! to mark the difference between a type variable and a
concrete type.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Time to encourage meaningful type parameter names? Discuss" by Matthew Pocock
Matthew Pocock  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 2:50 pm
From: Matthew Pocock <turingatemyhams...@gmail.com>
Date: Thu, 17 Nov 2011 19:50:51 +0000
Local: Thurs, Nov 17 2011 2:50 pm
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

Tony,

For normal programmers, names matter. Most people don't think in lambda
calculus or category theory or first order predicate logic. These people
need informative names.

Matthew

On 17 November 2011 19:42, Tony Morris <tmor...@tmorris.net> wrote:

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle
University
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scala-user] Time to encourage meaningful type parameter names? Discuss" by Matthew Pocock
Matthew Pocock  
View profile  
 More options Nov 17 2011, 2:59 pm
From: Matthew Pocock <turingatemyhams...@gmail.com>
Date: Thu, 17 Nov 2011 19:59:41 +0000
Local: Thurs, Nov 17 2011 2:59 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On 17 November 2011 18:34, Alex Repain <alex.rep...@gmail.com> wrote:

> 2011/11/17 Matthew Pocock <turingatemyhams...@gmail.com>

>> Yes.... Wouldn't Map[K, V] or Map[Key, Value] be more self-explanatory?
>> Peace.

> There will always be people to not catch [K,V] as [Key, Value], and others
> to not catch what is Key or Value because they just don't know what a Map
> is (let's say the hereby example is easier than the general case).

The Map data structure is intrinsically associated with the concept of a
data structure that represents some key instances drawn from a key set
conforming to a Key type that 'map to' some value instances drawn from a
value set/bag conforming to a Value type. If a person doesn't understand
Key/Value (or K/V) because they don't know what a Map is, then they need to
find out what a Map is. The issue you're raising in this case isn't with
the naming of the type parameters, but that the entire concept modelled by
the Map isn't known to the user. Once they understand the Map abstraction,
it's much easer for a normal programmer to look at signatures with the type
parameters Key/Value (or K/V) than A/B and associate this back to the Map
abstraction. Normal people find names and mnemonics easier to remember than
random letters. We can find any amount of published literature that
demonstrates this experimentally, and probably also papers that
specifically dissect out what sub-population this doesn't hold for (hint -
this sub-population is not over-represented in that which is also your
average programmer, certainly not to the point that you can discard using
informative names in APIs aimed at average programmers).

Matthew

--
Dr Matthew Pocock
Integrative Bioinformatics Group, School of Computing Science, Newcastle
University
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
skype: matthew.pocock
tel: (0191) 2566550
mob: +447535664143

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tony Morris  
View profile   Translate to Translated (View Original)
 More options Nov 17 2011, 2:59 pm
From: Tony Morris <tonymor...@gmail.com>
Date: Fri, 18 Nov 2011 05:59:55 +1000
Local: Thurs, Nov 17 2011 2:59 pm
Subject: Re: [scala-debate] Re: [scala-user] Time to encourage meaningful type parameter names? Discuss
Are you seriously expecting me to buy this? That I, and others who
aspire to get practical work done, are not "normal programmers", while
you, and your buddies are? Is this how you justify your thesis to
yourself? Sorry, but it's pretty transparent to me.

Do you not think I have worked with people who were once "naming guys"?
They are wrong, so they tried every trick they had, like you are doing.
They're not "naming guys" anymore.

Either demonstrate the point (an appeal to normality/abnormality
exclusion is fallacious -- surely this is obvious) or work out that
you're making a mistake with adverse practical implications. All you've
got to do is use your Node/Edge type variables as if they were nodes or
edges. Let me know when you have achieved this.

On 18/11/11 05:50, Matthew Pocock wrote:

--
Tony Morris
http://tmorris.net/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "Time to encourage meaningful type parameter names? Discuss" by Ken McDonald
Ken McDonald  
View profile  
 More options Nov 17 2011, 3:23 pm
From: Ken McDonald <ykken...@gmail.com>
Date: Thu, 17 Nov 2011 12:23:36 -0800 (PST)
Local: Thurs, Nov 17 2011 3:23 pm
Subject: Re: [scala-user] Time to encourage meaningful type parameter names? Discuss

On Thursday, November 17, 2011 6:51:01 AM UTC-6, Josh Suereth wrote:

> Yet another thread that probably belongs on scala-debate.

> AND to answer with my opinion :  I think using meaningful type parameter
> names can make sense, but there's a balance to be had.

Always there must be balance, young friend. (Yoda waves his light-saber).

OK, a number of people have recommended scala-debate as the proper forum
for such ideas. I regard that as the "graveyard of ideas", and I try to put
a lot of consideration into what I post so that I don't post about either
minor or too-difficult-to-fix ideas. So what is the proper forum to someone
who is novice/intermediate to Scala, and wants to post real concerns about
the language that, by their own experience, could cause Scala to fail or do
poorly? I would suggest that at the moment, there is not an adequate
feedback mechanism from the real world as to what Scala needs to do to
succeed.

And yes, I want to to succeed. I'm put a lot of time into it already,
dagnabit!

Ken


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 152   Newer >
« Back to Discussions « Newer topic     Older topic »