Chris Quenelle is a tools developer at Oracle Corp. He's worked on performance and debugging tools at Sun and Oracle for over 15 years. He reads comic books and science fiction, and has more tivos than he can keep track of.

 

September 2010
S M T W T F S
« Jun    
 1234
567891011
12131415161718
19202122232425
2627282930  

Types, Objects and Generic Types

Assume the axiom that punctuation is evil.  Using multiple kinds of brackets for similar functionality in a language is unnecessarily complex.

The result is:

The relationship between a generic type and it’s concrete types should be expressed in the same way as for the relationship between a type and the objects that are instances of it.

In C++, constructors use: foo(object1, object2), but templates use Foo<Baz,Bar>

Can we unify the syntax for these similar concepts without making the language complex?

It’s completely clear to me why using different punctuation makes it easier to explain how the compiler is implemented, and easier to implement the compiler.  But I don’t think the distinction is necessary to make the source code easier to read and write.

Let’s say we only have “objects”. “Type” would be a role that on object plays with respect to another object. The compiler simply instantiates some objects at compile time, as part of the compilation process.  That seems like a clear concept for coders to understand.

The goal of a programming language is to facilitate the writing and maintaining of software.  It’s not to make the compiler’s job easier.

http://quenelle.org/unix/wp-content/plugins/sociofluid/images/digg_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/reddit_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/dzone_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/stumbleupon_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/delicious_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/furl_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/technorati_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/facebook_24.png http://quenelle.org/unix/wp-content/plugins/sociofluid/images/twitter_24.png

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>