The Artima Developer Community
Sponsored Link

Agile Buzz Forum
.NET - pure OO or hybrid?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
.NET - pure OO or hybrid? Posted: Nov 22, 2003 6:22 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: .NET - pure OO or hybrid?
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement
I recently heard someone say that all data in .NET is represented by objects. There are value types and references types, but both are objects. I disagreed with the statement, but it took me a bit of research and thinking to justify my point.

In C#.NET, you can do something like this:

	System.Console.WriteLine (5.GetType().Name);
Since GetType is a method in Object, it seems to imply that literal integers (or any value type) can respond to messages. The trick here, however, is that .NET performs automatic boxing. It converts the value type 5 into the Int32 reference type 5 before calling GetType() on it. In my books, automatic conversion (requiring allocation and a copy) from a non-object into an object whenever a message is sent doesn't qualify the language as being a pure object oriented language. What do you think?

Read: .NET - pure OO or hybrid?

Topic: Re: Refactoring Previous Topic   Next Topic Topic: Re: Guess what? Spam pays

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use