The Artima Developer Community
Sponsored Link

Agile Buzz Forum
What's in a method?

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
What's in a method? Posted: Jul 22, 2008 9:16 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: What's in a method?
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

I was having an interesting discussion with Travis yesterday about pragmas and their syntax. This was an extension of a long thread about pragmas on the vwnc mailing list. We were discussing what it was about pragmas we liked and didn't like.

One message about pragmas that seems to have been lost on the thread is what they are. They're actually two things; a) attributes - which lets you store any metadata you want on a method, b) a new syntax for defining attributes in your source code.

Now, you could drive the method attributes from a UI without adding the special syntax - and some people do (I even do in some of my code), but the discussion was more about the special syntax that was added to VisualWorks and why it matters.

Travis notes that the method signature is also not Smalltalk code - it is in fact more metadata to the compiled method. If you look at CompiledMethod, to find its selector it needs to reflect off the class it is installed on.

So why do we blend the source code to a method with the signature of a method? Well, pragmatism. It's incredibly convenient to be able to edit the signature with the code itself. When you stop to think about it - pragmas are the same. Is it easier to pull down a menu to define an attribute on a method, or easy enough just to write some code that you can copy, paste, move around, edit - all in the same place that's contextually bound to the method you're actually working on...

I think the answer is pretty obvious to most of us. So the idea is simple enough, the body of a method contains more information than just the methods code. We interpret its source code to extract more information out of it than just the executable portion.

I have no problems with this and I tend to wonder if this approach will lead us in new directions down the road too... who knows.

Read: What's in a method?

Topic: Distributing teams is a silly thing to do Previous Topic   Next Topic Topic: Web Velocity at Smalltalk Solutions

Sponsored Links



Google
  Web Artima.com   

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