Industry Misinterpretations 20: Coding Mistakes
Dave Buck, Michael Lucas-Smith, and I recorded the show yesterday afternoon, and we had an interesting conversation about common Smalltalk coding issues that come up. Here's what we convered:
- implementing = without implementing hash
- poor hash functions causing many collisions in Sets and Dictionaries
- multiple initialization with super new initialize
- failing to call super initialize
- improper copying (shallow copy vs. deep copy vs. partial copy)
- condition ifTrue: [^true] ifFalse: [^false]
- at:put: returns the element, not the collection
- failing to use 'yourself'
- not using streams and using collections instead which memory bounds you and creates work for the garbage collector
- collections created too small
- Not understanding the Process Model (specific to Cincom Smalltalk)
It's just under 40 minutes, and includes this week's Smalltalk Jobs Report from James Savidge. Questions, comments, or critiques? Send them to smalltalkpodcasts@cincom.com
Enclosures:
[http://www.cincomsmalltalk.com/audio/2007/industry_misinterpretations-01-28-07.mp3 ( Size: 7177808 )]

Comments
Hash in Squeak
[Andres] January 28, 2007 18:40:31.315
Luciano Notarfrancesco and myself first implemented the hashMultiply approach to hashing Symbols, as well as the WeakSet Symbol table for Squeak, ca. August of 2000 while working at Exobox.