The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Don't be over-clever in code

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
Don't be over-clever in code Posted: Jun 12, 2007 9:52 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Don't be over-clever in code
Feed Title: Cincom Smalltalk Blog - Smalltalk with Rants
Feed URL: http://www.cincomsmalltalk.com/rssBlog/rssBlogView.xml
Feed Description: James Robertson comments on Cincom Smalltalk, the Smalltalk development community, and IT trends and issues in general.
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Cincom Smalltalk Blog - Smalltalk with Rants

Advertisement

Urban Honking goes to great pains to explain why using syntax tricks in Ruby to get to something like this:

Hpricot(my_document)

Is a good thing. Here's a question - if you stumbled on that in code, would you have any idea what it did? That's why I left this comment over there:

In Smalltalk, methods can begin with capital letters; it's just not usually done. However, all messages do need a receiver, so in Smalltalk you would have to write something like:

Parser Hpricot: someXhtml.

Seeing as the method named Hpricot is badly named - it doesn't say anything about what the method does - I'd instead write something like:

Parser parseXhtml: someXhtml.

which is way, way more obvious for the porr follow on developer who has to read the code.

Which leaves me wondering why you think using clever syntax that obscures meaning is a good thing? I prefer to leave that the C programmers, myself...

I've out-clevered myself in Smalltalk many times; it's never a good idea.

Technorati Tags: ,

Read: Don't be over-clever in code

Topic: Cliche Based Analysis Previous Topic   Next Topic Topic: Resharper 3.0 Member Re-Ordering Settings

Sponsored Links



Google
  Web Artima.com   

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